Percona Xtradb Cluster Ubuntu 14.04 (2 nodes)

Download Template
Setting up a basic percona mysql cluster

akonkol
January 9, 2015





gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg -a --export CD2EFD2A | sudo apt-key add -
sudo apt-add-repository http://repo.percona.com/apt 

touch /etc/apt/preferences.d/00percona.pref
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001



sudo apt-get update
apt-get install percona-server-server-5.5 percona-server-client-5.5


#node1
#vi /etc/mysql/my.cnf
[mysqld]
bind-address            = %{node_1_ip_address}%

##GALERA
# Path to Galera library
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address=gcomm://
# 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
# Node #1 address
wsrep_node_address=%{node_1_ip_address}%
wsrep_node_name=%{node_1_hostname}%
wsrep_sst_receive_address=%{node_1_ip_address}%:4444
# SST method
wsrep_sst_method=xtrabackup-v2
# Cluster name
wsrep_cluster_name=openstack_mysql_cluster
# Authentication for SST method
wsrep_sst_auth="sstuser:%{sstuser_password}%"





#node2
#vi /etc/mysql/my.cnf
[mysqld]
bind-address            = %{node_2_ip_address}%


##GALERA
# Path to Galera library
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_address=gcomm://%{node_1_ip_address}%,%{node_2_ip_address}%
# 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
# Node #2 address
wsrep_node_address=%{node_1_ip_address}%
wsrep_node_name=%{node_2_hostname}%
# SST method
wsrep_sst_method=xtrabackup-v2
# Cluster name
wsrep_cluster_name=openstack_mysql_cluster
# Authentication for SST method
wsrep_sst_auth="sstuser:%{sstuser_password}%"
wsrep_sst_donor=%{node_1_hostname}%


You must be logged in to comment.