linux7.6 安装 mysql mgr

 

ip 数据库版本信息 主机名 server-id
172.16.0.10 mysql-5.7.25 mysql1 330624
172.16.0.11 mysql-5.7.25 mysql2 330625
172.16.0.13 mysql-5.7.25 mysql3 330611

 

在三台机安装mysql。

yum -y install libaio

yum -y install bc

 

vi /etc/my.cnf
server_id=1
gtid_mode=on
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
log_bin=binlog
binlog_format=ROW
transaction_write_set_extraction = XXHASH64
loose-group_replication_group_name = 'da57d237-af57-46ba-8f93-464ba49669d5'
loose-group_replication_start_on_boot = off
loose-group_replication_local_address = "mysql1:24901"
loose-group_replication_group_seeds = "mysql1:24901,mysql2:24901,mysql3:24901"
loose-group_replication_bootstrap_group = off
loose-group_replication_single_primary_mode=off
loose-group_replication_enforce_update_everywhere_checks=true

Set the loose-group_replication_group_name to the UUID you generated previously with the uuidgencommand. Paste the UUID you copied as the value for this variable.

The server_id directive must be set to a unique number. 

--blkid

重启mysql: systemctl restart mysql

以下命令再三个节点中执行:

GRANT REPLICATION SLAVE ON *.* TO 'repl'@'172.16.0.%' IDENTIFIED BY 'oracle';

flush privileges;

INSTALL PLUGIN group_replication SONAME 'group_replication.so';

SHOW PLUGINS;

只在首节点中执行(重新配置时,需要执行以下步骤)

mysql> CHANGE MASTER TO MASTER_USER='rpl', MASTER_PASSWORD='oracle' FOR CHANNEL 'group_replication_recovery';
mysql> SET GLOBAL group_replication_bootstrap_group = ON;
mysql> start group_replication;

mysql> set global group_replication_bootstrap_group=off;
mysql> SELECT * FROM performance_schema.replication_group_members;

在第二个节点中执行:

 

你可能感兴趣的:(Mysql)