PXC is shutting down automatically after startup.

Description

PXC is shutting down automatically after startup. The issue is with missing PID file in my.cnf. Did not observe this issue with https://perconadev.atlassian.net/browse/PXC-8#icft=PXC-8.0.18-9.1 RC build

my.cnf

[mysqld] datadir=/var/lib/mysql wsrep_provider=/usr/lib64/galera4/libgalera_smm.so log-error=/var/lib/mysql/mysql.err wsrep-debug=1 wsrep_cluster_address=gcomm://192.168.100.10,192.168.100.20,192.168.100.30 binlog_format=ROW server_id=100 log_bin=mysql-bin log_slave_updates gtid_mode=ON enforce_gtid_consistency slave_parallel_workers=2 innodb_autoinc_lock_mode=2 wsrep_node_address=192.168.100.10 wsrep_sst_method=xtrabackup-v2 # Cluster name wsrep_cluster_name=my_centos_cluster # Authentication for SST method wsrep_cluster_name=cluster_one wsrep_node_name=node1 wsrep_slave_threads=8 [vagrant@node1 ~]$ [vagrant@node1 ~]$ sudo systemctl start mysql@bootstrap.service Job for mysql@bootstrap.service failed because the control process exited with error code. See "systemctl status mysql@bootstrap.service" and "journalctl -xe" for details. [vagrant@node1 ~]$ Error info 2020-04-09T11:56:58.668099Z 18 [Note] [MY-000000] [WSREP] Starting applier thread 18 2020-04-09T11:56:58.668675Z 2 [Note] [MY-000000] [Galera] Server node1 synced with group 2020-04-09T11:56:58.668691Z 2 [Note] [MY-000000] [Galera] server node1 state change: joined -> synced 2020-04-09T11:56:58.668696Z 2 [Note] [MY-000000] [WSREP] Server status change joined -> synced 2020-04-09T11:56:58.668704Z 2 [Note] [MY-000000] [WSREP] Synchronized with group, ready for connections 2020-04-09T11:56:58.668708Z 2 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification. 2020-04-09T11:56:58.869290Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/lib/mysql/mysqlx.sock' bind-address: '::' port: 33060 2020-04-09T11:58:28.848175Z 0 [Note] [MY-000000] [WSREP] Received shutdown signal. Will sleep for 10 secs before initiating shutdown. pxc_maint _mode switched to SHUTDOWN 2020-04-09T11:58:38.987057Z 0 [Note] [MY-000000] [WSREP] Shutdown replication 2020-04-09T11:58:38.987098Z 0 [Note] [MY-000000] [WSREP] Disconnect provider 2020-04-09T11:58:38.987115Z 0 [Note] [MY-000000] [Galera] server node1 state change: synced -> disconnecting 2020-04-09T11:58:38.987123Z 0 [Note] [MY-000000] [WSREP] Server status change synced -> disconnecting 2020-04-09T11:58:38.987132Z 0 [Note] [MY-000000] [WSREP] wsrep_notify_cmd is not defined, skipping notification. 2020-04-09T11:58:38.987148Z 0 [Note] [MY-000000] [Galera] Closing send monitor... 2020-04-09T11:58:38.987156Z 0 [Note] [MY-000000] [Galera] Closed send monitor. 2020-04-09T11:58:38.987168Z 0 [Note] [MY-000000] [Galera] gcomm: terminating thread 2020-04-09T11:58:38.987178Z 0 [Note] [MY-000000] [Galera] gcomm: joining thread 2020-04-09T11:58:38.987205Z 0 [Note] [MY-000000] [Galera] gcomm: closing backend 2020-04-09T11:58:38.987249Z 0 [Note] [MY-000000] [Galera] PC protocol downgrade 1 -> 0 2020-04-09T11:58:38.987260Z 0 [Note] [MY-000000] [Galera] Current view of cluster as seen by this node view ((empty)) 2020-04-09T11:58:38.987453Z 0 [Note] [MY-000000] [Galera] gcomm: closed 2020-04-09T11:58:38.987486Z 0 [Note] [MY-000000] [Galera] New SELF-LEAVE. 2020-04-09T11:58:38.987520Z 0 [Note] [MY-000000] [Galera] Flow-control interval: [0, 0] 2020-04-09T11:58:38.987526Z 0 [Note] [MY-000000] [Galera] Received SELF-LEAVE. Closing connection. 2020-04-09T11:58:38.987532Z 0 [Note] [MY-000000] [Galera] Shifting SYNCED -> CLOSED (TO: 2) 2020-04-09T11:58:38.987542Z 0 [Note] [MY-000000] [Galera] RECV thread exiting 0: Success 2020-04-09T11:58:38.987586Z 2 [Note] [MY-000000] [Galera] ####### processing CC -1, local, ordered 2020-04-09T11:58:38.987599Z 2 [Note] [MY-000000] [Galera] Drain monitors from 2 upto 2 2020-04-09T11:58:38.987608Z 2 [Note] [MY-000000] [Galera] ####### My UUID: 3686182e-7a59-11ea-8cf0-6e4577eecc8c 2020-04-09T11:58:38.987614Z 2 [Note] [MY-000000] [Galera] ####### ST not required 2020-04-09T11:58:38.987651Z 0 [Note] [MY-000000] [Galera] recv_thread() joined. 2020-04-09T11:58:38.987657Z 0 [Note] [MY-000000] [Galera] Closing replication queue. 2020-04-09T11:58:38.987661Z 0 [Note] [MY-000000] [Galera] Closing slave action queue. 2020-04-09T11:58:38.987677Z 2 [Note] [MY-000000] [Galera] ================================================

Environment

None

Smart Checklist

Activity

Show:

Alex Miroshnychenko April 14, 2020 at 9:50 AM

Hi,

According to the documentation related to pid-file option: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_pid_file

If you do not specify this variable, MySQL uses a default value of host_name.pid, where host_name is the name of the host machine.

But in fact it is not completely correct, since according to the source code the value of hostname obtained via "gethostname()" is truncated in the way so that the trailing ".whatever" suffix is removed and ".pid" extension is added in mysqld.cc:

strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name) - 5); my_stpcpy(fn_ext(pidfile_name), ".pid"); // Add proper extension

"mysql-systemd" has been adjusted to follow the same logic for pid finame creation and handling.

Done

Details

Assignee

Reporter

Time tracking

1d 3h logged

Components

Fix versions

Affects versions

Priority

Smart Checklist

Created April 9, 2020 at 1:17 PM
Updated March 6, 2024 at 9:38 PM
Resolved April 29, 2020 at 1:15 PM

Flag notifications