Systemctl command on Percona cluster nodes

How can I enable all nodes to start automatically in every reboot? I tried “sudo systemctl mysql” command but it does not work.

bootstrap (node1) server status

● mysql@bootstrap.service - Percona XtraDB Cluster with config /etc/default/mysql.bootstrap
     Loaded: loaded (/lib/systemd/system/mysql@.service; disabled; vendor preset: enabled)
     Active: inactive (dead)

Dec 19 19:17:28 db01 systemd[1]: /lib/systemd/system/mysql@.service:36: Unknown key name 'Require' in section 'Unit', ignoring.

node02 system status

● mysql.service - Percona XtraDB Cluster
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-12-19 19:17:14 +03; 7min ago
    Process: 664 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=0/SUCCESS)
    Process: 756 ExecStartPre=/usr/bin/mysql-systemd check-grastate (code=exited, status=1/FAILURE)
    Process: 789 ExecStopPost=/usr/bin/mysql-systemd stop-post (code=exited, status=0/SUCCESS)

Dec 19 19:17:12 db02 systemd[1]: Starting Percona XtraDB Cluster...
Dec 19 19:17:14 db02 mysql-systemd[756]:  WARNING: Node has been rebooted, /var/lib/mysql/grastate.dat: seqno = -1, mysql service has not been started auto>
Dec 19 19:17:14 db02 systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Dec 19 19:17:14 db02 mysql-systemd[789]:  WARNING: mysql pid file /var/run/mysqld/mysqld.pid empty or not readable
Dec 19 19:17:14 db02 mysql-systemd[789]:  WARNING: mysql may be already dead
Dec 19 19:17:14 db02 systemd[1]: mysql.service: Failed with result 'exit-code'.
Dec 19 19:17:14 db02 systemd[1]: Failed to start Percona XtraDB Cluster.

I just want these nodes to start automatically (without any manual intervention)

1 Like