mysql mgr从库恢复同步错误

mysql mgr 从库意外离线后执行:START group_replication;命令报错,
无法恢复,以下是一些报错信息:

2023-02-23T16:49:58.908279+08:00 516 [Note] Plugin group_replication reported: 'Group communication SSL configuration: group_replication_ssl_mode: "DISABLED"'
2023-02-23T16:49:58.908440+08:00 516 [Note] Plugin group_replication reported: '[GCS] Added automatically IP ranges 10.8.63.173/24,127.0.0.1/8 to the whitelist'
2023-02-23T16:49:58.908531+08:00 516 [Warning] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.'
2023-02-23T16:49:58.908575+08:00 516 [Note] Plugin group_replication reported: '[GCS] SSL was not enabled'
2023-02-23T16:49:58.908613+08:00 516 [Note] Plugin group_replication reported: 'Initialized group communication with configuration: group_replication_group_name: "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"; group_replication_local_address: "10.8.63.173:33060"; group_replication_group_seeds: "10.8.63.173:33060,10.8.63.174:33060,10.8.63.175:33060"; group_replication_bootstrap_group: false; group_replication_poll_spin_loops: 0; group_replication_compression_threshold: 1000000; group_replication_ip_whitelist: "AUTOMATIC"'
2023-02-23T16:49:58.908641+08:00 516 [Note] Plugin group_replication reported: '[GCS] Configured number of attempts to join: 0'
2023-02-23T16:49:58.908653+08:00 516 [Note] Plugin group_replication reported: '[GCS] Configured time between attempts to join: 5 seconds'
2023-02-23T16:49:58.908678+08:00 516 [Note] Plugin group_replication reported: 'Member configuration: member_id: 1; member_uuid: "b5c0f6a7-43a8-11e9-9a42-caebf8fa458a"; single-primary mode: "true"; group_replication_auto_increment_increment: 7; '
2023-02-23T16:49:58.908989+08:00 832 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2023-02-23T16:49:58.913674+08:00 516 [Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!'
2023-02-23T16:49:58.913680+08:00 835 [Note] Slave SQL thread for channel 'group_replication_applier' initialized, starting replication in log 'FIRST' at position 0, relay log './dht-mysql1-relay-bin-group_replication_applier.000001' position: 4
2023-02-23T16:49:58.913707+08:00 516 [Note] Plugin group_replication reported: 'auto_increment_increment is set to 7'
2023-02-23T16:49:58.913736+08:00 516 [Note] Plugin group_replication reported: 'auto_increment_offset is set to 1'
2023-02-23T16:49:58.913842+08:00 0 [Note] Plugin group_replication reported: 'XCom protocol version: 3'
2023-02-23T16:49:58.913875+08:00 0 [Note] Plugin group_replication reported: 'XCom initialized and ready to accept incoming connections on port 33060'
2023-02-23T16:50:01.057168+08:00 516 [Note] Plugin group_replication reported: 'This server is working as secondary member with primary member address dht-mysql3:3306.'
2023-02-23T16:50:01.057407+08:00 838 [Note] Plugin group_replication reported: 'Establishing group recovery connection with a possible donor. Attempt 1/10'
2023-02-23T16:50:01.057461+08:00 0 [Note] Plugin group_replication reported: 'Group membership changed to dht-mysql2:3306, dht-mysql3:3306, dht-mysql1:3306 on view 15646222293475941:61.'
2023-02-23T16:50:01.064211+08:00 838 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='dht-mysql2', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2023-02-23T16:50:01.071484+08:00 838 [Note] Plugin group_replication reported: 'Establishing connection to a group replication recovery donor 2846d819-43ad-11e9-bfad-967b93319469 at dht-mysql2 port: 3306.'
2023-02-23T16:50:01.071673+08:00 840 [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.
2023-02-23T16:50:01.071953+08:00 841 [Note] Slave SQL thread for channel 'group_replication_recovery' initialized, starting replication in log 'FIRST' at position 0, relay log './dht-mysql1-relay-bin-group_replication_recovery.000001' position: 4
2023-02-23T16:50:01.072594+08:00 840 [Note] Slave I/O thread for channel 'group_replication_recovery': connected to master 'zl@dht-mysql2:3306',replication started in log 'FIRST' at position 4
2023-02-23T16:50:01.073731+08:00 840 [ERROR] Error reading packet from server for channel 'group_replication_recovery': The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. (server_errno=1236)
2023-02-23T16:50:01.073762+08:00 840 [ERROR] Slave I/O for channel 'group_replication_recovery': Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.', Error_code: 1236
2023-02-23T16:50:01.073774+08:00 840 [Note] Slave I/O thread exiting for channel 'group_replication_recovery', read up to log 'FIRST', position 4
2023-02-23T16:50:01.073799+08:00 838 [Note] Plugin group_replication reported: 'Terminating existing group replication donor connection and purging the corresponding logs.'
2023-02-23T16:50:01.073858+08:00 841 [Note] Error reading relay log event for channel 'group_replication_recovery': slave SQL thread was killed
2023-02-23T16:50:01.073886+08:00 841 [Note] Slave SQL thread for channel 'group_replication_recovery' exiting, replication stopped in log 'FIRST' at position 0
2023-02-23T16:50:01.080469+08:00 838 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='dht-mysql2', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2023-02-23T16:50:01.087093+08:00 838 [Note] Plugin group_replication reported: 'Retrying group recovery connection with another donor. Attempt 2/10'
2023-02-23T16:50:01.093783+08:00 838 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='dht-mysql3', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
2023-02-23T16:50:01.099978+08:00 838 [Note] Plugin group_replication reported: 'Establishing connection to a group replication recovery donor 5043db66-543d-11e9-8603-0e61941e46c9 at dht-mysql3 port: 3306.'
2023-02-23T16:50:01.100115+08:00 842 [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.
2023-02-23T16:50:01.100400+08:00 843 [Note] Slave SQL thread for channel 'group_replication_recovery' initialized, starting replication in log 'FIRST' at position 0, relay log './dht-mysql1-relay-bin-group_replication_recovery.000001' position: 4
2023-02-23T16:50:01.100692+08:00 842 [Note] Slave I/O thread for channel 'group_replication_recovery': connected to master 'zl@dht-mysql3:3306',replication started in log 'FIRST' at position 4

基于chatGPT:

根据报错信息,可能是MySQL主库已经清除了从库需要的GTID,导致从库无法恢复。建议检查MySQL主库的binlog日志,确认是否有从库需要的GTID,如果没有,可以尝试重新配置从库,或者从其他主库恢复从库。

参考GPT和自己的思路,根据日志,从库执行START group_replication;命令时出现了错误。错误可能是由于从库与主库失去连接引起的。在这种情况下,需要进行以下步骤来处理问题:

检查主库是否处于运行状态,如果主库宕机,需要先将主库恢复正常运行状态。
检查从库的网络连接,确保从库与主库之间的网络连接是稳定的。
如果网络连接正常,则可以尝试重启从库,重新执行START group_replication;命令。
如果从库仍然无法加入组复制,则可以检查从库的错误日志,查找与组复制相关的错误消息,并采取相应的措施进行修复。
在处理这种问题时,还需要注意以下几点:

组复制的安全性和稳定性非常重要,需要确保组复制的每个成员都能够正常运行,并及时修复出现的问题。
在执行任何操作之前,请务必备份数据,以免数据丢失或受到损坏。

https://www.baidu.com/link?url=KUEHAlq_Mg8nU6qG8NadxVp9mR1kwZgVBiAwlntrFP8oYkwro2X5QTMD_n-ZEpMT&wd=&eqid=9d727b40001d1c460000000263f76a5f

检查一下MySQL从库的日志文件,查看是否有其他错误信息,比如MySQL无法连接主库、主从同步错误等

当MySQL的Group Replication发生START错误时,通常会伴随着错误消息和代码。以下是一些常见的START错误和可能的解决方案:
错误消息:Group Replication plugin is not loaded。
解决方案:请确认已加载Group Replication插件。您可以在MySQL Shell中使用\connect命令连接到MySQL实例,并使用SHOW PLUGINS命令检查是否加载了Group Replication插件。
错误消息:The server is not configured properly to be an active member of the group.
解决方案:请确保MySQL实例的配置文件正确配置为Group Replication组的活动成员。您可以使用SHOW VARIABLES LIKE 'group_replication%'命令检查配置设置是否正确。
错误消息:Cannot connect to the local MySQL server through socket ‘/var/run/mysqld/mysqlx.sock’ (2)
解决方案:请确保MySQL实例正在运行并且可以通过该套接字进行连接。您可以使用systemctl status mysql.service命令检
查MySQL服务的运行状态,并查看日志文件以获取更多详细信息。
错误消息:Failed to initialize the Group Replication plugin.
解决方案:请检查MySQL实例的错误日志,以获取更多有关初始化错误的详细信息。通常,初始化错误是由于配置问题或磁盘空间不足等问题引起的。
错误消息:Failed to start the Group Replication.
解决方案:请检查MySQL实例的错误日志,以获取更多有关启动错误的详细信息。通常,启动错误是由于网络问题、节点配置问题或组内其他成员发生错误等问题引起的。
总之,当MySQL Group Replication发生START错误时,请查看错误消息和代码,以了解错误的具体原因。然后,请参考上述解决方案,并根据错误的情况采取适当的措施。如果问题仍然存在,请考虑与MySQL社区或MySQL支持团队联系以获取更多帮助。

以下答案基于ChatGPT与GISer Liu编写:

根据提供的信息,似乎MySQL Mgr从库已成功初始化并尝试连接到主库。但是,从库在尝试建立与可能的捐赠者之间的恢复连接时遇到了问题。这可能是由于许多原因引起的,例如网络故障或可能的配置错误。

为了进一步调查问题,您可以查看以下信息:

  • 主库和其他从库的状态是否正常。
  • 检查从库的错误日志以查看有关恢复连接失败的任何详细信息。
  • 检查防火墙规则是否正确配置以允许与潜在的捐赠者建立连接。
  • 检查从库的网络配置是否正确。您可以尝试ping主库和其他从库以检查是否可以到达它们。

根据您发现的问题,您可能需要采取以下措施:

  • 如果是网络问题,您可以尝试解决网络故障或更改网络配置以解决问题。
  • 如果是防火墙问题,请确保防火墙规则正确配置以允许与潜在的捐赠者建立连接。
  • 如果是配置错误,请根据需要更改MySQL Mgr从库的配置文件。
  • 如果从库的错误日志包含有关恢复连接失败的详细信息,请尝试解决这些问题。