How to Run a Magento Cluster on Amazon Web Services?
Magento is a well known eCommerce platform. Till now, we have seen many blog posts that describe the advantages, popularity as well as importance of Magento. Also, we have compared this with several other eCommerce platforms. Today, we will see how Magento cluster can be used on Amazon Web Services.
Using Magento cluster on AWS:
Magento applications that operate on the cloud are always in need of the infrastructure that suits their specific requirements. In order to avoid slow page loads and revenue loss; it is necessary for a Magento store to have high availability and scalability.
Here, we will see how these both can be available with a particular set up. Using Magento on a Zend Server cluster that is functional on Amazon Web Services makes it easy to scale the operations in case of sudden traffic.
It is a powerful application that monitors capabilities as well as performance optimization tools. The structure of Zend Server is perfect platform for Magento apps as it automatically proliferates changes to configuration over all the servers in a cluster.
Applications and configurations are arranged and applied to the new server in the cluster. Using the Zend’s Session Clustering, all sessions are shared with the cluster thus offering a mechanism which can easily bear the faults as well as provide high performing session storage system.
Overview about Magento Cluster Steps:
First of all, two zend server instances will be installed on AWS and then these two servers will be connected to MYSQL RDS instance which will serve as cluster database. Further, a load balancer will be installed to split the traffic between two servers.
Once the load balancer is ready and the cluster starts functioning in a perfect manner then another MYSQL RDS will be created for handling Magento database. Then, at the end; Magento application is to be deployed on the cluster.
In order to carry out the entire process, following things are to be needed:
- AWS Account
- Magento Application Package
- 30 minutes of Spare time.
Step 1: Launching Zend Server Nodes
A Zend Server note is the back bone of future Zend cluster. So, installing this is of top priority. In order to do this, one must have access to AWS Management Console and then choose EC2 compute service in order to open EC2 dashboard.
Now, here go to “Launch Instance” and then you will get a dialog box with Step 1 of AWS instance.
Choose AWS Marketplace from the left hand side menu and then search for Zend Server using the top search box. The complete list of all Zend Server AMIs will be displayed.
There are several Zend server editions and versions available. One can select any from Zend 6.3 with PHP 5.3 and LTS support. Here, we will go for PHP 5.6 and Features of Zend server 8.5 Professional Edition by clicking on the adjacent Select button.
Choose one of the available instance types. Instances are basically virtual servers that have different hardware set ups. Choose the hardware combination based on the application as well as the load you expect.
Here, you will need m3.medium instance.
Step 2: Developing Cluster Database
Zend Servers need central database that can be used to store the cluster blueprint as well as cluster configurations. The next step shows how to develop MYSQL database with the use of AWS RDS service.
First of all, we need to go to AWS Management Console and then choose RDS in the database section. From the left menu, choose Instances and then select Launch D8 Instance button. Here, you will get a list of all database engines and then MYSQL will be selected by default.
Now, based on your needs; choose whether to use Multi A Z deployment or not and then move on to the next step.
Here, you need to select a DB instance class from relevant drop down menu and then configure your DB instance identifier, username as well as Password.
Step 3: Develop the Cluster
Now, we have two Zend server instances and one RDS instance running. Now is the time to connect the components together and then develop the cluster. Before developing the cluster, it is necessary to configure the same.
Choose the Network security group and then open the Inbound tab. Now click the Edit button and add the following rule:
- Type: All traffic
- Source: Custom API
- IP: the VPC ID
Select Save when you are done.
Now, in Zend Server UI; choose the Servers> Manage Servers Page and then select Join Cluster. Add the details like as Server name, Node IP, Database Host, Database Name, database username and password.
And it’s done, the Cluster is created.
Step 4: Configuring the Load Balancer
Before adding Magento application; it is necessary to add load balancer to the cluster. Choose “Load Balancers” from EC2 console and then click on “Create Load balancer” button. Choose the name for New load balancer and then create LB inside Drop down menu.
Choose the Security Group again and then proceed to the next step Configure Health Check.
Step 5: Deploying Magento
The final step of this tutorial is to deploy Magento. For this, we need to create a separate Database; as one database cannot be used for both Magento as well as Zend Server. So, we need to create another RDS instance in the same way as we did for Zend Server database.
Creating a new virtual host:
Access the Zend Server, go to Applications > Virtual Hosts. Click on Add Virtual Host page and then enter the name of the virtual host.
All other default settings are enough in most cases. So, just click on Next for all other steps of the wizard.
Deploying the application:
Go to Manage Apps and then click Deploy Application Button. Now, upload the Magento application package and click on Next.
On the Application Details, select the virtual host developed by you. Continue with the deployment wizard and accept the licence agreement after reading it thoroughly. Add all the details on the new database.
Use the new database’s end point and enter the remaining database details as defined while developing the new RDS instance. Keep in mind the Magento admin username and password and then click on Deploy.
Finally, the Magento application is deployed on Zend Server.
After deploying successfully Zend Server on Magento. You can now use several tools that can be used to monitor and optimize your applications. This can be Zend Monitoring, PHP configuration, Z ray, Page Cache, Job Queue.
A useful way to know these features is to go to “Getting Started” Page in Zend server UI. Here, you will find information and resources that can be used to become familiar with various features.
Well, hope this blog post will be useful to you. For more such updates, Stay tuned with us.