Quick Galera Setup

Configuring the nodes

3 CentOS nodes with a minimal install

Galera1 :  192.168.0.231
Galera2 :  192.168.0.232
Galera3 :  192.168.0.233

On each node

rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
yum install Percona-XtraDB-Cluster-server
yum install Percona-XtraDB-Cluster-client
yum install xtrabackup
mkdir -p /mnt/data
mysql_install_db –datadir=/mnt/data –user=mysql

On each node put the following /etc/my.cnf

Galera1

[mysqld_safe]
wsrep_urls=gcomm://192.168.0.231:4567,gcomm://192.168.0.232:4567,gcomm://192.168.0.233:4567,gcomm://

[mysqld]
datadir=/mnt/data
user=mysql

binlog_format=ROW

wsrep_provider=/usr/lib64/libgalera_smm.so

wsrep_slave_threads=2
wsrep_cluster_name=galeracluster
wsrep_sst_method=rsync
wsrep_node_name=node1

innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
log-bin=mysqld-bin
server-id=1

Galera2

[mysqld_safe]
wsrep_urls=gcomm://192.168.0.231:4567,gcomm://192.168.0.232:4567,gcomm://192.168.0.233:4567,gcomm://

[mysqld]
datadir=/mnt/data
user=mysql

binlog_format=ROW

wsrep_provider=/usr/lib64/libgalera_smm.so

wsrep_slave_threads=2
wsrep_cluster_name=galeracluster
wsrep_sst_method=rsync
wsrep_node_name=node2

innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
log-bin=mysqld-bin
server-id=2

Galera3

[mysqld_safe]
wsrep_urls=gcomm://192.168.0.231:4567,gcomm://192.168.0.232:4567,gcomm://192.168.0.233:4567,gcomm://

[mysqld]
datadir=/mnt/data
user=mysql

binlog_format=ROW

wsrep_provider=/usr/lib64/libgalera_smm.so

wsrep_slave_threads=2
wsrep_cluster_name=galeracluster
wsrep_sst_method=rsync
wsrep_node_name=node3

innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
log-bin=mysqld-bin
server-id=3

Startup the cluster

on Galera1

mysqld_safe &

On Galera2 and 3

mysqld_safe &

Look at the mysql errorlog in /mnt/data for the following message. It means all 3 nodes are synced

130204  9:41:50 [Note] WSREP: Quorum results:
        version    = 2,
        component  = PRIMARY,
        conf_id    = 4,
        members    = 3/3 (joined/total),
        act_id     = 1,
        last_appl. = 0,
        protocols  = 0/4/2 (gcs/repl/appl),
        group UUID = 52e67407-6eae-11e2-0800-8eebc3f6cc80

Advertisements
Quick Galera Setup