Schogini - Amazon AWS, Magento and Mobile Developers
 

Magento 2 EE AWS Route53 Based Disaster Recovery and Custom Maintenance Page on AWS EC2 with Load Balancer and AutoScaling

Success Story

Customer needed an AWS Route53 based custom solution to redirect M2EE maintenance page that masks all clusters of the production environment.

This case study started in February, 2016. It was a period when completely revised Magento 2 version was being launched worldwide!

Customer

Magento 2 EE Enterprise Edition with AWS EC2 Architecture with Single AWS EC2 Admin Instance, Four to Sixteen AutoScaling Front-end EC2 Clustered Instances connected via AWS Elastic Load Balancer. Databases used were AWS RDS, AWS Elasticache. Server environment was NGINX with PHP-FPM and Varnish.

Requirement

Single click facility to place the entire cluster in maintenance mode so that all frontend user of Magento sees a well designed custom maintenance page. This system should be seamlessly integrated into the deployments pipeline. Thus enhance Deployment Automation which is a part of the Build automation echo system.

Caveats

Since the entire architecture was using AWS Load Balancer with multiple servers connected to it, it was not possible to use Magento 2’s built-in maintenance mode and maintain the atomicity required. The client did not want some customers seeing the live site and some not, which could create inconsistencies in the shopping cart system.

Solution

  • Customer’s domain name zone was already hosted at the AWS Route53
  • AWS S3 bucket was created, containing the custom created maintenance page website
  • Additional secondary A records were added to the domain name and www.domain name
  • First one was designated as Primary and the second one as Secondary
  • Secondary A records were pointed to the above S3 bucket
  • Created new AWS Route53 Health Check which was connected to a custom flag in the M2EE Admin server
  • Assigned the above Health Check to the Primary A records of domain name and www.domain name
  • Custom Bash script was developed to place the flag to true in the Magento 2 EE Admin server
  • In addition to the above, provision was provided to place the site under maintenance mode using Magento’s built-in maintenance mode
  • Backup and rollback and custom IP exclusions for front-end visibility to the DevOps team was provided as well

Advantages

This maintenance mode solution had the additional advantage of acting as a Disaster Recovery system since the flag also was connected to a built-in watchdog system in case of a nasty shop breakdown.

Customer was happy to hide the entire Magento clustered environment under maintenance in a professional and safe manner with Built-in Backup and Rollback rollback mechanism in case of any failures in the DevOps delivery pipeline.

GET THE SOLUTION!

Author

Sree - Founder/MD/Chief Cloud & DevOps Architect
Sree is an evangelist and thought leader in the Continuous Delivery and DevOps space. In addition to being a Cloud Architect, he also imparts training in AWS, Docker and other DevOps related technologies. Sree's core speciality is in building scripted, version-able, repeatable, auto-scaling, load-balanced and self-healing infrastructures. Sree also works in server-less architectures using AWS Lambda service and Internet of Things (IOT). Sree is also an Amazon Certified AWS Cloud Architect with 15+ years of server experience.
Know more about the author.
 
 
 

CONTACT US

We love to talk to you, all enquires are replied to in under 4 hours.