Configure hosts file or DNS for all nodes communication
Configure MySQL configuration my.cnf
GR Initial
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
mysql01: mysql> install plugin group_replication soname "group_replication.so"; mysql> show plugins; mysql> set global group_replication_group_name = "a7b884ed-5d97-466a-b676-8ca0466063fd"; mysql> set global group_replication_local_address = "10.0.88.171:24901";
mysql> set sql_log_bin = 0; mysql> create user 'rpl_user'@'%' identified by 'rpl_password'; mysql> grant replication slave on *.* to rpl_user@'%' identified by 'rpl_password'; mysql> change master to master_user = 'rpl_user',master_password = 'rpl_password' for channel 'group_replication_recovery'; mysql> set sql_log_bin = 1;
mysql> set global group_replication_bootstrap_group = on; mysql> start group replication; mysql> set global group_replication_bootstrap_group = off;
mysql02: mysql> install plugin group_replication soname "group_replication.so"; mysql> show plugins; mysql> set global group_replication_group_name = "a7b884ed-5d97-466a-b676-8ca0466063fd"; mysql> set global group_replication_local_address = "10.0.88.171:24901"; mysql> set global group_replication_group_seeds='10.0.88.171:24901,10.0.88.172:24902';
mysql> set sql_log_bin = 0; mysql> create user 'rpl_user'@'%' identified by 'rpl_password'; mysql> grant replication slave on *.* to rpl_user@'%' identified by 'rpl_password'; mysql> change master to master_user = 'rpl_user',master_password = 'rpl_password' for channel 'group_replication_recovery'; mysql> set sql_log_bin = 1; mysql> start group_replication;
[mysqld] server_id = 1 # need change for other nodes datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
# replication and binlog related options slave_parallel_type = LOGICAL_CLOCK slave_parallel_workers = 8 slave_preserve_commit_order = ON relay_log = relay-log
# group replication pre-requisites & recommendations log_bin = binlog binlog_format = ROW gtid_mode = ON enforce_gtid_consistency = ON log_slave_updates = ON master_info_repository = TABLE relay_log_info_repository = TABLE binlog_checksum = NONE transaction-write-set-extraction = XXHASH64
# group replication specific options #plugin-load = group_replication.so group_replication_group_name = a7b884ed-5d97-466a-b676-8ca0466063fd group_replication_local_address = '10.0.88.171:24901' # need change for other nodes group_replication_group_seeds = '10.0.88.171:24901,10.0.88.172:24902' # need change for other nodes