Cannot bootstrap first node

Hi all
I’m following this tutorial to setup a mySQL cluster

I already install PXC, change root password, and update my.cnf but when i use command to bootstrap first node, it fail, then i use recommend command to check, i saw that below:


I create pid file and set chmod and chown, but it not work. i think have any problem cause mysql service cannot run.

Any one can help me ? Thanks so much

here is my my.cnf file (we are using VM so i cannot copy any content)

You don’t need to do that. systemd will do that automatically for you.

You need to look at MySQL’s error log for details on why the bootstrap failed. The journald log won’t have anything of importance.

Also, even in a VM, you can simply select/copy/paste from the VM window into this forum. Don’t use the VM terminal. Start the VM, then use your normal SSH program to access the VM as if it were a remote host. Please avoid screenshots.

Hi
i re-setup cluster, but it still not run. seem that it cannot run mysql service
I check status of mysql@bootstrap.service, it running but when check status of mysql, it failed

I upload my.cnf and error log:
my.cnf.txt (1.8 KB)
mysql-error.log (15.1 KB)

Could you please help me check it

Below is check status of service

status of mysql@bootstrap.service

[vht@2c7ced03-244b-4d93-bd39-635a141902af log]$ sudo systemctl status mysql@bootstrap.service
[sudo] password for vht:
● mysql@bootstrap.service - Percona XtraDB Cluster with config /etc/sysconfig/mysql.bootstrap
Loaded: loaded (/usr/lib/systemd/system/mysql@.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2023-10-06 08:37:14 +07; 17min ago
Process: 4452 ExecStartPost=/usr/bin/mysql-systemd start-post $MAINPID (code=exited, status=0/SUCCESS)
Process: 4450 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 4338 ExecStartPre=/bin/sh -c VAR=bash /usr/bin/mysql-systemd galera-recovery; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 4335 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 4294 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=0/SUCCESS)
Main PID: 4389 (mysqld)
Status: “Server is operational”
CGroup: /system.slice/system-mysql.slice/mysql@bootstrap.service
└─4389 /usr/sbin/mysqld --wsrep-new-cluster --wsrep_start_position=f6eed2f6-63e5-11ee-9123-8fdc0874e268:4

Oct 06 08:37:12 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Starting Percona XtraDB Cluster with config /etc/sysconfig/mysql.bootstrap…
Oct 06 08:37:14 2c7ced03-244b-4d93-bd39-635a141902af mysql-systemd[4452]: SUCCESS!
Oct 06 08:37:14 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Started Percona XtraDB Cluster with config /etc/sysconfig/mysql.bootstrap.

status of mysql

[vht@2c7ced03-244b-4d93-bd39-635a141902af log]$ sudo systemctl status mysql
● mysql.service - Percona XtraDB Cluster
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2023-10-06 08:17:48 +07; 39min ago
Process: 3464 ExecStopPost=/usr/bin/mysql-systemd stop-post (code=exited, status=0/SUCCESS)
Process: 3433 ExecStop=/usr/bin/mysql-systemd stop (code=exited, status=0/SUCCESS)
Process: 3389 ExecStartPost=/usr/bin/mysql-systemd start-post $MAINPID (code=exited, status=0/SUCCESS)
Process: 3387 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3325 ExecStart=/usr/sbin/mysqld $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3229 ExecStartPre=/bin/sh -c VAR=bash /usr/bin/mysql-systemd galera-recovery; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 3227 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3142 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=0/SUCCESS)
Main PID: 3325 (code=exited, status=0/SUCCESS)
Status: “Server shutdown complete”

Oct 06 08:16:04 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Starting Percona XtraDB Cluster…
Oct 06 08:16:24 2c7ced03-244b-4d93-bd39-635a141902af mysql-systemd[3389]: SUCCESS!
Oct 06 08:16:24 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Started Percona XtraDB Cluster.
Oct 06 08:17:35 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Stopping Percona XtraDB Cluster…
Oct 06 08:17:36 2c7ced03-244b-4d93-bd39-635a141902af mysql-systemd[3433]: SUCCESS! Stopping Percona XtraDB Cluster…
Oct 06 08:17:48 2c7ced03-244b-4d93-bd39-635a141902af mysql-systemd[3464]: WARNING: mysql pid file /var/run/mysqld/mysqld.pid empty or not readable
Oct 06 08:17:48 2c7ced03-244b-4d93-bd39-635a141902af mysql-systemd[3464]: WARNING: mysql may be already dead
Oct 06 08:17:48 2c7ced03-244b-4d93-bd39-635a141902af systemd[1]: Stopped Percona XtraDB Cluster.

Thank for your reply
Could you please help me check again

When you start cluster for first time on first node, you need to bootstrap it and use mysql@bootstrap service.
After bootstrap you can start other two nodes.
If you want mysql service to be started on the bootstrapped node,
you can safely stop mysql@bootstrap and start mysql again. But you should make sure that other two nodes are online. If there are nodes online in the cluster you dont need to use bootstrap service.
Hope that clears.

There are only two option: 1) start mysql@bootstrap, or 2) start mysql. If you run start mysql@bootstrap, then yes, status mysql will show stopped and status mysql@bootstrap will show running. This is because you told systemd to start mysql@bootstrap. This is perfectly normal. mysql and mysql@bootstrap are two different systemd unit files and thus systemd treats them separately.