diff --git a/web/support/kb/cloud/percona_manual_sync.rst b/web/support/kb/cloud/percona_manual_sync.rst index 056e1723441e27a3b7e921f3293290008923b83a..5692256a29792a30dfdb66f574341522bbc4b851 100644 --- a/web/support/kb/cloud/percona_manual_sync.rst +++ b/web/support/kb/cloud/percona_manual_sync.rst @@ -25,31 +25,36 @@ make sure all ``mysql`` processes are indeed stopped, do not trust ``systemctl s $ juju run --application percona-cluster "ps -ef | grep mysql" -- stop ``juju agents`` on all units:: +stop ``juju agents`` on all units:: +----------------------------------- $ juju ssh percona-cluster/N sudo service jujud-unit-percona-cluster-N stop (repeat the command on the other services) -- 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:: +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:: +- Comment this line, copy/paste then remove the IP addresses, leaving:: $ wsrep_cluster_address=gcomm:// -(TODO fix the following commands which do not work):: +.. comment + 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 + $ sudo sed -i "s,wsrep_cluster_address.*,wsrep_cluster_address=gcomm://," /etc/mysql/percona-xtradb-cluster.conf.d/mysqld.cnf + -Finally restart MySql:: +- Finally restart MySql:: $ sudo service mysql start @@ -58,34 +63,38 @@ Finally restart MySql:: the last-acting master, edit file ``/var/lib/percona-xtradb-cluster/grastate.dat`` and set ``safe_to_bootstrap: 1``. -.. note:: 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: +- 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:: +- Issue the following command:: $ sudo mysqld --tc-heuristic-recover=ROLLBACK This should fix the failed transactions. -- start ``mysql`` on the remaining nodes, as usual:: +start ``mysql`` on the remaining nodes, as usual +------------------------------------------------ $ juju ssh percona-cluster-N sudo systemctl start mysql -- go back to the first node, stop ``mysql``, revert the change to ``wsrep_cluster_address`` - and restart ``mysql``:: +go back to the first node, stop ``mysql``, revert the change to ``wsrep_cluster_address`` and restart ``mysql`` +---------------------------------------------------------------------------------------------------------------- $ sudo mv /tmp/mysql.cnf /etc/mysql/percona-xtradb-cluster.conf.d/mysqld.cnf $ sudo service mysql restart -- start ``juju`` agents on all the units:: +start ``juju`` agents on all the units +-------------------------------------- $ juju ssh percona-cluster/N sudo service jujud-unit-percona-cluster-N start (repeat the command on the other services) + Now your Percona cluster should be in sync.