Question

mysql galera cluster - shutdown and restart

Posted February 27, 2021 434 views
MySQLClustering

Dear All,

I have followed the below tutorial to install galera cluster with mysql-5-6 on ubuntu-16-04, and installed successfully using 3 node (VMs). but after stop mysql from node 3 and 2 then stop galera form node 1 then shutdown the VM. and when try to restart galera it fails!

n3usr@node3:~$ sudo systemctl stop mysql
=> successfully stopped
n2usr@node2:~$ sudo systemctl stop mysql
=> successfully stopped
n1usr@node1:~$ sudo /etc/init.d/mysql stop –wsrep-new-cluster
=> successfully stopped

once restarted the node1 try to start cluster but fails…
n1usr@node1:~$ sudo /etc/init.d/mysql start –wsrep-new-cluster
[sudo] password for n1usr:

Starting MySQL
.210227 06:45:06 mysqld_safe Directory ’/var/run/mysqld’ for UNIX socket file don’t exists.

  • The server quit without updating PID file (/var/run/mysqld/mysqld.pid).

it would be great help if you let me know how to successfully stop cluster and shutdown the server then start again the cluster once server is up and running.

tutorial link -> https://www.digitalocean.com/community/tutorials/how-to-configure-a-galera-cluster-with-mysql-5-6-on-ubuntu-16-04

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there,

Usually the /var/run/mysqld should be created by default after the MySQL installation.

You could try creating it manually with the following command:

mkdir -p /var/run/mysqld

And then set the correct ownership:

chown mysql:mysql /var/run/mysqld

Let me know how it goes.
Regards,
Bobby