1.启动MGR 报错
"root@localhost">start group_replication;
ERROR 3092 (HY000): The server is not configured properly to be an active member of the group.
Please see more details on error log.
"root@localhost">exit
2024-08-02T11:32:27.516970+08:00 2 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2024-08-02T11:32:55.545509+08:00 2 [ERROR] Plugin group_replication reported: 'binlog_checksum should be NONE for Group Replication'
2024-08-02T11:37:31.987335+08:00 4 [ERROR] Plugin group_replication reported: 'LOG_SLAVE_UPDATES should be ON for Group Replication'
2024-08-02T11:41:07.230745+08:00 2 [ERROR] Plugin group_replication reported: 'In order to use parallel applier on Group Replication, parameter slave-parallel-type must be set to 'LOGICAL_CLOCK'.'
2024-08-02T11:43:25.737133+08:00 3 [Warning] Plugin group_replication reported: 'Group Replication requires slave-preserve-commit-order to be set to ON when using more than 1 applier threads.'
2.检查参数
"root@localhost">show variables like 'binlog_checksum';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| binlog_checksum | CRC32 |
+-----------------+-------+
1 row in set (0.01 sec)
"root@localhost">show variables like '%slave_update%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| log_slave_updates | OFF |
+-------------------+-------+
1 row in set (0.00 sec)
"root@localhost">show variables like 'slave_parallel_type';
+---------------------+----------+
| Variable_name | Value |
+---------------------+----------+
| slave_parallel_type | DATABASE |
+---------------------+----------+
"root@localhost">show variables like 'slave_preserve_commit_order';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| slave_preserve_commit_order | OFF |
+-----------------------------+-------+
1 row in set (0.00 sec)
set global slave_preserve_commit_order=1;
set global slave_parallel_type='LOGICAL_CLOCK'
set global binlog_checksum='none';
--级联复制参数需要开启,且需要重启数据库。
"root@localhost">set global log_slave_updates=1;
ERROR 1238 (HY000): Variable 'log_slave_updates' is a read only variable
vim /etc/my.cnf
binlog_checksum='none'
log_slave_updates=1
systemctl restart mysqld
3.重启启动MGR;
"root@localhost">set global group_replication_bootstrap_group=on;
Query OK, 0 rows affected (0.00 sec)
"root@localhost">start group_replication;
Query OK, 0 rows affected (2.05 sec)
4.总结
MGR的关键参数:
plugin_load="group_replication=group_replication.so"
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.12:33006"
loose-group_replication_group_seeds="192.168.1.11:33006,192.168.1.12:33006,192.168.1.13:33006"
loose-group_replication_bootstrap_group= off
group_replication_single_primary_mode=off
group_replication_enforce_update_everywhere_checks=on
binlog_checksum='none'
log_slave_updates=1
slave_parallel_type='LOGICAL_CLOCK'
slave_preserve_commit_order=1