ທີ່ຢູ່ CWP7 ຕິດຕາມກວດກາບັນຫາຂໍ້ຜິດພາດ: ການເຊື່ອມຕໍ່ nginx faiນໍາພາໃນ monit
ຄັ້ງສຸດທ້າຍChen Weiliang在ແຜງຄວບຄຸມ CWP (CWP7) ເພື່ອຕິດຕັ້ງການຕິດຕາມ Monitຊອບແວ,,ແກ້ໄຂຂະບວນການກວດສອບ Monit startup ຫາຍໄປ monit.service ລົ້ມເຫລວ.
ຕອນນີ້ຂ້ອຍມີບັນຫາໃຫມ່ - ການກວດສອບການເຊື່ອມຕໍ່ Nginx ລົ້ມເຫລວ ...
ວິທີການແກ້ໄຂການເຊື່ອມຕໍ່ nginx ລົ້ມເຫລວໃນ monit?
ວິທີການແກ້ໄຂບັນຫາການເຊື່ອມຕໍ່ nginx ລົ້ມເຫລວໃນການຕິດຕາມບັນຫາ:
ທໍາອິດ, 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 ໄດ້ຖືກແກ້ໄຂໃນທີ່ສຸດ!
ຫວັງ Chen Weiliang Blog ( https://www.chenweiliang.com/ ) ແບ່ງປັນ "CWP7 ແກ້ໄຂບັນຫາຂອງການເຊື່ອມຕໍ່ nginx ລົ້ມເຫລວໃນ monit error", ເຊິ່ງເປັນປະໂຫຍດສໍາລັບທ່ານ.
ຍິນດີຕ້ອນຮັບແບ່ງປັນການເຊື່ອມຕໍ່ຂອງບົດຄວາມນີ້:https://www.chenweiliang.com/cwl-1423.html
ຍິນດີຕ້ອນຮັບສູ່ຊ່ອງ Telegram ຂອງບລັອກຂອງ Chen Weiliang ເພື່ອຮັບອັບເດດຫຼ້າສຸດ!
📚ຄູ່ມືນີ້ມີຄຸນຄ່າອັນມະຫາສານ, 🌟ນີ້ເປັນໂອກາດທີ່ຫາຍາກ, ຢ່າພາດມັນ! ⏰⌛💨
Share and like ຖ້າມັກ!
ການແບ່ງປັນແລະການຖືກໃຈຂອງທ່ານແມ່ນການຊຸກຍູ້ຢ່າງຕໍ່ເນື່ອງຂອງພວກເຮົາ!