SOの達人
monit を使用して Node.js をデーモンとして実行していますが、ドットで 60 秒ごとに失敗することがわかりました。ここに私のmonit.logがあります
root@mybox:/etc/monit# tail -f /var/log/monit.log
[UTC Sep 4 12:07:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:08:50] error : 'nodejs' failed, cannot open a connection to INET[127.0.0.1:8000] via TCP
[UTC Sep 4 12:08:50] info : 'nodejs' trying to restart
[UTC Sep 4 12:08:50] info : 'nodejs' stop: /sbin/stop
[UTC Sep 4 12:08:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:09:50] error : 'nodejs' failed, cannot open a connection to INET[127.0.0.1:8000] via TCP
[UTC Sep 4 12:09:50] info : 'nodejs' trying to restart
[UTC Sep 4 12:09:50] info : 'nodejs' stop: /sbin/stop
[UTC Sep 4 12:09:50] info : 'nodejs' start: /sbin/start
[UTC Sep 4 12:10:50] info : 'nodejs' connection succeeded to INET[127.0.0.1:8000] via TCP
これがmonitrcからの私のmonit構成です
set logfile /var/log/monit.log
check host nodejs with address 127.0.0.1
start program = "/sbin/start nodeapp"
stop program = "/sbin/stop nodeapp"
if failed port 8000 protocol HTTP
request /
with timeout 10 seconds
then restart
この構成で何か間違ったことをしていますか、それとも Node が定期的に失敗しているように見える他の理由がありますか? この問題を特定するには、他にどこを見る必要がありますか?
ありがとうございました。