# How to stop bootstrap node in mysql 5.7

**URL:** <https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [August 21, 2018, 4:36am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525 "2018-08-21T04:36:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [August 21, 2018, 4:36am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/1 "2018-08-21T04:36:53Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![phoenix](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@phoenix](https://forums.percona.com/u/phoenix)\
**Post date:** [August 21, 2018, 4:54am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/2 "2018-08-21T04:54:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [August 21, 2018, 6:27am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/3 "2018-08-21T06:27:32Z")

</div>

Thanks [phoenix](https://www.percona.com/forums/member/40023-phoenix) , suppose now i want to know bootstrap node then because we didn’t start any node using bootstrap

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [August 27, 2018, 9:01am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/4 "2018-08-27T09:01:57Z")

</div>

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](https://jira.percona.com/browse/PXC-2204%5B/url%5D)  
For now, before you try with start/stop, better to make sure of both bootstrap and regular service status:

```auto
systemctl status mysql&#64;bootstrap
systemctl status mysql

```

---

<div class="post-metadata">

**Author:** ![Patrick\_C](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/patrick_c/32/5241_2.png) [@Patrick\_C](https://forums.percona.com/u/Patrick_C)\
**Post date:** [September 5, 2018, 7:09am UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/5 "2018-09-05T07:09:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![asbai](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asbai](https://forums.percona.com/u/asbai)\
**Post date:** [October 21, 2019, 10:54pm UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/6 "2019-10-21T22:54:25Z")

</div>

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.$](https://repo.percona.com/apt/percona-release_latest.%24)(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&#64;bootstrap.service](mailto:mysql&#64;bootstrap.service): Unit [mysql&#64;bootstrap.service](mailto:mysql&#64;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?

---

<div class="post-metadata">

**Author:** ![asbai](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asbai](https://forums.percona.com/u/asbai)\
**Post date:** [October 21, 2019, 11:30pm UTC](https://forums.percona.com/t/how-to-stop-bootstrap-node-in-mysql-5-7/6525/7 "2019-10-21T23:30:53Z")

</div>

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

/etc/systemd/system/mysql.service:

```auto

[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:

```auto

[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

```
