Installing The Galera-Iworx Cluster - Page 2

Configure MySQL

We are ready to go a step further and start with the configuration of MySQL.

First inititate MySQL for the first run:

mkdir /var/log/mysql
chown -R mysql:mysql /var/log/mysql

Now we can start mysql for the first time:

chkconfig mysqld on && service mysqld start

 

Create a MySQL restore set

To make it later on possible to install configure Interworx without messing up the Galera installation we have to copy some file to a secure location (on all nodes):

service mysqld stop
mkdir /tmp/interworx /tmp/interworx/etc/
cp /etc/my.cnf /tmp/interworx/etc/my.cnf
mkdir /tmp/interworx/etc/init.d
cp /etc/init.d/mysqld /tmp/interworx/etc/init.d/mysqld
mkdir /tmp/interworx/usr /tmp/interworx/usr/bin
cp /usr/bin/mysqld_safe /tmp/interworx/usr/bin/mysqld_safe
mkdir /tmp/interworx/usr/libexec
cp /usr/libexec/mysqld /tmp/interworx/usr/libexec/mysqld
mkdir /tmp/interworx/var/ /tmp/interworx/var/lib
cp -r /var/lib/mysql /tmp/interworx/var/lib

 

Galera-Configuration

To configure the Galera Cluster we go to the http://www.severalnines.com/galera-configurator/ website. We picked the following settings, but change according to your requirements:

Vendor:                      Codership (based on MySQL 5.5)
Infrastructure:              Other
Operating  System:           RHEL6 - Redhat 6.3/Fedora/Centos 6.3/OLN 6.3/Amazon AMI Platform:Linux  64-bit (x86_64)
Number of Galera  Servers:   3+1
MySQL PortNumber:            3333    (haproxy, interworx on 3306)
Galera PortNumber:           4567
Galera SST  PortNumber:      4444
SSH PortNumber:              22
OS User:                     root
MySQL Server  password:      pw4mydatabase
CMON DB password:            pw4myCMON
Firewall  (IPTables):        Disable
System Memory:               16 Gb
WAN:                         no
Skip DNS Resolve:            no
Database Size:               < 8GB
MySQL Usage:                 High write/High read
Number of cores:             16
Max connections per  server: 1500
Innodb_buffer_pool_size:     11319
Innodb_file_per_tabel: 	  yes
ClusterControl  Server:      172.20.0.1
Apache user:                 apache
WWWROOT:                     /var/www/html/
Config  directory:           /etc/
Server-ID 1:                 172.20.0.2
Datadir:                     /var/lib/mysql 
Server-ID 2:                 172.20.0.3
Server-ID  3:                172.20.0.4
Email address:               your@email.com

Click on Generate Deployment Scripts and retrieve them from your mailbox shortly after.

 

Install Galera Cluster

Now we are ready to install the Galera cluster software

cd /usr/local/src/
wget http://www.severalnines.com/galera-configurator/tmp/bhhrgonbsft2e3o2vhlt0ip9v0/s9s-galera-2.2.0-rpm.tar.gz
tar xvfz s9s-galera-2.2.0-rpm.tar.gz
cd s9s-galera-2.2.0-rpm/mysql/scripts/install

Before running the installer change the following:

echo "local_mysql_port=3333" >> ../../config/cmon.cnf.agent
echo "local_mysql_port=3333" >> ../../config/cmon.cnf.controller
echo "local_mysql_port=3333" >> ../../config/cmon_rrd.cnf

and add the bold line to the files ../../config/my.cnf and ../../config/my.cnf.cmon

[MYSQLD]
old-passwords=1
Share this page:

3 Comment(s)

Add comment

Comments

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:

http://docs.interworx.com/interworx/clustering/index-System-Requirements.php (item 2.3)