Consider the following my.cnf:
=====
[mysqld]
log-error=/var/log/mysql.log
[mysqld_safe]
log-error=/var/log/mysql.log
=====
Then start the MySQL service fail, and when looking at the status:
$ systemctl status mysql
mysql.service - Percona XtraDB Cluster
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
Active: failed (Result: exit-code) since Thu 2017-08-24 16:14:31 UTC; 5s ago
Process: 2856 ExecStopPost=/usr/bin/mysql-systemd stop-post (code=exited, status=0/SUCCESS)
Process: 2173 ExecStop=/usr/bin/mysql-systemd stop (code=exited, status=0/SUCCESS)
Process: 28349 ExecStartPost=/usr/bin/mysql-systemd start-post $MAINPID (code=exited, status=0/SUCCESS)
Process: 28348 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 3903 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=1/FAILURE)
Main PID: 28348 (code=exited, status=0/SUCCESS)
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Starting Percona XtraDB Cluster...
Aug 24 16:14:31 ip-10-0-0-155 mysql-systemd[3903]: install: invalid user '@MYSQLD_USER@'
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Failed to start Percona XtraDB Cluster.
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Unit mysql.service entered failed state.
Looking at line 48 of /usr/bin/mysql-systemd: mysql*.log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;;
Replace both '@MYSQLD_USER@' with 'mysql' solves the problem.
Trivial to reproduce.
Environment: XtraDB- Cluster- 57-5.7. 18-29.20. 1.el7.x86_ 64 xtrabackup- 24-2.4. 8-1.el7. x86_64 XtraDB- Cluster- server- 57-5.7. 18-29.20. 1.el7.x86_ 64 XtraDB- Cluster- client- 57-5.7. 18-29.20. 1.el7.x86_ 64 XtraDB- Cluster- shared- compat- 57-5.7. 18-29.20. 1.el7.x86_ 64 toolkit- 3.0.4-1. el7.x86_ 64 XtraDB- Cluster- shared- 57-5.7. 18-29.20. 1.el7.x86_ 64
$ rpm -qa | grep -i percona
Percona-
percona-
Percona-
Percona-
Percona-
percona-
Percona-
Consider the following my.cnf: /var/log/ mysql.log
=====
[mysqld]
log-error=
[mysqld_safe] /var/log/ mysql.log
log-error=
=====
Then start the MySQL service fail, and when looking at the status: systemd/ system/ mysql.service; enabled) /usr/bin/ mysql-systemd stop-post (code=exited, status=0/SUCCESS) /usr/bin/ mysql-systemd stop (code=exited, status=0/SUCCESS) /usr/bin/ mysql-systemd start-post $MAINPID (code=exited, status=0/SUCCESS) /usr/bin/ mysqld_ safe --basedir=/usr (code=exited, status=0/SUCCESS) /usr/bin/ mysql-systemd start-pre (code=exited, status=1/FAILURE)
$ systemctl status mysql
mysql.service - Percona XtraDB Cluster
Loaded: loaded (/usr/lib/
Active: failed (Result: exit-code) since Thu 2017-08-24 16:14:31 UTC; 5s ago
Process: 2856 ExecStopPost=
Process: 2173 ExecStop=
Process: 28349 ExecStartPost=
Process: 28348 ExecStart=
Process: 3903 ExecStartPre=
Main PID: 28348 (code=exited, status=0/SUCCESS)
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Starting Percona XtraDB Cluster... 3903]: install: invalid user '@MYSQLD_USER@'
Aug 24 16:14:31 ip-10-0-0-155 mysql-systemd[
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Failed to start Percona XtraDB Cluster.
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Unit mysql.service entered failed state.
Looking at line 48 of /usr/bin/ mysql-systemd:
mysql* .log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;;
Replace both '@MYSQLD_USER@' with 'mysql' solves the problem.