Get Percona XtraDB Cluster running on Debian Squeeze

Since Percona has announced their XtraDB Cluster in early January (Announcement of Percona XtraDB Cluster) I really wanted to give it a try.

My test setup were 3 small identical XEN VMs (1Gb Ram, 5Gb disk) running on debian squeeze.

Get up and running from a complete fresh squeeze

  1. apt-get install curl rsync
  2. download the .deb packages from
  3. Install Perconas Key: curl http://www.percona.com/downloads/RPM-GPG-KEY-percona | apt-key add -
  4. Add the Percona Repository to your apt sources: deb http://repo.percona.com/apt squeeze main deb-src http://repo.percona.com/apt squeeze main (don't forget the apt-get update)
  5. This might not be the cleanest, but the laziest way to install the packages: dpkg -i *.deb apt-get -f install dpkg --configure -a
  6. update your mysql config binlog_format=ROW wsrep_provider=/usr/lib64/libgalera_smm.so wsrep_cluster_address=gcomm:// wsrep_slave_threads=2 wsrep_cluster_name=xtradbClusterTest wsrep_sst_method=rsync wsrep_node_name=node3 innodb_locks_unsafe_for_binlog=1 innodb_autoinc_lock_mode=2
  7. restart mysql

Now your first node should be up and running. For the additional nodes, it's a little bit different

  1. It was much easier to copy (&change) the my.cnf to the new node, before installing all the packages.
  2. Change "wsrep_node_name" to be unique for every new node
  3. Change "wsrep_cluster_address=gcomm://" to "wsrep_cluster_address=gcomm://[ip of a running node]"
  4. now install the packages as mentioned before

You can check your cluster status with show status like 'wsrep_%'; wsrep_cluster_size will tell you how many nodes are currently up and running, wsrep_local_state_comment will tell you the state of the local node.

Congratulations, you now have a cluster. Play around, create tables on one node, delete data on another, take new nodes in, crash other ones... :)