WordPress Cluster Installation Guide

wordpress logoWordPress is a highly popular open-source CMS, intended for creation of websites, blogs and apps. This tutorial shows how to deploy a WordPress application into Jelastic platform and configure it as a scalable cluster - such approach ensures high availability and reliability to strengthen your application.

Below, you can find guides for WordPress Cluster installation as:

WordPress Cluster Automatic Installation

This section explains how to get a ready-to-go WordPress Cluster solution in one click. If you already registered at Jelastic PaaS, package can be installed directly from your dashboard using Jelastic Marketplace.

If you don’t have an account, you can automatically get it and, simultaneously, initiate WordPress Cluster solution installation - just click the Get it hosted now button below and fill the form within the opened page.

deploy to jelastic button
As a result you’ll get a new environment with the following topology:

wordpress auto-cluster topology
For more details on the WordPress Cluster by Jelastic read the linked article or check the project sources at our JPS collection.

WordPress Cluster Manual Installation

Here, we’ll show you how to deploy WordPress Cluster solution on top of the following servers:
  • NGINX load balancer to distribute the incoming traffic inside a cluster
  • the WordPress application itself is handled with 2 Apache PHP servers
  • Memcached node retains all user sessions for backup, so that if one compute node fails, the second one can fetch them from this server and perform their further serving
  • 2 replicated MySQL DB servers with Master-Slave replication to enhance cluster performance and contribute its failover

wordpress cluster topology

The whole installation flow is divided on the following steps:

WordPress Deployment

Let’s create a new PHP environment and deploy the latest version of the WordPress application to it.

1. Log in to the Jelastic account with your credentials and navigate to the Environment Topology wizard by clicking the Create environment button.

create environment

2. Navigate to the PHP tab, select Apache application server and add the Memcached node. Specify cloudlet limits for your nodes, select the preferable region (if several ones are available) and set the name for your environment.

wordpress environment

Click the Create button at the bottom-right corner and wait a minute for environment to be created.

3. Meanwhile, download .zip package from the WordPress official site and upload it to the dashboard within the Deployment manager.

upload wordpress archive

4. Next, initiate deployment of the just uploaded wordpress.zip package to your environment.

deploy wordpress

Within the opened frame, specify the desired context name or leave it empty (the ROOT one will be used in this case).

deploy to environment

Note: You can enable zero-downtime deployment functionality to ensure application availability during the future re-deployment processes (i.e. updates).

Click the Deploy button to start deployment.

5. As a result, you’ll get an environment similar to the following one:

wordpress cluster environment

Great! The WordPress package was successfully deployed to your Jelastic environment.

Setup Session Storage

In order to retain all user sessions, we’ll set up the appropriate storage with Memcached node. As a result, in case of a single app server failure, the second one will be able to fetch these backups from Memcached and continue their processing.

1. Click the Config button next to your Apache node. Within the opened Configuration manager, navigate to the etc directory and find the php.ini file.

memcached module

Within it, enable the memcached module by adding the next string to the Dynamic Extensions section:


2. To activate the support of session storing, scroll down to the session block and add the next lines:

session.save_handler = memcached
session.save_path = "{server}:11211"

session config

Note: Instead of the {server} placeholder, you should paste the Memcached server IP address - find it by expanding the Additionally list next to this node in your environment.

memcached ip address

Don’t forget to Save changes you’ve made by clicking the same-named button.

3. Next, restart your Apache server with the appropriate Restart nodes button next to it.

restart nodes

Once server is up again, all sessions will be safely retained within the Memcached node.

Database Configuration

This step involves creation of two MySQL databases and their configuration to establish the master-slave replication. Such solution will increase the cluster’s performance, security and failover capacity.

1. Configure MySQL cluster according to the appropriate MySQL/MariaDB Database Master-Slave Replication guide.

2. After you’ve completed all of the steps within the linked instruction, navigate to the master DB admin panel and create a new database named wordpress.

wordpress database

Great! Now, we have a separate replicated DB specially for the WordPress application.

WordPress Installation

Once your database and application server are configured, you can proceed with the WordPress installation.

1. Navigate to the Jelastic dashboard and click the Open in browser button next to your environment with WordPress package deployed.

wordpress cluster

Installation will be started within the new browser tab.

2. The flow is rather simple, therefore let’s pay attention to the database connection settings only. Required fields should be filled up in the following way:
  • Database Name - enter the name of your database (in our case it’s wordpress)
  • Username - specify the username (it is root by default)
  • Password - type your password (the one you’ve received via email)
  • Database Host - paste the link to your master DB without the “http://” protocol and “/” at the end
  • Table Prefix - change the prefix if you want to run more than one WordPress instance in a single database.

    wordpress installation

Click Submit to proceed with the WordPress installation.

Cluster Configuration

After successfull installation of the WordPress CMS, we will add the second compute node to the environment topology in order to create cluster.

Note: The reason to add the second application server instance only after app installation and all the configurations, is that in such a way data on two Apache nodes will be synchronized. This allows to avoid double installation.

1. Switch back to the dashboard and click the Change environment topology button next to your main WordPress environment.

wordpress cluster topology

2. Add one more Apache application server node by clicking the + button (shown in the image below). Herewith, NGINX load balancer will be fetched automatically.

apache app server

Click Apply to add nodes.

Tip: With Jelastic you can easily configure automatic horizontal scaling for your WordPress cluster to smartly adjust the amount of application server nodes based on the incoming load.

wordpress cluster scaling

3. Now, if you open your environment in browser, a ready to work WordPress site will be shown.

wordpress site

That’s all! Your own highly reliable and scalable cluster with WordPress application is now  hosted at Jelastic.