galera集群啟動異常問題匯總


 

 

WSREP: failed to open gcomm backend connection: 131: invalid UUID

 

如圖:

 

 

進入該數據庫節點/var/lib/mysql/目錄,將文件gvwstate.dat移除(mv)掉。然后重新啟動mairbd即可

 

bind: Address already in use

 

如圖:

 

 

 

查看mysql進程:ps  -ef | grep mysql,然后殺死該進程,在啟動mariadb

 

 

 

 

It may not be safe to bootstrap the cluster from this node

 

如下:

170620 21:32:55 [ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .

 

意思該節點不是最后一個離開集群的節點(最后停掉的節點),可能沒有包含所有更新的數據,強制從該節點啟動,需要手工編輯grastate.dat文件,設置safe_to_bootstrap=1,當然了,我們不需需要強制從該節點啟動,我們逐一排查每個節點下的grastate.dat文件(該文件在data目錄下),找到safe_to_bootstrap=1的節點,然后在該節點上啟動即可.

 

數據庫集群宕機,在運行/bin/galera_new_cluster啟動第一個節點時報錯,意思是該節點不是最后一個停掉的,不能安全啟動;
然后可以嘗試在其他節點運行該命令;
如果報錯都相同,則需要從3個節點中選取一個主節點,修改/var/lib/mysql/grastate.dat,把其中safe_to_bootstrap的值改為1即可。然后運行/bin/galera_new_cluster。其他節點依次啟動

 

 

 

方法:

集群中第一台mariadb啟動方法:

/etc/init.d/mysql start --wsrep-new-cluster

集群中其它數據啟動方法:

/etc/init.d/mysql start

 

[ERROR] WSREP: failed to open gcomm backend connection: 110

 

 

 

 

現象:集群三個節點無法啟動,日志有如上報錯,gvwstate.dat不存在,三個grastate.dat中seqno值都為-1,並且其內無safe_to_bootstrap參數。

原因:

1、數據庫如果正常關閉的話,gvwstate.dat文件是不存在的,如果三個節點同時關閉(無數據變化)seqno值應該是相等的,且不為-1。

2、如果這個時候無論先后順利啟動節點,都會導致所有節點都在不斷重啟中,並且seqno值由原來的值變為-1。

3、此時無法選舉出來哪個作為主啟動節點,需要再第一個節點啟動時手動指定該節點作為集群主節點啟動。

解決辦法:

選定主節點啟動時加--wsrep-new-cluster參數啟動

正常啟動后的節點重新生成gvwstate.dat文件

或:

刪除所有節點的兩個緩存文件及/var/lock/subsys 目錄下的mysql 文件,然后重新啟動:

rm -rf /var/lock/subsys/mysql

cd /var/lib/mysql
rm -rf galera.cache

rm -rf grastate.dat

第一個節點這樣啟動:

service mysql start --wsrep-new-cluster
其他節點正常啟動:

service mysql start

 

 

MySQL Unknown/unsupported storage engine: INNODB

 

1.刪除data目錄下文件

ib_logfile0 , ib_logfile1 , ibdata1

2.重新啟動服務

 

[ERROR] mysqld: Table './mysql/user' is marked as crashed and should be repaired

 

異常斷電導致單節點無法啟動有如下報錯:

 

修復過程:

表user被標記有問題,需要修復

./myisamchk -c -r /var/lib/mysql/mysql/user.MYI

 

 

 

參考:https://www.cnblogs.com/jinyuanliu/p/10929324.html

https://blog.csdn.net/yabingshi_tech/article/details/105489707

https://www.cnblogs.com/hanxing/p/7719696.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM