MySQL MGR搭建過程中常遇見的問題及解決辦法
MGR搭建過程中遇到的一些故障
實際中我一共部署了三套MGR環(huán)境,分別是單機多實例的MGR環(huán)境,多機同網(wǎng)段的MGR環(huán)境,多機不同網(wǎng)段的MGR環(huán)境,部署的過程大同小異,但是還是有一些有出入的地方,這里把部署過程遇到的故障列舉出來,供大家參考,如果能有幸解決您在部署時候的問題,那是極好的。
01 常見故障1
[ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: bb874065-c485-11e8-8b52-000c2934472e:1 > Group transactions: 3db33b36-0e51-409f-a61d-c99756e90155:1-11' [ERROR] Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.' [Note] Plugin group_replication reported: ‘To force this member into the group you can use the group_replication_allow_local_disjoint_gtids_join option'
解決方案:
根據(jù)提示打開set global group_replication_allow_local_disjoint_gtids_join=ON;
02 常見故障2
[ERROR] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: bb874065-c485-11e8-8b52-000c2934472e:1 > Group transactions: 3db33b36-0e51-409f-a61d-c99756e90155:1-15' [Warning] Plugin group_replication reported: 'The member contains transactions not present in the group. It is only allowed to join due to group_replication_allow_local_disjoint_gtids_join option' [Note] Plugin group_replication reported: 'This server is working as secondary member with primary member address localhost.localdomaion:3306.'
解決方案:
該故障和故障1的不同之處在于該問題出現(xiàn)時,參數(shù)group_replication_allow_local_disjoint_gtids_join已經(jīng)設(shè)置成為on了。解決該問題的方法是執(zhí)行reset master就行,然后重新在主節(jié)點和從節(jié)點開啟通道,即
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';
03 常見故障3
本機測試時,遇到下面的問題
[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. [ERROR] Slave I/O for channel 'group_replication_recovery': error connecting to master 'rpl_user@localhost.localdomaion:' - retry-time: 60 retries: 1, Error_code: 2005 [ERROR] Plugin group_replication reported: 'There was an error when connecting to the donor server. Please check that group_replication_recovery channel credentials and all MEMBER_HOST column values of performance_schema.replication_group_members table are correct and DNS resolvable.' [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.' [Note] Plugin group_replication reported: 'Retrying group recovery connection with another donor. Attempt /'
解決方案:
這個問題是由于測試環(huán)境上三臺主機的hostname設(shè)置成為了同一個名稱,改了hostname之后,這個問題就解決了。
04 常見故障4
#在線上正式環(huán)境操作時,出現(xiàn)下面的錯誤, mysql--root@localhost:(none) ::>>START GROUP_REPLICATION; ERROR (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log. #查看log文件,發(fā)現(xiàn)只有一個warning: 2019-02-20T07::30.233937Z [Warning] Plugin group_replication reported: 'Group Replication requires slave-preserve-commit-order to be set to ON when using more than 1 applier threads.
解決方案:
mysql--root@localhost:(none) ::>>show variables like "%preserve%"; +--------------------------------+---------+ | Variable_name | Value | +--------------------------------+---------+ | slave_preserve_commit_order | OFF | +--------------------------------+---------+ row in set (0.01 sec) mysql--root@localhost:(none) ::>>set global slave_preserve_commit_order=; Query OK, rows affected (0.00 sec)
05 常見問題5
2019-02-20T08::31.088437Z [Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address 192.168.9.208 refused. Address is not in the IP whitelist.' 2019-02-20T08::32.088676Z [Warning] Plugin group_replication reported: '[GCS] Connection attempt from IP address 192.168.9.208 refused. Address is not in the IP whitelist.'
解決方法:
在my.cnf中配置group_replication_ip_whitelist參數(shù)即可解決
06 常見問題6
2019-02-20T08::44.087492Z [Warning] Plugin group_replication reported: 'read failed' 2019-02-20T08::44.096171Z [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 24801' 2019-02-20T08::14.065775Z [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group
解決方案:
將my.cnf中的參數(shù)group_replication_group_seeds設(shè)置為只包含除自身外其他group成員的ip地址以及內(nèi)部通信端口,如果寫成group所有成員的IP地址,則會出現(xiàn)這個錯誤,這和相同網(wǎng)段的MGR部署方式有些差異。
07 常見問題7
[ERROR] Plugin group_replication reported: ‘[GCS] Error on opening a connection to oceanbase07: on local port: '.' [ERROR] Plugin group_replication reported: ‘[GCS] Error on opening a connection to oceanbase08: on local port: '.' [ERROR] Plugin group_replication reported: ‘[GCS] Error on opening a connection to oceanbase07: on local port: '.'
解決方案:
未開通防火墻上的固定端口,開通防火墻之后即可解決
08 常見問題8
[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. [ERROR] Slave I/O for channel 'group_replication_recovery': Master command COM_REGISTER_SLAVE failed: Access denied for user 'rpl_user'@'%' (using password: YES) (Errno: 1045), Error_code: 1597 [ERROR] Slave I/O thread couldn't register on master [Note] Slave I/O thread exiting for channel 'group_replication_recovery', read up to log 'FIRST', position
解決方案:
漏掉了某個節(jié)點的用戶,為了保險起見,在group節(jié)點上執(zhí)行
CREATE USER rpl_user@'%';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';
09 常見問題9
[ERROR] Failed to open the relay log './localhost-relay-bin.000011' (relay_log_pos ). [ERROR] Could not find target log file mentioned in relay log info in the index file './work_NAT_1-relay-bin. index' during relay log initialization. [ERROR] Slave: Failed to initialize the master info structure for channel ''; its record may still be present in 'mysql.slave_master_info' table, consider deleting it. [ERROR] Failed to open the relay log './localhost-relay-bin-group_replication_recovery.000001' (relay_log_pos ). [ERROR] Could not find target log file mentioned in relay log info in the index file './work_NAT_1-relay-bin-group_replication_recovery.index' during relay log initialization. [ERROR] Slave: Failed to initialize the master info structure for channel 'group_replication_recovery'; its record may still be present in 'mysql.slave_master_info' table, consider deleting it. [ERROR] Failed to create or recover replication info repositories. [ERROR] Slave SQL for channel '': Slave failed to initialize relay log info structure from the repository, Error_code: [ERROR] /usr/local/mysql/bin/mysqld: Slave failed to initialize relay log info structure from the repository [ERROR] Failed to start slave threads for channel ''
解決方案:
這個錯誤是由于slave節(jié)點由于某種原因?qū)е抡也坏絩elay-log的位置了,需要重新reset slave
以上就是MySQL MGR搭建過程中常遇見的問題及解決辦法的詳細內(nèi)容,更多關(guān)于MySQL MGR搭建的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
教你如何通過日志文件恢復(fù)MySQL數(shù)據(jù)
Binlog日志是二進制日志文件,有兩個作用,一個是增量備份,另一個是主從復(fù)制,即主節(jié)點維護一個binlog日志文件,從節(jié)點從binlog中同步數(shù)據(jù),也可以通過binlog日志來恢復(fù)數(shù)據(jù),這篇文章主要給大家介紹了關(guān)于如何通過日志文件恢復(fù)MySQL數(shù)據(jù)的相關(guān)資料,需要的朋友可以參考下2022-02-02解析mysql中max_connections與max_user_connections的區(qū)別
本篇文章是對mysql中max_connections與max_user_connections的區(qū)別進行了詳細的分析介紹,需要的朋友參考下2013-06-06mysql使用mysqld_multi部署單機多實例的方法教程
這篇文章主要給大家介紹了關(guān)于mysql使用mysqld_multi部署單機多實例的相關(guān)資料,文中通過示例代碼將實現(xiàn)的步驟一步步介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2018-03-03Windows系統(tǒng)中完全卸載MySQL數(shù)據(jù)庫實現(xiàn)重裝mysql
這篇文章主要介紹了Windows系統(tǒng)中完全卸載MySQL數(shù)據(jù)庫實現(xiàn)重裝mysql數(shù)據(jù)庫的方法,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友參考下吧2018-05-05使用SQL語句統(tǒng)計數(shù)據(jù)時sum和count函數(shù)中使用if判斷條件的講解
今天小編就為大家分享一篇關(guān)于使用SQL語句統(tǒng)計數(shù)據(jù)時sum和count函數(shù)中使用if判斷條件的講解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-02-02Navicat Premium如何導(dǎo)入SQL文件的方法步驟
這篇文章主要介紹了Navicat Premium如何導(dǎo)入SQL文件的方法步驟,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-03-03MySQL數(shù)據(jù)庫入門之備份數(shù)據(jù)庫操作詳解
這篇文章主要介紹了MySQL數(shù)據(jù)庫入門之備份數(shù)據(jù)庫操作,結(jié)合實例形式詳細分析了MySQL備份數(shù)據(jù)庫基本操作命令與相關(guān)注意事項,需要的朋友可以參考下2020-05-05MYSQL插入數(shù)據(jù)時檢查字段值是否重復(fù)的方法詳解
這篇文章主要給大家介紹了關(guān)于MYSQL插入數(shù)據(jù)時檢查字段值是否重復(fù)的相關(guān)資料,文中通過實例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2022-01-01