Percona XtraDB Cluster是一種高可用性解決方案,可幫助企業避免停機和中斷.node
Percona XtraDB Cluster具備如下MySQL羣集優點:
• 具備成本效益的HA和MySQL可擴展性
• 更高的可用性
• ProxySQL負載平衡器
• 多原版複製
• 加強的讀/寫可擴展性
• 零數據丟失
• ProxySQL輔助的Percona XtraDB羣集維護模式
• 自動節點配置
• Percona XtraDB羣集「嚴格模式」
• Percona監視和管理兼容性mysql
環境:三臺centos7
192.168.1.10
192.168.1.20
192.168.1.30sql
1.安裝percona軟件包庫
yum -y install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpmvim
2.更新庫
ls /etc/yum.repos.d/
yum clean all
yum list | grep perconacentos
3.安裝pxc
yum install Percona-XtraDB-Cluster-full-57.x86_64 -yide
4.啓動mysql
service mysql start
grep password /var/log/mysqld.log
mysql -u root -p
alter user 'root'@'localhost' identified by 'Redhat.123';
create user 'testuser'@'localhost' identified by 'passw0rd';
grant reload,lock tables,process,replication client on . to 'sstuser'@'localhost';
flush privileges;centos7
5.修改mysql配置文件
service mysql stop
vim /etc/my.cnf
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_name=pxc-cluster
wsrep_cluster_address=gcomm://192.168.1.10,192.168.1.20,192.168.1.30
wsrep_node_name=pxc1
wsrep_node_address=192.168.1.10
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=2orm
6.在node2,node3上面作一樣操做,並修改配置文件。
wsrep_node_name=pxc2
wsrep_node_address=192.168.1.20
wsrep_node_name=pxc3
wsrep_node_address=192.168.1.30io