[摘要]+---------------------------+--------------------------------------+----------------------+--------...
+---------------------------+--------------------------------------+----------------------+-------------+--------------+
3 rows in set (0.00 sec)
mysql>
再查看后台error日志,
2017-01-10T09:17:39.449488Z 146 [ERROR] Slave I/O for channel 'group_replication_recovery':
error connecting to master 'repl@hch_test_dbm2_121_71:3317' - retry-time: 60 retries: 1, Error_code: 2003
2017-01-10T09:17:39.450289Z 146 [Note] Slave I/O thread for channel 'group_replication_recovery' killed while connecting to master
2017-01-10T09:17:39.450449Z 146 [Note] Slave I/O thread exiting for channel 'group_replication_recovery', read up to log 'FIRST', position 4
2017-01-10T09:17:39.451579Z 144 [ERROR] Plugin group_replication reported: 'There was an error when connecting to the donor server.
Check group replication recovery's connection credentials.'
2017-01-10T09:17:39.452341Z 144 [Note] Plugin group_replication reported: 'Retrying group recovery connection with another donor. Attempt 2/10'
2017-01-10T09:17:39.457834Z 0 [Note] Plugin group_replication reported: 'Marking group replication view change with view_id 14840330835325176:25'
2017-01-10T09:18:39.456629Z 144 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'.
Previous state master_host='hch_test_dbm2_121_71', master_port= 3317, master_log_file='', master_log_pos= 4, master_bind=''.
New state master_host='hch_test_dbm2_121_71', master_port= 3317, master_log_file='', master_log_pos= 4, master_bind=''.
2017-01-10T09:18:39.485250Z 144 [Note] Plugin group_replication reported: 'Establishing
connection to a group replication recovery donor 3d872c2e-d670-11e6-ac1f-b8ca3af6e36c at hch_test_dbm2_121_71 port: 3317.'
2017-01-10T09:18:39.489356Z 150 [Warning] Storing MySQL user name or
password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and
PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2017-01-10T09:18:39.493511Z 150 [ERROR] Slave I/O for channel 'group_replication_recovery':
error connecting to master 'repl@hch_test_dbm2_121_71:3317' - retry-time: 60 retries: 1, Error_code: 2005
2017-01-10T09:18:39.493912Z 150 [Note] Slave I/O thread for channel 'group_replication_recovery' killed while connecting to master
2017-01-10T09:18:39.494069Z 150 [Note] Slave I/O thread exiting for channel 'group_replication_recovery', read up to log 'FIRST', position 4
2017-01-10T09:18:39.495155Z 144 [ERROR] Plugin group_replication reported:
'There was an error when connecting to the donor server. Check group replication recovery's connection credentials.'
2017-01-10T09:18:39.496838Z 144 [Note] Plugin group_replication reported: 'Retrying group recovery connection with another donor. Attempt 3/10'
【解决办法】:
看报错[ERROR] Slave I/O for channel'group_replication_recovery': error connecting to master 'repl@hch_test_dbm2_121_71:3317'- retry-time: 60 retries: 1, Error_code:2005,连接master库不上,所以问题在这里,我们赋予的复制账号是ip的repl@'192.168.%',所以还需要做一个hostname(hch_test_dbm2_121_71)和db1的ip地址192.168.121.71的映射关系。
建立hostname和ip映射
vim /etc/hosts
192.168.121.71 db1 hch_test_dbm2_121_71
192.168.121.111 db2 bpe_service
192.168.121.24 db3 hch_test_web_1_24
然后在db2上执行如下命令后重新开启group_replication即可。
mysql> stop group_replication;
Query OK, 0 rows affected (0.02 sec)
mysql> start group_replication;
Query OK, 0 rows affected (5.68 sec)
mysql>
再去master库db1上,查看group_replication成员,会有db2的显示
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+----------------------+-------------+--------------+
关键词:详细介绍MySQL Group Replication[Single-Primary Mode]的搭建部署过程