一、环境
192.168.109.144
192.168.109.145
192.168.109.146
MySQL 8.0.32
二、单主模式部署
1、修改my.cnf
server_id=1 #各个节点server_id需要不一样
gtid_mode=ON
enforce_gtid_consistency=ON
plugin_load_add='group_replication.so'
group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
group_replication_start_on_boot=off
group_replication_local_address= "192.168.109.144:33061" #修改为对应节点ip
group_replication_group_seeds= "192.168.109.144:33061,192.168.109.145:33061,192.168.109.146:33061"
group_replication_bootstrap_group=off
disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"
report_host=192.168.109.144 #对应节点ip,默认使用主机名连接各节点,故要配置通过ip
report_port=3306
2、启动mysql
systemctl restart mysqld
3、登录MySQL,设置复制账号