yum upgrade openssl* -y
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
on each server:
yum install Percona-XtraDB-Cluster-57
If you are running Red Hat or CentOS, add the following configuration variables to /etc/my.cnf on the first node:
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_name=pxc-cluster
wsrep_cluster_address=gcomm://server1,server2,server3
wsrep_node_name=pxc1
wsrep_node_address=server1
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=sstuser:passw0rd
pxc_strict_mode=ENFORCING
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
# on first node
systemctl start my...@bootstrap.service
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'rootPass';
if failed so run and change passowrd:
set global validate_password_policy=LOW;
Before adding other nodes to your new cluster, create a user for SST and provide necessary privileges for it. The credentials must match those specified when Configuring Nodes for Write-Set Replication.
mysql> CREATE USER 'sstuser'@'localhost' IDENTIFIED BY 'passw0rd';
mysql> GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO
'sstuser'@'localhost';
mysql> FLUSH PRIVILEGES;
show status like 'wsrep%';
+----------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------+--------------------------------------+
| wsrep_local_state_uuid | c2883338-834d-11e2-0800-03c9c68e41ec |
| ... | ... |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| ... | ... |
| wsrep_cluster_size | 1 |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| ... | ... |
| wsrep_ready | ON
Starting the Second Node:
service mysql start
After the server starts, it should receive SST automatically.
To check the status of the second node, run the following:
mysql@pxc2> show status like 'wsrep%';
+----------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------+--------------------------------------+
| wsrep_local_state_uuid | c2883338-834d-11e2-0800-03c9c68e41ec |
| ... | ... |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| ... | ... |
| wsrep_cluster_size | 2 |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| ... | ... |
| wsrep_ready | ON |
+----------------------------+--------------------------------------+
40 rows in set (0.01 sec)
start the third node
Verifying Replication
restart first node so it won't be in bootstrap mode:
systemctl stop my...@bootstrap.service
service mysql start
I did not face any problems yet, took server down while running some workload threw jmeter