Percona XtraDB Cluster Installation Guide

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Percona XtraDB Cluster Installation Guide相关的知识,希望对你有一定的参考价值。

???????????????   ?????????   ??????   ????????????   ati   storage   sha   cal   http   

Percona XtraDB Cluster(??????PXC)???????????????Galera????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????mysql???????????????????????????????????????????????????????????????

1?????????PXC?????????

??????????????????????????????????????????Percona XtraDB Cluster 5.7.22-29.26???????????????????????????Oracle Linux 7.5?????????????????????????????????
??????????????????
???????????????????????????yum????????????,?????????

[[email protected] ~]# yum -y install Percona-XtraDB-Cluster-57
[[email protected] ~]# yum -y install Percona-XtraDB-Cluster-57
[[email protected] ~]# yum -y install Percona-XtraDB-Cluster-57

?????????????????????????????????????????????MySQL???????????????[email protected]????????????????????????????????????MySQL????????????mydb03????????????????????????

[[email protected] ~]# grep ???temporary password??? /var/log/mysqld.log
[[email protected] ~]# mysql -uroot -p
mysql> alter user [email protected] identified by ???[email protected]???;
mysql> flush privileges;

2?????????PXC????????????

??????/etc/percona-xtradb-cluster.conf.d/mysqld.cnf??????????????????????????????????????????

#mydb03??????1???mydb04??????2???mydb05??????3
server-id=1     
expire_logs_days=1
log_timestamps=system
collation-server=utf8_general_ci
character-set-server = utf8

??????/etc/percona-xtradb-cluster.conf.d/wsrep.cnf??????????????????????????????

[mysqld]
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
#?????????????????????IP
wsrep_cluster_address=gcomm://192.168.120.129,192.168.120.130,192.168.120.131
binlog_format=ROW
default_storage_engine=InnoDB
wsrep_slave_threads= 8
wsrep_log_conflicts
innodb_autoinc_lock_mode=2
#??????????????????????????????????????????
wsrep_node_name=mydb03
#??????IP???????????????????????????
wsrep_node_address=192.168.120.129
#????????????
wsrep_cluster_name=pxc-cluster
pxc_strict_mode=ENFORCING
wsrep_sst_method=xtrabackup-v2
#sstuser???????????????????????????
wsrep_sst_auth="sstuser:passw0rd"

3?????????PXC????????????

?????????mydb03?????????PXC??????????????????????????????????????????????????????

[[email protected] ~]# systemctl start [email protected]
[[email protected] ~]# mysql -uroot -p
mysql> show status like ???wsrep%???;

??????????????????
??????????????????????????????sstuser??????(???????????????????????????????????????????????????????????????????????????)???

mysql> CREATE USER ???sstuser???@???localhost??? IDENTIFIED BY ???passw0rd???;
mysql> GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO ???sstuser???@???localhost???;
mysql> FLUSH PRIVILEGES;

??????????????????????????????????????????MySQL???????????????

[[email protected] ~]# systemctl start mysqld
[[email protected] ~]# systemctl start mysqld

?????????????????????

mysql> show status like ???%wsrep_clust%???;

??????????????????

4???PXC????????????

????????????????????????????????????????????????????????????????????????

[[email protected] ~]# mysql -uroot -p
mysql> create database xdb;
[[email protected] ~]# mysql -uroot -p
mysql> show databases;

??????????????????

以上是关于Percona XtraDB Cluster Installation Guide的主要内容,如果未能解决你的问题,请参考以下文章

percona xtradb cluster test

Percona-XtraDB-Cluster的多实例编译安装

Galera Cluster 实现mysql的高可用 (Percona XtraDB Cluster)

Percona XtraDB Cluster Installation Guide

Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication

Percona-XtraDB-Cluster编译安装错误