nginxå´»úÔõô°ì
nginx ¹ÊÕÏɨ³ý°ì·¨£º¼ì²é nginx ״̬ºÍ¹ýʧÈÕÖ¾ÖØÆô nginx¼ì²éÉèÖÃÎļþÖеÄÓï·¨¹ýʧºÍÎÞЧÉèÖüì²éÎļþÐÎò·ûºÍÄÚ´æʹÓÃÏÞÖƼì²éÇå¾²×éºÍ·À»ðǽ¹æÔòÉó²é nginx Àú³ÌÊÇ·ñ¹ÒÆð¼ì²éÎļþϵͳ¿ÉÓÿռä¼ì²éµÚÈý·½Ä£¿éµÄ×°ÖúÍÎȹÌÐÔɨ³ýÓ²¼þÎÊÌâ
nginx å´»ú¹ÊÕÏɨ³ý
1. È·¶¨ÎÊÌâ
ʹÓà systemctl status nginx ¼ì²é nginx µÄ״̬¡£
Éó²é /var/log/nginx/error.log ÖеĹýʧÐÂÎÅ¡£
2. ÖØÆô nginx
ʹÓà systemctl restart nginx ʵÑéÖØÆô nginx¡£
ÈôÊÇÖØÆôʧ°Ü£¬ÇëʹÓà journalctl -xe ¼ì²éÏêϸÐÅÏ¢¡£
3. ¼ì²éÉèÖÃÎÊÌâ
Éó²é /etc/nginx/nginx.conf ÖеÄÉèÖÃÎļþ£¬È·±£Ã»ÓÐÓï·¨¹ýʧ»òÎÞЧÉèÖá£
ÌØÊâ×¢ÖØ server¡¢listen ºÍ root Ö¸Áî¡£
4. ¼ì²é×ÊÔ´ÏÞÖÆ
ʹÓà ulimit -n ¼ì²éÎļþÐÎò·ûµÄÏÞÖÆ¡£nginx ĬÈÏÐèÒª 1024 ¸ö¡£
ʹÓà free -m ¼ì²éÄÚ´æʹÓÃÇéÐΡ£
5. ¼ì²éÇå¾²×é
È·±£ nginx µÄÇå¾²×éÔÊÐíÀ´×Ô¿Í»§¶ËµÄ´«ÈëÅþÁ¬¡£
¼ì²é·À»ðǽ¹æÔòÊÇ·ñûÓÐ×èÖ¹ nginx¡£
6. ¼ì²éÀú³Ì¹ÒÆð
ʹÓà ps auxf | grep nginx ¼ì²é nginx Àú³ÌÊÇ·ñ¹ÒÆð¡£
ÈôÊÇÀú³Ì¹ÒÆð£¬ÇëʹÓà gstack »ñÈ¡¿ÍÕ»¸ú×Ù¡£
7. ¼ì²éÎļþϵͳ¹ÊÕÏ
ʹÓà df -h ¼ì²é nginx ÈÕÖ¾ºÍÉèÖÃĿ¼µÄ¿ÉÓÿռ䡣
ÈôÊÇ¿Õ¼äȱ·¦£¬Çë˼Á¿É¨³ýÎôÈÕÖ¾»òÉý¼¶µ½¸ü´óÈÝÁ¿µÄÎļþϵͳ¡£
8. ¼ì²éµÚÈý·½Ä£¿é
ÈôÊÇ nginx ʹÓõÚÈý·½Ä£¿é£¬ÇëÈ·±£ËüÃÇ×°ÖÃ׼ȷ¡£
½ûÓÿÉÒÉÄ£¿é»ò»ØÍ˵½Îȹ̰汾¡£
9. ¼ì²éÓ²¼þÎÊÌâ
ÈôÊÇɨ³ýÁËËùÓÐÈí¼þÎÊÌ⣬Çë¼ì²éЧÀÍÆ÷Ó²¼þÊÇ·ñÓйÊÕÏ¡£
ÖØÆôЧÀÍÆ÷»òÁªÏµÏµÍ³ÖÎÀíÔ±×·Çó×ÊÖú¡£
ÒÔÉϾÍÊÇnginxå´»úÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡