removed galera.cache and the log files in /var/lib/mysql/
It seems that i changed the log file size in my.cnf, that's why it won't start. That's weird, because i've seen this error before, and it's not what i had in the logs... Anyway it's working.
CODE: SELECT ALL rm -f /var/lib/mysql/galera.cache ib_*
check grastate of each node, the highest seq. is the latest node you should initialize from
$ sudo tail -100 /var/lib/mysql/grastate.dat initialize the highest node
$ sudo service mysql start –wsrep-new-cluster
if you see -1 in each node’s seqno you can recover the node by running
$ sudo /usr/sbin/mysqld -u root –wsrep-recover
hard to know which node has the latest when all nodes have -1, then you need to make a guess and must pick up the node and initialize the cluster
$ sudo service mysql start –wsrep-new-cluster
IF TWO NODES SHUTDOWN, ONE IS OK
try first to make join the 2 nodes to the existing cluster one by one
$ sudo service mysql start
if doesn’t start, try to recover each node to get its position internally
$ sudo /usr/sbin/mysqld -u root –wsrep-recover $ sudo service mysql start
then run other nodes the same way
$ sudo service mysql start Starting MySQL…SST in progress, setting sleep higher………………………………………….. SUCCESS!
TURN OF a SINGLE NODE
let’s turn off a single node, start from the latest i.e. db3
$ sudo service mysql stop
to make sure all mysql processes are shutdown
$ ps -ef | grep mysql
or
$ sudo pidof mysqld
if any mysql still running, then kill it
$ sudo kill -9 pid
on db2 or db1 check out cluster size
mysql>show status like ‘wsrep%’;
STOP THE ENTIRE GELARA CLUSTER (NOT RECOMMENDED)
mysql>show status like ‘wsrep_local_state%’;
if Synced then it is OK to start the shutdown node procedure. If the node is non-synchronized, you may shut it down anyway, but avoid to start a new cluster from this node in the future
wsrep_sst_method=xtrabackup
ReplyDeleteScenario kako se vraća klaster
ReplyDeletehttps://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/
removed galera.cache and the log files in /var/lib/mysql/
ReplyDeleteIt seems that i changed the log file size in my.cnf, that's why it won't start.
That's weird, because i've seen this error before, and it's not what i had in the logs...
Anyway it's working.
CODE: SELECT ALL
rm -f /var/lib/mysql/galera.cache ib_*
I have also rebooted.
IF EVERY NODE SHUTDOWNS
ReplyDeletecheck grastate of each node, the highest seq. is the latest node you should initialize from
$ sudo tail -100 /var/lib/mysql/grastate.dat
initialize the highest node
$ sudo service mysql start –wsrep-new-cluster
if you see -1 in each node’s seqno you can recover the node by running
$ sudo /usr/sbin/mysqld -u root –wsrep-recover
hard to know which node has the latest when all nodes have -1, then you need to make a guess and must pick up the node and initialize the cluster
$ sudo service mysql start –wsrep-new-cluster
IF TWO NODES SHUTDOWN, ONE IS OK
try first to make join the 2 nodes to the existing cluster one by one
$ sudo service mysql start
if doesn’t start, try to recover each node to get its position internally
$ sudo /usr/sbin/mysqld -u root –wsrep-recover
$ sudo service mysql start
then run other nodes the same way
$ sudo service mysql start
Starting MySQL…SST in progress, setting sleep higher………………………………………….. SUCCESS!
TURN OF a SINGLE NODE
let’s turn off a single node, start from the latest i.e. db3
$ sudo service mysql stop
to make sure all mysql processes are shutdown
$ ps -ef | grep mysql
or
$ sudo pidof mysqld
if any mysql still running, then kill it
$ sudo kill -9 pid
on db2 or db1 check out cluster size
mysql>show status like ‘wsrep%’;
STOP THE ENTIRE GELARA CLUSTER (NOT RECOMMENDED)
mysql>show status like ‘wsrep_local_state%’;
if Synced then it is OK to start the shutdown node procedure. If the node is non-synchronized, you may shut it down anyway, but avoid to start a new cluster from this node in the future
mysql> set global wsrep_on=‘OFF’
Lepo opisano kako se instalira mariadb na centos 7
ReplyDeletehttps://snapdev.net/2015/07/21/mariadb-cluster-on-centos-7/