问题描述
同一个域名下,有机器宿主机故障导致容器异常,其他一个正常容器ip承担了更多请求,tcp连接数、cpu突增,然后该台机器开始端口链接异常。
处理过程
- 查看nginx进程
ps -ef | grep nginx
nginx admin 184920 283696 0 09:27 ? 00:00:13
nginx: worker process admin 184921 283696 0 09:27 ? 00:00:12
nginx: worker process is shutting down admin 184922 283696 0 09:27 ? 00:00:07 nginx: worker process admin 184924 283696 0 09:27 ? 00:00:04
nginx: worker process admin 184925 283696 0 09:27 ? 00:00:04
nginx: worker process admin 184926 283696 0 09:27 ? 00:00:00
nginx: worker process admin 184927 283696 0 09:27 ? 00:00:00
nginx: worker process admin 184931 283696 0 09:28 ? 00:00:00
nginx: worker process admin 186501 186404 0 13:07 pts/0 00:00:00
grep nginx admin 283696 1 0 2024 ? 00:00:00 nginx: master process ./nginx
- 发现nginx异常,重启后未恢复,stop后有报错
cd /export/servers/openresty/nginx/sbin
./nginx -s reload
./nginx -s stop
报错信息:
nginx: [emerg] bind() to 0.0.0.0:8888 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8888 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8888 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8888 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8888 failed (98: Address already in use)
nginx: [emerg] still could not bind()
- kill进程
kill -9 [进程号]
- nginx shop后重新启动,恢复正常
./nginx -s stop
./nginx