מענה ל-CWP7 מוניטור ניטורבעיית שגיאה: nginx Connection faiהוביל במוניט
פעם אחרונהצ'ן וייליאנג在לוח הבקרה של CWP (CWP7) להתקנת ניטור Monitתוכנה时 ,פתר את תהליך ניטור ההפעלה של Monit היעלמות monit.service נכשל.
עכשיו יש לי בעיה חדשה - חיבור ניטור Nginx של Monit נכשל...
כיצד לפתור את חיבור nginx נכשל ב-monit?
השיטה לפתור את חיבור 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
הפעל מחדש את תוכנית הניטור Monit▼
systemctl restart monit.service
הצג את מצב תוכנית הניטור של Monit▼
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
לאחר מכן, הפעל מחדש את תוכנית הניטור Monit▼
systemctl restart monit.service
הצג את מצב תוכנית הניטור של Monit▼
systemctl status monit.service
הבעיה של חיבור nginx נכשל ב-monit נפתרה סוף סוף!
Hope Chen Weiliang בלוג ( https://www.chenweiliang.com/ ) שיתף "CWP7 פותר את הבעיה של nginx Connection failed in monit error", וזה מועיל לך.
מוזמנים לשתף את הקישור של מאמר זה:https://www.chenweiliang.com/cwl-1423.html
ברוכים הבאים לערוץ הטלגרם של הבלוג של Chen Weiliang כדי לקבל את העדכונים האחרונים!
📚 המדריך הזה מכיל ערך עצום, 🌟זו הזדמנות נדירה, אל תפספסו אותה! ⏰⌛💨
שתפו ותעשו לייק אם בא לכם!
השיתוף והלייקים שלך הם המוטיבציה המתמשכת שלנו!