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

 

posted @ 2020-12-17 14:56  钟桂耀  阅读(1856)  评论(0编辑  收藏  举报