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.eval(ez_write_tag([[580,400],’howtoforge_com-medrectangle-3′,’ezslot_2′,121,’0′,’0′]));



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
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 eval(ez_write_tag([[580,400],’howtoforge_com-medrectangle-4′,’ezslot_1′,108,’0′,’0′]));

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
About the Author

Leave a Reply