$ service apm-server status ● apm-server.service - Elastic APM Server Loaded: loaded (/lib/systemd/system/apm-server.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2019-04-16 14:44:42 CST; 3s ago Docs: https://www.elastic.co/solutions/apm Process: 4783 ExecStart=/usr/share/apm-server/bin/apm-server $BEAT_LOG_OPTS$BEAT_CONFIG_OPTS$BEAT_PATH_OPTS (code=ex Main PID: 4783 (code=exited, status=1/FAILURE) 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Service hold-off time over, scheduling restart. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Scheduled restart job, restart counter is at 5. 4 月 16 14:44:42 ray systemd[1]: Stopped Elastic APM Server. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Start request repeated too quickly. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Failed with result 'exit-code'. 4 月 16 14:44:42 ray systemd[1]: Failed to start Elastic APM Server.
检查日志
首先使用 journalctl 查看 systemd 的日志,如下
1
$ journalctl -u apm-server.service
打印日志
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-- Logs begin at Wed 2019-04-10 09:30:25 CST, end at Tue 2019-04-16 14:44:42 CST. -- 4 月 16 13:43:23 ray systemd[1]: Started Elastic APM Server. 4 月 16 13:43:23 ray apm-server[2487]: Exiting: error loading config file: config file ("/etc/apm-server/apm-server.yml") 4 月 16 13:43:23 ray systemd[1]: apm-server.service: Main process exited, code=exited, status=1/FAILURE 4 月 16 13:43:23 ray systemd[1]: apm-server.service: Failed with result 'exit-code'. 4 月 16 13:43:23 ray systemd[1]: apm-server.service: Service hold-off time over, scheduling restart. 4 月 16 13:43:23 ray systemd[1]: apm-server.service: Scheduled restart job, restart counter is at 1. 4 月 16 13:43:23 ray systemd[1]: Stopped Elastic APM Server. 4 月 16 13:43:23 ray systemd[1]: Started Elastic APM Server.
4 月 16 14:44:42 ray apm-server[4783]: Exiting: error loading config file: config file ("/etc/apm-server/apm-server.yml") 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Main process exited, code=exited, status=1/FAILURE 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Failed with result 'exit-code'. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Service hold-off time over, scheduling restart. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Scheduled restart job, restart counter is at 5. 4 月 16 14:44:42 ray systemd[1]: Stopped Elastic APM Server. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Start request repeated too quickly. 4 月 16 14:44:42 ray systemd[1]: apm-server.service: Failed with result 'exit-code'. 4 月 16 14:44:42 ray systemd[1]: Failed to start Elastic APM Server.