I cannot fully kill a mysql service on CentOS 7. I tried to find all PIDs:
ps -ef | grep 'mysql'
and then kill them with
kill -9 ...
but mysql recreates after some time.
Also I tried to kill it like this:
killall -KILL mysql mysqld_safe mysqld
The same effect. After several seconds mysql rejoins.
Why it happens?
# ps aux | grep mysql root 15284 0.0 0.3 115384 1804 ? Ss 12:10 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr --wsrep-new-cluster mysql 15743 0.1 40.3 1353412 202276 ? Sl 12:10 0:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-provider=/usr/lib64/galera3/libgalera_smm.so --wsrep-new-cluster --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock --wsrep_start_position=43de3d74-bca8-11e6-a178-57b39b925285:9 root 16303 0.0 0.1 112648 976 pts/0 R+ 12:56 0:00 grep --color=auto mysql
I am using a mysql fork (Percona Xtradb Cluster) and it can't be stopped if the node is partitioned from the cluster. It can be stopped only if I disable a mysql service and reboot a node. But it is much better for me to kill the process without node rebooting. So
systemctl stop mysql
Doesn't work. It tries to stop it but without success.
I have installed it from Percona repository via yum:
yum install Percona-XtraDB-Cluster-57
Situation is the next:
There was 3 nodes and they crashed. After some time only 2 nodes could start. But they are waiting for the 3rd node. They have state: activating. If I try to stop mysql service then it change its state to: deactivating. But it can't be stopped. So, I try to kill mysql service and provision a new cluster from 2 nodes. But I can't stop mysql without reboot (reboot isn't a solution for me).