1, modify the configuration file, add the following content
Server_id=1
Gtid_mode=on
Enforce_gtid_consistency=on
Binlog_checksum=none
Transaction_write_set_extraction=xxhash64
Loose-group_replication_group_name= "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
Loose-group_replication_start_on_boot=off
Loose-group_replication_local_address= "192.168.1.249:24901"
Loose-group_replication_group_seeds= "192.168.1.249:24901,192.168.1.252:24901,192.168.1.253:24901"
Loose-group_replication_bootstrap_group=off
Loose-group_replication_ip_whitelist= "192.168.1.0/24"
# each node server_id, loose-group_replication_local_address value is not the same, according to the IP to make the corresponding changes
2. Add System name Mappings
192.168.1.249 Kuber01
192.168.1.252 Kuber02
192.168.1.253 kuber03
3, create the account Rpl_user, each node needs to create
SET sql_log_bin=0;
alter user [email protected] ' localhost ' identified by ' MySQL8.0 ';
CREATE USER [email protected] '% ' identified by ' MySQL8.0 ';
GRANT REPLICATION SLAVE On * * to [email protected] '% ';
FLUSH privileges;
SET sql_log_bin=1;
4. Add nodes to the cluster
Change MASTER to Master_user= ' Rpl_user ', master_password= ' MySQL8.0 ' for CHANNEL ' group_replication_recovery ';
5, install the plug-in
INSTALL PLUGIN group_replication SONAME ' group_replication.so ';
6. Start the node
# Start the first node
SET GLOBAL Group_replication_bootstrap_group=on;
START group_replication;
SET GLOBAL Group_replication_bootstrap_group=off;
# Start Other nodes
START group_replication;
7. Query cluster members
SELECT * from Performance_schema.replication_group_members;
Note: Cluster boot failure does the following
# on failed node execution
SELECT @ @global. gtid_executed;
# on Master node execution
SET gtid_next= ' 4e2cb39d-6af1-11e8-a65c-000c29cdfd39:1 ';
BEGIN;
COMMIT;
SET gtid_next= ' AUTOMATIC ';
Reference Document: https://ronniethedba.wordpress.com/2017/04/22/ this-member-has-more-executed-transactions-than-those-present-in-the-group/
Build MySQL 8.0 Group Replication