Useful shortcuts for vi editor

Wednesday 31 October 2018

WSREP "Failed to open channel" solution

Error
ERROR WSREP "Failed to open channel 'my_mariadb_cluster'"

Detailed Error
WSREP: gcs/src/gcs.cpp:gcs_open():1458: Failed to open channel 'my_mariadb_cluster' at 'gcomm://10.10.10.10,10.10.10.11': -110 (Connection timed out)

Solution
On the first node: (e.g. node-1)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service

-> Make sure "safe_to_bootstrap" value is "1"
# cat /var/lib/mysql/grastate.dat
safe_to_bootstrap: 1

-> Run following command for starting cluster as new
# galera_new_cluster

-> mariadb service should be started automatically
# systemctl status mariadb.service

-> note wsrep_last_committed number by looking system table
# mysql -u root -p
> show status like 'wsrep_%';

-> note uuid number
# cat /var/lib/mysql/grastate.dat

On the second node: (e.g. node-2)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service

-> uuid and seqno (wsrep_last_committed) should be same with node-1
# vi /var/lib/mysql/grastate.dat
uuid: 0000
seqno: 100

-> start mariadb service
# systemctl start mariadb.service