Innovate faster and cut risk with PHP experts from Zend Services.
Beginning to advanced PHP classes to learn and earn global certification.
Help me choose >
Submit support requests and browse self-service resources.
Using an AWS CloudFormation template and Zend Server can help you automatically scale Magento. This is important for many reasons. When you use Magento to support an online store, it's important to ensure maximum scalability. That's because any interruptions to high availability and fast performance can negatively impact your revenue.
For this walkthrough, we'll focus on how to complete this set up on AWS, but you can use the same basic steps for other deployment options.
To achieve our goal, here are the steps we'll take:
This is the final step after which we will have Magento running on high available and auto scaled cluster.
Since we are going to run cluster on AWS you will need AWS account. Additionally it is expected that you know basic AWS terms like VPC, EC2 Instance, RDS Instance, etc. Additionally you have to be familiar with basic CloudFormation terms. Additionally I expect you to have a VPC for deployment (you can use default VPC if you want) and EC2 key pair ready for use.
You can use an AWS CloudFormation template generator to get started. Zend has a CloudFormation template generator that has some additional functionality like adding additional RDS server or ElastiCache service to template.
CloudFormation allows allocation of AWS resources as described by template files which utilize JSON format. CloudFormation operates with stacks of resources where each stack is created using a template.
AWS Marketplace has basic template that can be used to spin cluster.
Since we are going to deploy sample Magento web application, we'll use same RDS instance that Zend Server uses for storing cluster information. However, I strongly recommend to setup separate RDS instance for Magento database when deploying real production environment (either by adding another RDS in CloudFormation template or by setting it up manually).
You can find list of Zend Server products on AWS Marketplace. Zend Server is available on Ubuntu Server 14.04 LTS or RHEL 7 Operating System. Additionally there are three Zend Server editions - Developer, Professional, and Enterprise (note that Developer Edition does not have clustering capabilities and is intended for development and testing use only). There are also two versions of PHP supported - 5.6 and 7.0. For the purpose of our demonstration we will use PHP 7.0 - Zend Server Professional Edition (Ubuntu).
Here are the steps to deploy Zend Server Cluster on AWS:
We are going to deploy Magento 2.1.2 which is the latest version of Magento available as of writing of this blog. We are going to deploy Magento using Zend Deployment which simplifies deployment of PHP applications on Zend Server and provides additional features like customizable hooks for different stages of deployment and rollbacks.
Zend Deployment deploys Zend Deployment Package files, which is basically a zip archives with some predefined structure. You can read more about Zend Deployment here.
Zend Server ships with a few demo ZPK (Zend Application Package) applications including Magento. Unfortunately Magento ZPK that is shipped with Zend Server 9.0 is Magento 22.214.171.124. Although next version of Zend Server will have new Magento version, it is not ready yet. So for this article I developed my own Magento ZPK which utilizes Magento CLI in hook scripts to automate deployment. ZPK is available freely here. Please feel free to use this package as starting point for your customizations as needed.
Steps to deploy Magento on Zend Server Cluster:
Zend Server Cloud Solutions