我試圖與主管部署我的Django應用程序。當我啓動主管時,它啓動daphne正確,但工作服務器不會啓動。與主管一起運行Django工作服務器?
這裏的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
感謝蒂姆,我沒有工作,雖然。我認爲它使用了正確的設置模塊,因爲它連接到爲該環境定義的Redis後端。 –