Installing The Galera-Iworx Cluster - Page 3

Now run the installer:

./  2>&1  | tee cc.log

First the setup will try to ping all nodes. If ok, setup will start, since we disabled SELinux and Configured the SSH keys we can answer the following:

do you want to set SELinux to Permissive mode. n
Can you SSH from this host to all other hosts without password? y

After successfully configuring the Galera cluster, there should be a ClusterMonitor (cmon) page where you can connect to on the master node at:



Some pages require JPGraph, install this on the master:

cd /usr/local/src
mv download.php\?p\=5 jpgraph.tar.gz
tar xvfz jpgraph.tar.gz -C /var/www/html/cmon
cd /var/www/html/cmon
ln -s jpgraph-3.5.0b1 jpgraph
chown apache:apache -R jpgraph*


Change MySQL.cnf (configure UTF-8 etc.)

Since we want to use the UTF-8 character set in our database we add this option to the [MYSQLD] section of the file:

#Add some interworx  settings
# define default  character sets
   collation-server = utf8_unicode_ci
   init-connect='SET NAMES utf8'
   character-set-server  = utf8
   slow_query_log  = 1
   long_query_time  = 10
   myisam-sort-buffer-size  = 8M

Furthermore we change the environment variables to UTF8:

echo "LANG=en_US.utf-8" >> /etc/environment
echo "LC_ALL=en_US.utf-8" >> /etc/environment

Now we can restart MySQL to make this setting active for the databases that will be created in the future.

service mysql restart

Now we have to correct some installer files. Since mysql-libs is removed by the Galera setup. We have to use the --excludepath option to get around the following error:

file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.5.28_wsrep_23.7-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.67-1.el6_3.x86_64

Download the mysql-libs rpm file and run it with the --excludepath option (which isn't available when using yum ):

cd /usr/local/src
rpm -Uvh mysql-libs-5.1.67-1.el6_3.x86_64.rpm --excludepath=/usr/share/mysql/

Reinstall the packages that where removed because of the mysql-libs dependencies.

yum -y install nagios-plugins-all perl-DBD-MySQL innotop mytop


HAProxy setup

Next step is installing the HAProxy setup that uses cmon of the Galera cluster, to show its status information. At the master server we have to run the following commands:

# the installer needs to be extracted inside the galera installation folder!!!
cd /usr/local/src/s9s-galera-2.2.0-rpm/mysql/scripts/install
tar zxvf s9s-haproxy.tar.gz
cd haproxy

Before installing lets change some settings inside the following files:           HAPROXY_MYSQL_LISTEN_PORT="3306"                  "\tserver ${SPLIT[0]}  ${SPLIT[0]}:3333 check $STAT"           MYSQL_PORT="3333"     MYSQL_PORT="3333"

Now run the installer:

./ rhel galera

When the setup is completed without errors you have to grant the installer host rights to mysql instances on each server.

mysql -uroot -ppw4mydatabase
GRANT ALL ON *.* TO 'root'@'' IDENTIFIED BY 'pw4mydatabase';

There is something what probably will go wrong tho, which is related to the defaults requiretty setting. It is possible that you get an error message like:

Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: sorry, you must have a tty to run sudo stdin is not a terminal.

If this happens edit the sudoers file (on all servers) by using:


and change the line

 Defaults    requirettys


#Defaults    requirettys

Now it should be possible to connect to the loadbalanced cluster on the following address:

mysql -h192.168.120.1 -P3306 -uroot -ppw4mydatabase

Check this from the slave nodes to make sure.

You can connect to the status page of the HAProxy,
(default admin/admin). You can change the username/password by editing the file:

nano /etc/haproxy/haproxy.cfg
group admin users admin
user admin insecure-password pw4adminHA
user stats insecure-password pw4userHA
Share this page:

0 Comment(s)