CentOS 7:无法重新启动 mysql.service:未找到单元

CentOS 7:无法重新启动 mysql.service:未找到单元

我已经安装并启动Percona XtraDB Cluster 5.7在 3 个节点上。一切正常,直到我重新启动了第一个节点。从那时起,mysql.service 无法正常(重新)启动:

[root@percona1]# systemctl restart mysql.service
Failed to restart mysql.service: Unit not found.

我想在这个节点上正确启动 mysql (percona 服务器),就像在其他节点上一样。这是我在第一个节点上得到的结果:

[root@percona1]# systemctl status mysql.service
    ● mysql.service
       Loaded: not-found (Reason: Invalid argument)
       Active: active (running) since Tue 2019-08-13 16:24:31 CEST; 24h ago
     Main PID: 1931 (mysqld_safe)
       CGroup: /system.slice/mysql.service
               ├─1931 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
               └─2515 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-provider=/usr/lib64/galera3/libgalera_smm.so --log-error=/var/log/my...

    Aug 13 16:23:47 percona1 systemd[1]: Starting Percona XtraDB Cluster...
    Aug 13 16:23:48 percona1 mysqld_safe[1931]: 2019-08-13T14:23:48.456697Z mysqld_safe Logging to '/var/log/mysqld.log'.
    Aug 13 16:23:48 percona1 mysqld_safe[1931]: 2019-08-13T14:23:48.463619Z mysqld_safe Logging to '/var/log/mysqld.log'.
    Aug 13 16:23:48 percona1 mysqld_safe[1931]: 2019-08-13T14:23:48.524311Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    Aug 13 16:23:48 percona1 mysqld_safe[1931]: 2019-08-13T14:23:48.553983Z mysqld_safe Skipping wsrep-recover for af1dd70d-b928-11e9-a530-aa3807a48b86:9 pair
    Aug 13 16:23:48 percona1 mysqld_safe[1931]: 2019-08-13T14:23:48.557526Z mysqld_safe Assigning af1dd70d-b928-11e9-a530-aa3807a48b86:9 to wsrep_start_position
    Aug 13 16:23:51 percona1 mysql-systemd[1932]: State transfer in progress, setting sleep higher
    Aug 13 16:24:31 percona1 mysql-systemd[1932]: SUCCESS!
    Aug 13 16:24:31 percona1 systemd[1]: Started Percona XtraDB Cluster.
    Aug 14 14:28:10 percona1 systemd[1]: Current command vanished from the unit file, execution of the command list won't be resumed.


[root@percona1]# journalctl -xe
    Aug 14 17:05:59 percona1 polkitd[572]: Registered Authentication Agent for unix-process:12131:9882093 (system bus name :1.106 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Aug 14 17:06:00 percona1 polkitd[572]: Unregistered Authentication Agent for unix-process:12131:9882093 (system bus name :1.106, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)


[root@percona1]# systemd-analyze verify mysql.service
    Error: org.freedesktop.systemd1.NoSuchUnit: Unit not found.
    Failed to create mysql.service/start: No such file or directory

注意:percona3 已引导,percona2 已正常启动(systemctl start mysql.service)。问题只出现在 percona1 上,在我看来,它似乎是systemd有关的。

答案1

可能存在一个服务(我们称之为),它对另一个服务(我们称之为)rogue.service有“需要”依赖关系,并且还有对该服务的依赖关系,但该服务在机器上并不存在。mysql.servicemissing.servicemissing.service

相关内容