Percona XtraDB Cluster

Features

  • Synchronous replication. Transaction either commited on all nodes or none.
  • Multi-master replication. You can write to any node.
  • Data consistency. No more unsynchronized slaves.

Configuration

Add this to my.cnf for all nodes:

[mysql]
binlog_format=ROW
wsrep_cluster_name=clustername
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_slave_threads=2
wsrep_sst_method=rsync
innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2

In addition, add this to the primary node:

wsrep_node_name=node1
wsrep_cluster_address=gcomm://

Second node:

wsrep_node_name=node2
wsrep_cluster_address=gcomm://node1.server.com

Third node:

wsrep_node_name=node2
wsrep_cluster_address=gcomm://node1.server.com