diff --git a/web/support/kb/cloud/percona_manual_sync.rst b/web/support/kb/cloud/percona_manual_sync.rst index 654e989d7ed43b7531fd255fa8867b9da945a06b..4abc1a2a349c27e3f60d96e011b952e6d44407ab 100644 --- a/web/support/kb/cloud/percona_manual_sync.rst +++ b/web/support/kb/cloud/percona_manual_sync.rst @@ -29,20 +29,45 @@ The detailed procedure is described below. (repeat the command on the other services) -- connect to one of the servers, and force ``mysql`` restart as master:: +- connect to one of the servers, and force ``mysql`` restart as master. + +Edit file /etc/mysql/percona-xtradb-cluster.conf.d/mysqld.cnf, you should find the line:: + + $ wsrep_cluster_address=gcomm://<ip_1>,<ip_2> + +where <ip_1>, <ip_2> are the IP addresses of the other members of the cluster. + +Comment this line, copy/paste then remove the IP addresses, leaving:: + + $ wsrep_cluster_address=gcomm:// + + +(TODO fix the following commands which do not work):: $ sudo cp -p /etc/mysql/percona-xtradb-cluster.conf.d/mysqld.cnf $ sudo sed -i "s,wsrep_cluster_address.*,wsrep_cluster_address=gcomm://," /etc/mysql/percona-xtradb-cluster.conf.d/mysqld.cnf - and finally restart MySql:: +Finally restart MySql:: $ sudo service mysql start -.. note:: You should perform the above operation on the last-acting master, +.. note1:: You should perform the above operation on the last-acting master, otherwise ``mysql`` will fail to start. If you are unable to determine the last-acting master, edit file ``/var/lib/percona-xtradb-cluster/grastate.dat`` and set ``safe_to_bootstrap: 1``. - + +.. note2:: It may happen that mysql server still does not start because of failed transactions. In case try the following procedure. + Looking in the log file ``/var/log/mysql/error.log`` you may find messages like: + + 2023-01-30T23:57:22.828179Z 0 [ERROR] Found 7 prepared transactions! It means that mysqld was not...binlog or tc.log file) was manually deleted after a crash. + You have to start mysqld with --tc-heuristic-recover switch to commit or rollback pending transactions. + +Issue the following command:: + + $ sudo mysqld --tc-heuristic-recover=ROLLBACK + +This should fix the failed transactions. + - start ``mysql`` on the remaining nodes, as usual:: $ juju ssh percona-cluster-N sudo systemctl start mysql