部署ETCD异常解决
# 查看日志 [root@m2 pki]# journalctl -xe -- Subject: Unit etcd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has failed. -- -- The result is failed. 7月 24 11:50:23 m2 systemd[1]: Unit etcd.service entered failed state. 7月 24 11:50:23 m2 systemd[1]: etcd.service failed. 7月 24 11:50:28 m2 systemd[1]: etcd.service holdoff time over, scheduling restart. 7月 24 11:50:28 m2 systemd[1]: Stopped Etcd Server. -- Subject: Unit etcd.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has finished shutting down. 7月 24 11:50:28 m2 systemd[1]: Starting Etcd Server... -- Subject: Unit etcd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has begun starting up. 7月 24 11:50:28 m2 systemd[22353]: Failed at step CHDIR spawning /usr/local/bin/etcd: No such file or directory -- Subject: Process /usr/local/bin/etcd could not be executed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The process /usr/local/bin/etcd could not be executed and failed. -- -- The error number returned by this process is 2. 7月 24 11:50:28 m2 systemd[1]: etcd.service: main process exited, code=exited, status=200/CHDIR 7月 24 11:50:28 m2 systemd[1]: Failed to start Etcd Server. -- Subject: Unit etcd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has failed. -- -- The result is failed. 7月 24 11:50:28 m2 systemd[1]: Unit etcd.service entered failed state. 7月 24 11:50:28 m2 systemd[1]: etcd.service failed.
问题描述:
Oct 13 20:01:08 c_3.50 systemd[1]: Started etcd.
Oct 13 20:01:08 c_3.50 systemd[1]: Starting etcd...
Oct 13 20:01:08 c_3.50 systemd[1]: etcd.service: main process exited, code=exited, status=203/EXEC //203不能执行
Oct 13 20:01:08 c_3.50 systemd[1]: Unit etcd.service entered failed state.
Oct 13 20:01:08 c_3.50 systemd[1]: etcd.service failed.
问题解决:
01、查看exe执行在配置的路径中存在不
02、脚本是否加#!/bin/bash
注意:截图中的环境变量不允许${},必须用实体替换或者写到EnvironmentFile中
Oct 13 20:15:08 c_3.50 systemd[1]: Started etcd.
Oct 13 20:15:08 c_3.50 systemd[1]: Starting etcd...
Oct 13 20:15:08 c_3.50 systemd[1]: etcd.service: main process exited, code=exited, status=1/FAILURE //环境变量设置异常
Oct 13 20:15:08 c_3.50 systemd[1]: Unit etcd.service entered failed state.
Oct 13 20:15:08 c_3.50 systemd[1]: etcd.service failed.