CWP7은 monit 오류에서 nginx 연결 실패 문제를 해결합니다.

CWP7 Monit 모니터링 오류 해결: 모니터링 중 Nginx 연결 실패

CWP7은 monit 오류에서 nginx 연결 실패 문제를 해결합니다.

지난번에 Chen Weiliang은 CWP 제어판(CWP7) 에 Monit 모니터링 소프트웨어를 설치 하면서 Monit 모니터링 프로세스가 시작 시 사라지는 문제(monit.service 실패)를 해결했습니다.

이제 새로운 문제가 있습니다. Nginx 연결 모니터링에 실패했습니다...

모니터에서 nginx 연결 실패를 해결하는 방법은 무엇입니까?

nginx 연결을 해결하는 방법은 monit 오류 문제에서 실패했습니다.

먼저 다음 명령어로 SSH 접속 ▼

ps -ef|grep nginx

nginx 구성 파일을 찾았습니다.

[root@ten ~]# ps -ef|grep nginx
root 11550 1 0 02:12 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nobody 11551 11550 0 02:12 ? 00:00:04 nginx: worker process
nobody 11552 11550 0 02:12 ? 00:00:08 nginx: worker process
nobody 11553 11550 0 02:12 ? 00:00:02 nginx: worker process
nobody 11554 11550 0 02:12 ? 00:00:01 nginx: worker process
nobody 11555 11550 0 02:12 ? 00:00:00 nginx: cache manager process
root 19827 9820 0 02:37 pts/0 00:00:00 grep --color=auto nginx

Nginx 설정 파일을 엽니다.

/etc/nginx/nginx.conf

nginx.pid의 경로 위치를 찾았습니다.

pid /var/run/nginx.pid;

Monit 모니터링 프로그램의 설정 파일에서 nginx를 모니터링하기 위한 다음 설정을 입력합니다▼

check process nginx with pidfile /var/run/nginx.pid
start program "/usr/bin/systemctl start nginx.service"
stop program "/usr/bin/systemctl stop nginx.service"
if failed port 8181 protocol http then restart
if 4 restarts within 8 cycles then timeoutif 4 restarts within 8 cycles then timeout

모니터 모니터링 프로그램 재시작▼

systemctl restart monit.service

모니터 모니터링 프로그램 상태 보기▼

systemctl status monit.service

이 단계에 도달하면 오류 메시지가 계속 나타납니다.nginx Connection failed in monit

모니터링 nginx 구성의 포트 번호를 "8181" 또는 "80"으로 수정하십시오.

if failed port 8181 protocol http then restart
if failed port 80 protocol http then restart

그런 다음 모니터 모니터링 프로그램을 다시 시작하세요▼

systemctl restart monit.service

모니터 모니터링 프로그램 상태 보기▼

systemctl status monit.service

monit에서 nginx 연결 실패 문제가 드디어 해결되었습니다!

发表 评论

您的邮箱地址不会被公开。必填项已用*标注

위쪽으로 스크롤