How to stop bootstrap node in mysql 5.7

i have 3 node percona cluster
i am little confused about how to stop bootstrap node in my scenario

ex. i am going to make few changes in my.cnf that requires mysql restart .
i am following below method

First node -: systemctl stop mysql
systemctl start mysql

Second Node : systemctl stop mysql
systemctl start mysql

Third node(bootstrap node ) : systemctl stop mysql

so my third node is not stopping using systemctl stop mysql command

so do i need to stop like this systemctl stop mysql@bootstrap ?

You bootsrap the first node, next you start the other servers at that point they will all be members of the same cluster. At that point you stop the ‘bootstarp’ node with systemctl stop mysql@bootstrap then start it again but using the normal systemctl start for percona and the cluster should be up and running normally.

Thanks phoenix , suppose now i want to know bootstrap node then because we didn’t start any node using bootstrap

Indeed this may be confusing and we already have plans for improving this: [url][PXC-2204] Modified Shutdown using systemd after Bootstrap to provide additional messaging - Percona JIRA
For now, before you try with start/stop, better to make sure of both bootstrap and regular service status:

systemctl status mysql@bootstrap
systemctl status mysql

I experience the same issue on Debian 9. After starting node 1 as bootstrap (sudo /etc/init.d/mysql bootstrap-pxcand joining node 2 and node 3, node 1 will not stop with /etc/init.d/mysql stop which apparently does nothing. I did a standard kill on the mysql processes and it shutdown cleanly. At that point I was able to do a standard node 1 start and all is well. But it is odd that mysql stop does not work after bootstrap start.

It’s strange, I’m install PXC “apt-get install percona-xtradb-cluster-server” through its official repo: “wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb && dpkg -i … && percona-release setup pxc57”.

And the installation progress successfully without error, the mysqld version is: “mysqld Ver 5.7.27-30-57 for debian-linux-gnu on x86_64 (Percona XtraDB Cluster (GPL), Release rel30, Revision 64987d4, WSREP version 31.39, wsrep_31.39)”.

All looks fine, BUT there is no systemd configurations (neither “/lib/systemd/systemd/mysql.service” nor “/lib/systemd/systemd/mysql@.service”). Only a sysv “/etc/init.d/mysql” script has created.

So I can’t use “systemctl start mysql@bootstrap” and “systemctl stop mysql@bootstrap” command (“Failed to start mysql@bootstrap.service: Unit mysql@bootstrap.service not found.”).

The PXC repo that comes with Ubuntu 18.04 can automatically generate the above systemd configuration, but this is a buggy version (5.7.20).

How do I generate these systemd configuration files for the percona repo?

=================== UPDATE =====================
Ok, I wrote two my myself so I can use systemd’s powerful monitoring and management functions.

/etc/systemd/system/mysql.service:


[Unit]
Description=Percona XtraDB Cluster daemon
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

[Service]
User=mysql
Group=mysql
Type=forking
TimeoutSec=0
PermissionsStartOnly=true
ExecStart=/etc/init.d/mysql start
ExecStop=/usr/bin/mysqladmin shutdown
ExecReload=/etc/init.d/mysql reload
EnvironmentFile=-/etc/default/mysql
LimitNOFILE = 5000
Restart=on-failure
RestartSec=3
RestartPreventExitStatus=1
PrivateTmp=false

/etc/systemd/system/mysql.bootstrap.service:


[Unit]
Description=Percona XtraDB Cluster daemon
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

[Service]
User=mysql
Group=mysql
Type=forking
TimeoutSec=0
PermissionsStartOnly=true
ExecStart=/etc/init.d/mysql bootstrap-pxc
ExecStop=/usr/bin/mysqladmin shutdown
ExecReload=/etc/init.d/mysql reload
EnvironmentFile=-/etc/default/mysql
LimitNOFILE = 5000
Restart=on-failure
RestartSec=3
RestartPreventExitStatus=1
PrivateTmp=false