[root@amb01 ~]# rpm -ivh epel-release-6-8.noarch.rpm 
[root@amb01 ~]# yum install -y bison bison-devel check check-devel boost boost-devel cmake readline readline-devel scons socat perl-DBD-MySQL
[root@amb01 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm
[root@amb01 ~]# rpm -ivh percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm

[root@amb01 ~]# tar zxvf Percona-XtraDB-Cluster-5.6.37-82.2.tar.gz
[root@amb01 ~]# cd Percona-XtraDB-Cluster-5.6.37-82.2
[root@amb01 Percona-XtraDB-Cluster-5.6.37-82.2]#  cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EMBEDDED_SERVER=0 \
-DWITH_WSREP=1 \
-DWITH_INNODB_DISALLOW_WRITES=1

[root@amb01 Percona-XtraDB-Cluster-5.6.37-82.2]# make && make install

[root@amb01 Percona-XtraDB-Cluster-5.6.37-82.2]# cd support-files/ 
[root@amb01 support-files]# cp mysql.server /etc/init.d/mysqld
[root@amb01 ~]#  chmod a+x /etc/init.d/mysqld

[root@amb01 ~]#  vi /etc/my.cnf
[mysqld]
bind-address=0.0.0.0
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0
wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so
wsrep_provider_options="gcache.size=1024M; gcache.page_size=512M"
wsrep_cluster_name = "Percona XtraDB Cluster"
wsrep_cluster_address = "gcomm://192.168.1.201,192.168.1.202,192.168.1.203"
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=sst:sst
wsrep_node_name = amb01
wsrep_node_address="192.168.1.201"

[root@amb01 ~]# tar zxvf percona-xtradb-cluster-galera-3-3.21.tar.gz
[root@amb01 ~]# cd percona-xtradb-cluster-galera-3
[root@amb01 percona-xtradb-cluster-galera-3]# scons
[root@amb01 percona-xtradb-cluster-galera-3]# cp libgalera_smm.so /usr/local/mysql/lib/
[root@amb01 percona-xtradb-cluster-galera-3]# cp garb/garbd /usr/local/mysql/bin/

[root@amb01 ~]# cd /usr/local/mysql/
[root@amb01 mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

[root@amb01 ~]# /etc/init.d/mysqld bootstrap-pxc
[root@amb01 ~]# service mysqld status
MySQL (Percona XtraDB Cluster) running (7664)              [  OK  ]

[root@amb01 ~]# mysql_secure_installation

[root@amb01 ~]# mysql -uroot -pabcd.1234
mysql> create user sst@'localhost' identified by 'sst';
Query OK, 0 rows affected (0.10 sec)
mysql> grant reload,lock tables,replication client,process on *.* to  sst@'localhost';
Query OK, 0 rows affected (0.06 sec)
mysql>  flush privileges;
Query OK, 0 rows affected (0.07 sec)

[root@amb01 ~]# netstat -tunlp | grep mysqld
tcp        0      0 0.0.0.0:4567                0.0.0.0:*                   LISTEN      24262/mysqld        
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      24262/mysqld


[root@amb02 ~]# rpm -ivh epel-release-6-8.noarch.rpm 
[root@amb02 ~]# yum install -y bison bison-devel check check-devel boost boost-devel cmake readline readline-devel scons socat perl-DBD-MySQL
[root@amb02 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm
[root@amb02 ~]# rpm -ivh percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm

[root@amb02 ~]# tar zxvf Percona-XtraDB-Cluster-5.6.37-82.2.tar.gz
[root@amb02 ~]# cd Percona-XtraDB-Cluster-5.6.37-82.2
[root@amb02 Percona-XtraDB-Cluster-5.6.37-82.2]#  cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EMBEDDED_SERVER=0 \
-DWITH_WSREP=1 \
-DWITH_INNODB_DISALLOW_WRITES=1

[root@amb02 Percona-XtraDB-Cluster-5.6.37-82.2]# make && make install

[root@amb02 Percona-XtraDB-Cluster-5.6.37-82.2]# cd support-files/ 
[root@amb02 support-files]# cp mysql.server /etc/init.d/mysqld
[root@amb02 ~]#  chmod a+x /etc/init.d/mysqld

[root@amb02 ~]#  vi /etc/my.cnf
[mysqld]
bind-address=0.0.0.0
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0
wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so
wsrep_provider_options="gcache.size=1024M; gcache.page_size=512M"
wsrep_cluster_name = "Percona XtraDB Cluster"
wsrep_cluster_address = "gcomm://192.168.1.201,192.168.1.202,192.168.1.203"
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=sst:sst
wsrep_node_name = amb02
wsrep_node_address="192.168.1.202"

[root@amb02 ~]# tar zxvf percona-xtradb-cluster-galera-3-3.21.tar.gz
[root@amb02 ~]# cd percona-xtradb-cluster-galera-3
[root@amb02 percona-xtradb-cluster-galera-3]# scons
[root@amb02 percona-xtradb-cluster-galera-3]# cp libgalera_smm.so /usr/local/mysql/lib/
[root@amb02 percona-xtradb-cluster-galera-3]# cp garb/garbd /usr/local/mysql/bin/

[root@amb02 ~]# cd /usr/local/mysql/
[root@amb02 mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

[root@amb02 ~]#  /etc/init.d/mysqld start
Starting MySQL (Percona XtraDB Cluster).Logging to '/usr/local/mysql/data/amb02.err'.
...State transfer in progress, setting sleep higher
.......                                                    [  OK  ]

[root@amb02 ~]# netstat -tunlp | grep mysqld 
tcp        0      0 0.0.0.0:4567                0.0.0.0:*                   LISTEN      19654/mysqld        
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      19654/mysqld


[root@amb03 ~]# rpm -ivh epel-release-6-8.noarch.rpm 
[root@amb03 ~]# yum install -y bison bison-devel check check-devel boost boost-devel cmake readline readline-devel scons socat perl-DBD-MySQL
[root@amb03 ~]# rpm -ivh libev-4.15-1.el6.rf.x86_64.rpm
[root@amb03 ~]# rpm -ivh percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm

[root@amb03 ~]# tar zxvf Percona-XtraDB-Cluster-5.6.37-82.2.tar.gz
[root@amb03 ~]# cd Percona-XtraDB-Cluster-5.6.37-82.2
[root@amb03 Percona-XtraDB-Cluster-5.6.37-82.2]#  cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EMBEDDED_SERVER=0 \
-DWITH_WSREP=1 \
-DWITH_INNODB_DISALLOW_WRITES=1

[root@amb03 Percona-XtraDB-Cluster-5.6.37-82.2]# make && make install

[root@amb03 Percona-XtraDB-Cluster-5.6.37-82.2]# cd support-files/ 
[root@amb03 support-files]# cp mysql.server /etc/init.d/mysqld
[root@amb03 ~]#  chmod a+x /etc/init.d/mysqld

[root@king03 ~]#  vi /etc/my.cnf
[mysqld]
bind-address=0.0.0.0
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0
wsrep_provider = /usr/local/mysql/lib/libgalera_smm.so
wsrep_provider_options="gcache.size=1024M; gcache.page_size=512M"
wsrep_cluster_name = "Percona XtraDB Cluster"
wsrep_cluster_address = "gcomm://192.168.1.201,192.168.1.202,192.168.1.203"
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=sst:sst
wsrep_node_name = amb03
wsrep_node_address="192.168.1.203"

[root@amb03 ~]# tar zxvf percona-xtradb-cluster-galera-3-3.21.tar.gz
[root@amb03 ~]# cd percona-xtradb-cluster-galera-3
[root@amb03 percona-xtradb-cluster-galera-3]# scons
[root@amb03 percona-xtradb-cluster-galera-3]# cp libgalera_smm.so /usr/local/mysql/lib/
[root@amb03 percona-xtradb-cluster-galera-3]# cp garb/garbd /usr/local/mysql/bin/

[root@amb01 ~]# su - mysql
[mysql@amb01 ~]$ mkdir backup
[mysql@amb01 ~]$ innobackupex --defaults-file='/etc/my.cnf' --galera-info --user='root' --password='abcd.1234' --galera-info /home/mysql/backup/     
[mysql@amb01 ~]$ cd backup/
[mysql@amb01 backup]$ scp -r 2018-09-27_12-02-00 mysql@192.168.1.203:/home/mysql/backup

[root@amb03 ~]# su - mysql
[mysql@amb03 ~]$ innobackupex --defaults-file=/etc/my.cnf --apply-log /home/mysql/backup/2018-09-27_12-02-00/
[mysql@amb03 ~]$ innobackupex --defaults-file=/etc/my.cnf --copy-back /home/mysql/backup/2018-09-27_12-02-00/

[mysql@amb03 ~]$ cd /usr/local/mysql/data/
[mysql@amb03 data]# cat xtrabackup_galera_info
d60fc3bb-c170-11e8-9484-462a51455da0:87911

[mysql@amb03 data]$ vi grastate.dat
# GALERA saved state
version: 2.1
uuid:    d60fc3bb-c170-11e8-9484-462a51455da0
seqno:   87911
safe_to_bootstrap: 0

[root@amb03 ~]#  /etc/init.d/mysqld start   
Starting MySQL (Percona XtraDB Cluster).Logging to '/usr/local/mysql/data/amb03.err'.
..State transfer in progress, setting sleep higher
.                                                          [  OK  ]

[root@amb03 ~]# netstat -tunlp | grep mysqld 
tcp        0      0 0.0.0.0:4567                0.0.0.0:*                   LISTEN      26180/mysqld        
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      26180/mysqld


[root@amb01 ~]# mysql -uroot -pabcd.1234
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13226
Server version: 5.6.37-82.2-log , wsrep_26.21

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show status like 'wsrep%';
+------------------------------+-----------------------------------------------------------+
| Variable_name                | Value                                                     |
+------------------------------+-----------------------------------------------------------+
| wsrep_local_state_uuid       | d60fc3bb-c170-11e8-9484-462a51455da0                      |
| wsrep_protocol_version       | 7                                                         |
| wsrep_last_committed         | 193580                                                    |
| wsrep_replicated             | 193585                                                    |
| wsrep_replicated_bytes       | 2175880345                                                |
| wsrep_repl_keys              | 9017997                                                   |
| wsrep_repl_keys_bytes        | 76725796                                                  |
| wsrep_repl_data_bytes        | 1153394515                                                |
| wsrep_repl_other_bytes       | 0                                                         |
| wsrep_received               | 6989                                                      |
| wsrep_received_bytes         | 56566                                                     |
| wsrep_local_commits          | 193538                                                    |
| wsrep_local_cert_failures    | 0                                                         |
| wsrep_local_replays          | 0                                                         |
| wsrep_local_send_queue       | 0                                                         |
| wsrep_local_send_queue_max   | 6                                                         |
| wsrep_local_send_queue_min   | 0                                                         |
| wsrep_local_send_queue_avg   | 0.002100                                                  |
| wsrep_local_recv_queue       | 0                                                         |
| wsrep_local_recv_queue_max   | 1                                                         |
| wsrep_local_recv_queue_min   | 0                                                         |
| wsrep_local_recv_queue_avg   | 0.000000                                                  |
| wsrep_local_cached_downto    | 219                                                       |
| wsrep_flow_control_paused_ns | 9713116089                                                |
| wsrep_flow_control_paused    | 0.000131                                                  |
| wsrep_flow_control_sent      | 0                                                         |
| wsrep_flow_control_recv      | 86                                                        |
| wsrep_cert_deps_distance     | 31.956236                                                 |
| wsrep_apply_oooe             | 0.997960                                                  |
| wsrep_apply_oool             | 0.000000                                                  |
| wsrep_apply_window           | 4.809835                                                  |
| wsrep_commit_oooe            | 0.000000                                                  |
| wsrep_commit_oool            | 0.000000                                                  |
| wsrep_commit_window          | 3.808514                                                  |
| wsrep_local_state            | 4                                                         |
| wsrep_local_state_comment    | Synced                                                    |
| wsrep_cert_index_size        | 585                                                       |
| wsrep_cert_bucket_count      | 256290                                                    |
| wsrep_gcache_pool_size       | 1073742497                                                |
| wsrep_causal_reads           | 0                                                         |
| wsrep_cert_interval          | 3.830230                                                  |
| wsrep_incoming_addresses     | 192.168.1.201:3306,192.168.1.202:3306,192.168.1.203:3306 |
| wsrep_desync_count           | 0                                                         |
| wsrep_evs_delayed            |                                                           |
| wsrep_evs_evict_list         |                                                           |
| wsrep_evs_repl_latency       | 0.000320019/0.00421656/0.120826/0.0135427/451             |
| wsrep_evs_state              | OPERATIONAL                                               |
| wsrep_gcomm_uuid             | d60f25c0-c170-11e8-a696-56b8d4152910                      |
| wsrep_cluster_conf_id        | 3                                                         |
| wsrep_cluster_size           | 3                                                         |
| wsrep_cluster_state_uuid     | d60fc3bb-c170-11e8-9484-462a51455da0                      |
| wsrep_cluster_status         | Primary                                                   |
| wsrep_connected              | ON                                                        |
| wsrep_local_bf_aborts        | 0                                                         |
| wsrep_local_index            | 2                                                         |
| wsrep_provider_name          | Galera                                                    |
| wsrep_provider_vendor        | Codership Oy <info@codership.com>                         |
| wsrep_provider_version       | 3.21(rXXXX)                                               |
| wsrep_ready                  | ON                                                        |
+------------------------------+-----------------------------------------------------------+
59 rows in set (0.00 sec)