最近几天偶尔会出现ERR_CONNECTION_REFUSED,求救

0

我的worker是部署在内网用的,内网有3台服务器,11.2是应用服务,thinkphp框架,11.3是thinkphp+worker,负责推送及几个简单的页面;
11.3用的centos8+nginx来跑tp和wk的,自己做的证书,就是为了跑ssl。
跑了1个多月一切正常。前几天机房ups故障,服务器被直接断电,故障处理后开机就出现问题了!登录时大几率出现ERR_CONNECTION_REFUSED,还会有客户端掉线,也就是说,会突然掉20几个客户端。然后客户端除非刷新,然后在碰运气不出现ERR_CONNECTION_REFUSED错误,才能重新连接上来。


客户端打顶最高不会超过400,同时在线也不会高于300。


客户端连接ws = new WebSocket("wss://10.xxx.xxx.xxx/wss");


在11.3的防火墙开了1236/2348/2000/2001~2009/80/443


nginx.conf配置文件


worker的状态

已邀请:

智佳思远

赞同来自: 54alin

status里显示 register,gateway,businessworker都有异常退出,找下日志解决下呀。

朕震惊了

赞同来自:

ERR_CONNECTION_REFUSED,说明连接被拒绝了,感觉是nginx层的问题。
看看是不是域名配置了多个ip,个别ip没有启动服务,客户端连到有问题的ip导致连接被拒绝。
还有一种可能是nginx挂了。


另外看到status里gateway和businessworker进程有业务异常,突然20几个客户端掉线是因为gateway异常进程退出导致的。

54alin

赞同来自:

自己顶一下!!

54alin

赞同来自:

刚看了一下nginx的日志:
2021/09/26 09:10:12 [error] 38812#0: 3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.xxx.xxx.146, server: _, request: "GET /wss HTTP/1.1", upstream: "http://127.0.0.1:2348/wss";, host: "10.xxx.xxx.3"
2021/09/26 09:10:12 [error] 38812#0:
3 open() "/var/www/wss/public/50x.html" failed (2: No such file or directory), client: 10.xxx.xxx.146, server: _, request: "GET /wss HTTP/1.1", upstream: "http://127.0.0.1:2348/wss";, host: "10.xxx.xxx.3"

54alin

赞同来自:

2021/09/26 09:10:12 [error] 38812#0: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.xxx.xxx.146, server: _, request: "GET /wss HTTP/1.1", upstream: "http://127.0.0.1:2348/wss", host: "10.xxx.xxx.3"
2021/09/26 09:10:12 [error] 38812#0: *3 open() "/var/www/wss/public/50x.html" failed (2: No such file or directory), client: 10.xxx.xxx.146, server: _, request: "GET /wss HTTP/1.1", upstream: "http://127.0.0.1:2348/wss", host: "10.xxx.xxx.3"

54alin

赞同来自:

问题已经解决了,谢谢两位的提醒!!是网卡问题,换了一个口就正常了!!

要回复问题请先登录注册