Buy Percona ServicesBuy Now!

How to stop bootstrap node in mysql 5.7

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ?




  • #2
    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.

    Comment


    • #3
      Thanks phoenix , suppose now i want to know bootstrap node then because we didn't start any node using bootstrap

      Comment


      • #4
        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:
        Code:
        systemctl status mysql@bootstrap
        systemctl status mysql

        Comment


        • #5
          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.

          Comment


          • #6
            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?

            Comment


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

              /etc/systemd/system/mysql.service:
              Code:
              [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:
              Code:
              [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

              Comment

              Working...
              X