1: 编辑my.cnf 复制参数进入
#group
server-id=1
log-bin=binlog
log_slave_updates=ON
relay_log=relay-log
gtid_mode=ON
enforce_gtid_consistency=ON
binlog_format=ROW
binlog_checksum=NONE
master_info_repository=TABLE
relay_log_info_repository=TABLE
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="12341234-4321-4321-4321-123412341234"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address="1.1.1.1:24901"
loose-group_replication_group_seeds="1.1.1.1:24901,2.2.2.2:24901"
loose-group_replication_bootstrap_group=off
loose-group_replication_single_primary_mode=FALSE
loose-group_replication_enforce_update_everywhere_checks=TRUE
slave_parallel_type='LOGICAL_CLOCK'
slave_parallel_workers='10'
slave_preserve_commit_order=ON
2:创建复制账户
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.%' IDENTIFIED BY 'password';
3:安装groupreplication插件
install plugin group_replication SONAME "group_replication.so";
4:show plugins;
5:show variables like "%read_only%";
查看read_only是否是关闭的。
6: 开始同步策略略命令:
CHANGE MASTER TO MASTER_USER='repl', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';
7:初始化
SET GLOBAL group_replication_bootstrap_group = ON;
8:start group_replication;
9: select * from performance_schema.replication_group_members;
第二台添加:
1:配置参数忽略
2:创建复制账户,同上
3:安装插件
4:开启同步策略
5:设置兼容模式加入集群
set global group_replication_allow_local_disjoint_gtids_join=ON;
6:start group_replication;
网友评论