mysql works but systemd status shows it failed after bootstraping

Hello

Recently I noticed mysql failed after bootstraping on a fresh cluster so I checked /etc/init.d/mysql status


● mysql.service - LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Tue 2016-05-24 22:37:02 IRDT; 14h ago
Process: 2313 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

May 24 22:37:02 1-dbpool-a01 mysql[2313]: Starting MySQL (Percona Xtr...
May 24 22:37:02 1-dbpool-a01 mysql[2313]: failed!
May 24 22:37:02 1-dbpool-a01 systemd[1]: mysql.service: control proc...1
May 24 22:37:02 1-dbpool-a01 systemd[1]: Failed to start LSB: Start ....
May 24 22:37:02 1-dbpool-a01 systemd[1]: Unit mysql.service entered ....
Hint: Some lines were ellipsized, use -l to show in full.



I checked the error file and no error detected and I loged in to mysql and all works with no errors

so whats wrong with init script ? where is problem ? how can I find why service failed ?


Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie

Linux 1-vm-dbpool-a01 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 GNU/Linux

mysql Ver 14.14 Distrib 5.6.29-76.2, for debian-linux-gnu (x86_64) using 6.3

ii percona-release 0.1-3.jessie all Package to install Percona gpg key and APT repo
ii percona-xtrabackup 2.3.4-1.jessie amd64 Open source backup tool for InnoDB and XtraDB
ii percona-xtradb-cluster-56 5.6.29-25.15-1.jessie amd64 Percona XtraDB Cluster with Galera
ii percona-xtradb-cluster-client-5.6 5.6.29-25.15-1.jessie amd64 Percona XtraDB Cluster database client binaries
ii percona-xtradb-cluster-common-5.6 5.6.29-25.15-1.jessie amd64 Percona XtraDB Cluster database common files (e.g. /etc/mysql/my.cnf)
ii percona-xtradb-cluster-galera-3 3.15-1.jessie amd64 Metapackage for latest version of galera3.
ii percona-xtradb-cluster-galera-3.x 3.15-1.jessie amd64 Galera components of Percona XtraDB Cluster
ii percona-xtradb-cluster-server-5.6 5.6.29-25.15-1.jessie amd64 Percona XtraDB Cluster database server binaries



if you need further information let me know
thank you

How are you bootstrapping the mysqld? Are you doing something like:

systemctl start mysql@bootstrap.service 

no im using init script

/etc/init.d/mysql bootstrap-pxc

Your operating system uses systemd so I’d suggest you bootstrap the node with systemctl start mysql@bootstrap.service.

unfortunately there is no mysql@bootstrap.service in debian jessie

Failed to start mysql@bootstrap.service: Unit mysql@bootstrap.service faile
d to load: No such file or directory.

in documents :

so i think if I bootstrap new cluster with init script again problem shows up

Hello,

I am facing the same issue mentioned here. Mysql seems to be working fine. But when tried to view the status of mysql.service, it seems that systemctl doesn’t track the service correctly.

=========================

ps aux |grep mysql

root 21545 0.0 0.0 14224 980 pts/0 S+ 14:57 0:00 grep --color=auto mysql
root 111572 0.0 0.0 4504 1672 ? S Mar21 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 112091 84.3 38.5 29589304 12694008 ? Sl Mar21 6020:06 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --wsrep-provider=/usr/lib/libgalera_smm.so --log-error=/var/log/mysql/error.log --pid-file=****.pid --wsrep_start_position=af573a98-7fe7-11e7-873e-767a3c4c936b:52906227

mysql

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)

systemctl status mysql.service

● mysql.service - LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon
Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2018-03-26 14:42:06 EDT; 16min ago
Docs: man:systemd-sysv-generator(8)
Process: 12139 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Tasks: 114
Memory: 12.6G
CPU: 12min 21.775s
CGroup: /system.slice/mysql.service
├─111572 /bin/sh /usr/bin/mysqld_safe
└─112091 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --wsrep-provider=/usr/lib/libgalera_smm.so --log-error=/var/log/mysql/error.log

Mar 26 14:42:05 fhm001 systemd[1]: Starting LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon…
Mar 26 14:42:05 fhm001 mysql[12139]: * Starting MySQL (Percona XtraDB Cluster) database server mysqld
Mar 26 14:42:05 fhm001 mysql[12139]: * Stale PID file found: /var/lib/mysql/fhm001.pid with 112091
Mar 26 14:42:06 fhm001 mysql[12139]: * Please take a look at the syslog.
Mar 26 14:42:06 fhm001 mysql[12139]: …fail!
Mar 26 14:42:06 fhm001 systemd[1]: mysql.service: Control process exited, code=exited status=1
Mar 26 14:42:06 fhm001 systemd[1]: Failed to start LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon.
Mar 26 14:42:06 fhm001 systemd[1]: mysql.service: Unit entered failed state.
Mar 26 14:42:06 fhm001 systemd[1]: mysql.service: Failed with result ‘exit-code’.

Looking for some workaround on this one. We have gone for Percona upgrade recently. Not sure if it’s been the cause of this strange issue.

mysql -V

mysql Ver 14.14 Distrib 5.7.20-18, for debian-linux-gnu (x86_64) using 6.3