I have three node Percona XtraDB cluster 5.7 ( one node as arbitrator ). I needed to stop the server for some maintenance and it is just not stopping. I have trying all the following commands
systemctl stop mysql
systemctl stop mysqld
systemctl stop mysql@bootstrap.service
systemctl stop mysql@bootstrap
Interesting it has been some time now that I am working with this cluster and it has never happened before. The same commands have worked in the past without any issues. Also it is not working on any data node in the cluster. I try to stop the server and it just gives me back the prompt and there is nothing in the log also as if nothing happened.
1 Like
systemctl stop mysql
should do the trick. There is a 10s waiting period within PXC before the actual shutdown begins.
You could also try mysqladmin shutdown
on each node. The galera arbitrator should stop automatically after stopping the other proper MySQL nodes. If not, you can just kill PID
on that one to shut it down.
1 Like
Matthewwb,
Yes if the stop command is successful it show up a message that stop sequence is going to start but in this case it just does not log anything in the log file.
Can I also try to use kill -TERM $mysql_pid ? as this seems to be the way to stop the mysql server from the /usr/bin/mysql-systemd. I wont want to do it if your advice âmysqladmin shutdownâ works but just want to keep my options ready before I go into maintenance window.
Also if the startup script fails with normal way ( systemctl start mysql ) how I should start the server ? . ? also if it is first node to start as bootstrap.
Thanks.
1 Like
mysqladmin shutdown
== kill -TERM
The tool does the same thing, simply sends a signal to the process. This is also what the systemctl script does.
If the systemctl script fails to start, then you have some other issue with your installation that isnât allowing systemd to monitor/control MySQL. This was my initial suspicion when you said that stopping didnât work. It sounds like your setup is b0rked since the systemctl scripts cannot manage the MySQL process.
Whatâs in your MySQL error log when you do âstop mysqlâ?
1 Like
It shows nothing⊠i just get my prompt back. I have checked both data and log folders and no other log files created.
1 Like
Then thatâs some sort of failure with your systemd setup. Systemd should be reading the PID file of MySQL and sending the proper kill signal to terminate MySQL.
1 Like
Matthewb,
mysqldmin -u root -p shutdown , did the job for me. It stopped the node as it should and then I was able to start the node using âsystemctcl start mysqlâ.
Really thanks for the help.
Thanks.
1 Like