玖叶教程网

前端编程开发入门

超详细的MGR常见报错汇总(mgr文件)

概述

今天主要汇总一下MGR常见的一些问题及解决办法,主要思路还是通过报错日志去找对应的解决方法。


ERROR 3077 (HY000): To have multiple channels, repository cannot be of type FILE;

报错:

ERROR 3077 (HY000): To have multiple channels, repository cannot be of type FILE; Please check the repository configuration and convert them to TABLE.


解决:

多源复制加入了一个叫做Channel的概念, 每一个Channel都是一个独立的Slave,都有一个IO_THREAD和SQL_THREAD。原理和普通复制一样。我们只需要对每一个Master执行Change Master 语句,只需要在每个语句最后使用For Channel来进行区分。由于复制的原理没有改变,在没有开启GTID的时候Master的版本可以是MySQL5.5、5.6、5.7。并且从库需要master-info-repository、relay-log-info-repository设置为table,否则会报错

故只需在my.cnf添加这两个参数即可。


ERROR 1123 (HY000): Can't initialize function 'group_replication'; Plugin initialization function failed.


报错截图如下:


解决:

1、查看日志

2、在my.cnf增加参数

master-info-repository=TABLE														#复制元数据存储在系统表而不是文件
relay-log-info-repository=TABLE													#中继日志信息写入到表而不是文件
gtid_mode=on																						#开启全局事务ID
enforce_gtid_consistency=on															#开启全局事务ID强一致性
slave_preserve_commit_order=on													#控制从库并行reply时事务提交的顺序
binlog_checksum=NONE																		#禁用二进制日志时间校验和
transaction_write_set_extraction=XXHASH64								#以便在server收集写集合的同时将其记录到二进制日志。写集合基于每行的主键,并且是行更改后的唯一标识此标识将用于检测冲突。



ERROR 3092 (HY000): The server is not configured properly to be an active member of the group.

添加组成员报错,如下:

解决:

1、查看日志


2、在my.cnf增加参数

LOG-SLAVE-UPDATES



ERROR 3092 (HY000): The server is not configured properly to be an active member of the group.

启动组复制报错:

解决:

1、查看报错日志

[Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address xxx.116 refused. Address is not in the IP whitelist.
[ERROR] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
[ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 13306'


2、修改loose-group_replication_ip_whitelist参数,增加IP白名单



从库状态为recovering

查看MGR组成员,发现从库异常

解决:

1、查看报错日志:

[ERROR] Slave I/O for channel 'group_replication_recovery': error connecting to master 'repl@ZCAPZC:3306' - retry-time: 60  retries: 1, Error_code: 2005
 [Note] Slave I/O thread for channel 'group_replication_recovery' killed while connecting to master
[Note] Slave I/O thread exiting for channel 'group_replication_recovery', read up to log 'FIRST', position 4
[ERROR] Plugin group_replication reported: 'For details please check performance_schema.replication_connection_status table and error log messages of Slave I/O for channel group_replication_recovery.'
2020-09-15T10:42:54.468843Z 11 [Note] Plugin group_replication reported: 'Retrying group recovery connection with another donor. Attempt 2/10'


2、这里的问题在于连接不上主库,只需要检查相关的连接即可,排查发现问题在于连接ZCAPZC:3306主库连不上,解析不了ZCAPZC这个主机名,修改/etc/hosts解析即可。


Plugin group_replication reported: 'This member has more executed transactions than those present in the group.

在添加成员时日志报错:

[ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: 25009bc8-f67a-11ea-8e19-005056bf82fa:1-15 > Group transactions: 25009bc8-f67a-11ea-8e19-005056bf82fa:1-13'

解决:

1、查看报错日志


2、设置参数group_replication_allow_local_disjoint_gtids_join=1以加入成员


3、从库reset master

清空binlog日志

4、set global read_only=0后根据报错日志处理数据不一致问题


5、重新加入组复制

start group_repllication;



以上就是MGR常见的一些报错了,其实根据报错日志对应解决就可以了。

后面会分享更多devops和DBA方面内容,感兴趣的朋友可以关注下!


发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言