Installing The Galera-Iworx Cluster

Writer of this guide is Jos Jans ( , working at UP learning ( a Dutch E-learning specialist. My thanks go to him for his time and dedication to this project.

This document describes the installation of the Galera/Interworx cluster. This cluster provides the default Load Balancing that is available within Interworx, and additionally MySQL loadbalancing through MySQL Galera Clustering.



This guide assumes that you have installed your server with CentOS 6.4 (or later), and that you have double NIC’s with one External connection (192.168.120.x), and the other in a private VLAN (172.20.0.x).


Install the Atomic & EPEL repositories

Since we need some additional packages, we have to add some repositories to the server installation.

yum -y install wget wget rpm -Uvh epel-release-6-8.noarch.rpm wget -q -O - | sh

Add a line to the atomic repo (since we don't want to use the atomic repo for mysql)

nano /etc/yum.repos.d/atomic.repo



Monitoring tools

In this part we will setup, the local monitoring tools

yum -y install nano git iftop ntop htop mytop lynx screen gcc mutt innotop iotop mtr man perl-DBD-MySQL


Other packages

Ok, now we are able to monitor the server we want to install the real software:

Webserver programs

yum -y install httpd clamav mysql mysql-server mysql-devel php-common php-dom php-pear php-soap php-pdo php-mysql php-devel php-gd php-ldap php-mbstring php-intl php-mcrypt phpmyadmin php-xmlrpc php-cli php-iconv php-ctype php-tokenizer aspell php-xcache xcache-admin

Common programs (especially needed if you use iscsi for Interworx later on)

yum -y install iscsi-initiator-utils lsscsi device-mapper-multipath dstat nfs-utils nfs-utils-lib


Set hostname

On all of the servers we will add the hostnames to the /etc/hosts file

echo master >> /etc/hosts
echo slave1 >> /etc/hosts
echo slave2 >> /etc/hosts
echo slave3 >> /etc/hosts
echo master >> /etc/hosts
echo slave1 >> /etc/hosts
echo slave2 >> /etc/hosts
echo slave3 >> /etc/hosts

If this is done, make sure that hostname and hostname -f returns the same value!!
and hostname -i   doesn’t give you or

hostname && hostname -f


SElinux & IPTables

Disable these services by running:

service iptables stop
setenforce 0

Edit the file /etc/sysconfig/selinux so it reads:



Configure ntpd

Since cluster services need the correct time we have to install the ntpd (timeserver deamon).

yum -y install ntp && chkconfig ntpd on

Let's put in some timeserver as well:

nano /etc/ntp.conf



Create ssh-keys (on each server)

Because all the servers should be able to communicate with each other we have to create on each server a ssh-key.

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Now add the created ssh public keys (/root/.ssh/ to all the servers in the file:

nano ~/.ssh/authorized_keys

If this step is completed try to logon to each server, and accept storage of the host key.

ssh master  Yes
ssh slave1 Yes
ssh slave2 Yes
ssh slave3  Yes

Now restart the server:

shutdown -r now

Share this page:

3 Comment(s)

Add comment


From: Glenn Kelley at: 2013-06-27 18:10:31

This is perhaps one of the best write-ups I have seen on How-To-Forge.

Truth to be told - this should have the folks @ cPanel a bit worried - This provides not only a clustered approach for Httpd & Email services but also now MySQL.

I did the same approach but chose to use MariaDB instead (just a binary replacement after all) - the reasons for this however were because Maria works a bit better with Innodb, has some excellent backup utilities as well as RedHat (thus CentOS) and others including SlackWorx are moving this direction as well.

David did his homework when it came to this write-up.

From: Anonymous at: 2013-08-22 15:27:46

Hi guy,

Careful if you want to purchase interworx cluster panel!!!   On the page it clearly state no hidden charges, but no mention that it require 1 license purchase per server (so a cluster with 1 sever is NOT called a cluster)! !So after you purchase and try to install all, you realize it will NOT work and need to buy more (HIDDEN CHARGES!!!!).

So total waste of time!!!!!BE CAREFUL!!!



From: at: 2013-11-16 21:13:04

Hi Anonymous,

 the Interworx page on clustering clearly states that you need a license for each node: (item 2.3)