我正在尝试使用主管部署我的 Django 应用程序。当我启动主管时,它会正确启动 daphne,但是不会启动工作服务器。
这是 supervisor.conf 的代码示例(工人块):
[program:runworker]
command=python /home/django/environment/myproject/manage.py runworker
stopsignal=KILL
killasgroup=true
浏览器等待了很长时间,然后显示:
503 Service Unavailable
Worker server failed to respond within time limit.
我还可以补充一点,如果我独立启动流程(不使用任何流程控制系统),它实际上可以工作。我在 Nginx 反向代理后面,但我认为这根本不是问题..
这是主管的输出:
2016-08-17 19:01:09,439 INFO supervisord started with pid 3473
2016-08-17 19:01:10,441 INFO spawned: 'runworker' with pid 3477
2016-08-17 19:01:10,442 INFO spawned: 'daphne' with pid 3478
2016-08-17 19:01:11,421 DEBG 'daphne' stderr output:
2016-08-17 23:01:11,421 INFO Starting server at 0.0.0.0:9000, channel layer myproject.asgi:channel_layer
2016-08-17 19:01:11,519 INFO success: runworker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-08-17 19:01:11,519 INFO success: daphne entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-08-17 19:01:11,591 DEBG 'runworker' stderr output:
2016-08-17 23:01:11,591 - INFO - runworker - Running worker against channel layer default (asgi_redis.core.RedisChannelLayer)
2016-08-17 19:01:11,592 DEBG 'runworker' stderr output:
2016-08-17 23:01:11,592 - INFO - worker - Listening on channels http.request, websocket.connect, websocket.disconnect, websocket.receive