V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  hanssx  ›  全部回复第 59 页 / 共 59 页
回复总数  1169
1 ... 50  51  52  53  54  55  56  57  58  59  
@itertools
我根据 https://stackoverflow.com/questions/16756624/gunicorn-connection-in-use-0-0-0-0-5000/40894414
[root@VM asset]# sudo fuser -k 5000/tcp
5000/tcp: 18762 18765
[root@VM asset]# supervisorctl status
asset RUNNING pid 20781, uptime 0:00:32
[root@VM asset]# netstat -antlp | grep 5000
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 20781/python3.7m
tcp 0 0 127.0.0.1:49678 127.0.0.1:5000 TIME_WAIT -
tcp 0 0 127.0.0.1:5000 127.0.0.1:49708 ESTABLISHED 20787/python3.7m
tcp 0 0 127.0.0.1:49650 127.0.0.1:5000 TIME_WAIT -
tcp 0 0 127.0.0.1:5000 127.0.0.1:49706 TIME_WAIT -
tcp 0 0 127.0.0.1:49708 127.0.0.1:5000 ESTABLISHED 25344/nginx: worker
tcp 0 0 127.0.0.1:5000 127.0.0.1:49680 TIME_WAIT -
看日志,还是那些东西,我去 gg 一下日志相关的东西,
[2018-10-11 13:58:33 +0800] [19707] [INFO] Starting gunicorn 19.9.0
[2018-10-11 13:58:33 +0800] [19707] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:33 +0800] [19707] [ERROR] Retrying in 1 second.
[2018-10-11 13:58:34 +0800] [19702] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:34 +0800] [19702] [ERROR] Retrying in 1 second.
[2018-10-11 13:58:34 +0800] [19707] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:34 +0800] [19707] [ERROR] Retrying in 1 second.
[2018-10-11 13:58:35 +0800] [19702] [ERROR] Can't connect to ('127.0.0.1', 5000)
[2018-10-11 13:58:35 +0800] [19707] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:35 +0800] [19707] [ERROR] Retrying in 1 second.
[2018-10-11 13:58:36 +0800] [19707] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:36 +0800] [19707] [ERROR] Retrying in 1 second.
[2018-10-11 13:58:37 +0800] [19716] [INFO] Starting gunicorn 19.9.0
[2018-10-11 13:58:37 +0800] [19716] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2018-10-11 13:58:37 +0800] [19716] [ERROR] Retrying in 1 second.
@itertools
supervisorctl stop all
find / -name supervisor.sock 后 unlink 掉
再重新启动 supervisord -c /etc/supervisord.conf
还是不行。。。
supervisorctl status,显示
asset STARTING
没 RUNNING 起来。。。
@FiveDDD 感谢回复,我用的 gevent,命令和你这个不一样
@itertools 感谢关注,但是测试机上面的 gunicorn 版本就是你说的这个,
(asset-ar0OxIPP) [root@VM asset]# pipenv graph | grep gunicorn
gunicorn==19.9.0
这是 flask-socketio 官网给的例子,说了一大堆英文,反正就是要用 gunicorn 就要那么写,如果搭配 gevent 的话,
https://flask-socketio.readthedocs.io/en/latest/#gunicorn-web-server
最后命令是这么写的,
gunicorn -b 127.0.0.1:5000 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 module:app
@greyli 辉哥,我改了启动命令了,参考的文档里面
gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 module:app
对了,supervisor 有错误日志,一直在尝试连接,如下图:
![image]( http://pgf1p2i0h.bkt.clouddn.com/supervisor%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%9755.png)
2018-09-30 12:10:45 +08:00
回复了 larkifly 创建的主题 Django django 如何返回后台执行进度给前端
@20150517 celery.result.ResultSet 有个 completed_count
http://docs.celeryproject.org/en/latest/reference/celery.result.html#celery.result.ResultSet.completed_count
但是这是 group 下有几个任务完成了,而不是每个任务的完成进度,不一样吧。
1 ... 50  51  52  53  54  55  56  57  58  59  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2934 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 07:44 · PVG 15:44 · LAX 23:44 · JFK 02:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.