The Percona XtraDB cluster is a high availability and extensibility solution for MySQL users, based on Percona Server. It includes the Write Set replication patch, which uses the Galera 2.0 library, which is a synchronous multi-host replication plug-in for transactional applications.
Percona XtraDB Cluster Features:
(1) Synchronous replication, the transaction is either committed at the same time on all cluster nodes or not committed.
(2) Multi-master replication, which can be written at any one of the nodes.
(3) Parallel application events from the server, true "parallel Replication".
(4) Automatic configuration node.
(5) Data consistency, no unsynchronized from the server.
Experimental system: CentOS 6.6_x86_64
Lab Prerequisites: Firewall and SELinux are off, no version of MySQL is installed on the server
The experiment shows that there are 3 hosts in this experiment, such as the topology of IP assignment
Experimental topology:
First, install the Percona environment
1. Configure the Yum Source:
Yum Install http://www.percona.com/downloads/percona-release/redhat/0.1-3/ percona-release-0.1-3.noarch.rpmYum -y epel*
2. Install the Percona software:
Yum Install Percona-xtradb-cluster-server percona-xtradb-cluster-client Percona-server-shared-compat Percona-xtrabackup
3. Add an account:
/etc/init.d/mysql BOOTSTRAP-PXC // start pxcMySQL------------------------------------ ---->'123456'; FLUSH privileges;
\q
<----------------------------------------
/etc/init.d/mysql stop
Second, edit the PXC node configuration:
1. On 19.66:
vim/etc/my.cnf------------------------------------->
Wsrep_provider=/usr/lib64/libgalera_smm.so
Wsrep_cluster_address= "gcomm://192.168.19.66,192.168.19.74,192.168.19.76"
wsrep_sst_auth=com:123456
Wsrep_cluster_name=percona
Wsrep_sst_method=xtrabackup-v2
wsrep_node_address=192.168.19.66
wsrep_slave_threads=2
Innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
<-------------------------------------
/etc/init.d/mysql BOOTSTRAP-PXC
2. On 19.74:
VIM/ETC/MY.CNF-------------------------------------->wsrep_provider=/usr/lib64/libgalera_smm.sowsrep_ cluster_address= "gcomm://192.168.19.66,192.168.19.74,192.168.19.76" Wsrep_sst_auth=com:123456wsrep_cluster_name =perconawsrep_sst_method=xtrabackup-v2wsrep_node_address=192.168.19.74wsrep_slave_threads=2innodb_locks_unsafe _for_binlog=1innodb_autoinc_lock_mode=2<--------------------------------------/etc/init.d/mysql Start
3. On 19.76:
VIM/ETC/MY.CNF-------------------------------->wsrep_provider=/usr/lib64/libgalera_smm.sowsrep_cluster_ address= "gcomm://192.168.19.66,192.168.19.74,192.168.19.76" wsrep_sst_auth=com:123456wsrep_node_address= 192.168.19.76wsrep_cluster_name=perconawsrep_sst_method=xtrabackup-v2wsrep_slave_threads=2innodb_locks_unsafe_ for_binlog=1innodb_autoinc_lock_mode=2<--------------------------------
/etc/init.d/mysql start
4. Check the status on each node to ensure that the following are not a problem:
MySQL---------------------------------------------->SHOW STATUS like'%wsrep%';+------------------------------+----------------------------------------------------------+| variable_name | Value |+------------------------------+-------------------------------- --------------------------+| Wsrep_local_state_uuid | a82bc530-3748-11e5-a4fc-c26f7c90839c |
...| Wsrep_local_state |4|| wsrep_local_state_comment | Synced |...| Wsrep_cluster_size |3|| Wsrep_cluster_status | Primary | | wsrep_connected | On |...| Wsrep_ready | On |+------------------------------+-------------------------------- --------------------------+
5. Test:
On the 19.66:
CREATE DATABASE Jason; Use Jason; CREATE TABLE JJJ (IDintchar(ten)) engine=InnoDB; COMMIT;
On the 19.74:
Use Jason;
INSERT into JJJ values (1,'+');
COMMIT;
On the 19.76:
* FROM JJJ;
Can be read and written on any server, other operations can be tried by themselves. This experiment is successful, thank you! If you have any questions, please contact me, qq:82800452
PXC (Percona XtraDB Cluster) cluster installation and configuration