Installing Percona XtraDB my SQL Cluster on RHEL6.0 and Windows azure – notes from the field-1

I have been trying to install Percona MySQL Cluster on Linux Azure VM, I finally managed to do it after little struggle, I have sum’d my notes here because I believe that Percona needs to work on their documentation:

– Linux Preparation:

If you don’t have Linux subscription, then add Centos Rep using the following steps:

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

also:

vi /etc/yum.repos.d/centos.repo

[centos]
name=CentOS $releasever – $basearch
baseurl=http://ftp.heanet.ie/pub/centos/6/os/$basearch/
enabled=1
gpgcheck=0

After completing these steps, you need to add Percona Repo:

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

Then you can proceed with the installation:

yum install Percona-Server-client-56 Percona-Server-server-56

Now you need to prepare MySQL configuration file, the configuration is different for the first node, a sample file is:

# Path to Galera library
wsrep_provider=/usr/lib64/libgalera_smm.so
# Cluster connection URL
wsrep_cluster_address=gcomm://192.168.32.168,192.168.32.169
# In order for Galera to work correctly binlog format should be ROW
binlog_format=ROW
# MyISAM storage engine has only experimental support
default_storage_engine=InnoDB
# This changes how |InnoDB| autoincrement locks are managed and is a requirement for Galera
innodb_autoinc_lock_mode=2
wsrep_cluster_name=mycluster1
wsrep_node_address=192.168.32.168
wsrep_node_name=’localhost’
wsrep_sst_method = rsync
wsrep_sst_auth = sstuser:secret

if you defined the wsrep_cluster_address , you need to bootstrap the cluster using the following command:

/etc/init.d/myslqd bootstrap-pxc –wsrep-cluster-address=”gcomm://”

This will instruct the first node to start without any other cluster node, later cluster nodes can be started using:

/etc/init.d/mysql start

before starting the second nodes, you need to do the following steps:

Grant Replication permission:

GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO ‘sstuser’@’localhost’ IDENTIFIED BY ‘secret’;

disable SELinux:

sudo setenforce 0

and configure the firewall to allow the required ports communications, once done you are fine and ready to go.