How to stop bootstrap node in mysql 5.7

GajendraGajendra ContributorCurrent User Role Contributor
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 [email protected] ?

Comments

  • phoenixphoenix Contributor Inactive User Role Poster
    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 [email protected] then start it again but using the normal systemctl start for percona and the cluster should be up and running normally.
  • GajendraGajendra Contributor Current User Role Contributor
    Thanks phoenix , suppose now i want to know bootstrap node then because we didn't start any node using bootstrap
  • przemekprzemek Percona Support Engineer Percona Staff Role
    Indeed this may be confusing and we already have plans for improving this: https://jira.percona.com/browse/PXC-2204
    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
    
  • patonbikepatonbike Entrant Current User Role Participant
    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.
  • asbaiasbai Entrant Legacy User Role Participant
    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/[email protected]"). Only a sysv "/etc/init.d/mysql" script has created.

    So I can't use "systemctl start [email protected]" and "systemctl stop [email protected]" command ("Failed to start [email protected]: Unit [email protected] 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?
  • asbaiasbai Entrant Legacy User Role Participant
    =================== 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
    
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.