我用gunicorn运行我的django应用程序并遇到了一个奇怪的问题。
此命令不起作用 -
(venv)-bash-4.1$ gunicorn myapp.wsgi -b unix:/opt/myapp/var/run/app.sock
[2016-09-15 06:04:12 +0000] [10100] [INFO] Starting gunicorn 19.4.5
[2016-09-15 06:04:12 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:13 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:14 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:15 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:16 +0000] [10100] [ERROR] Retrying in 1 second.
[2016-09-15 06:04:17 +0000] [10100] [ERROR] Can't connect to /opt/myapp/var/run/app.sock
这个有效
(venv)-bash-4.1$ gunicorn myapp.wsgi -b unix:/tmp/myapp.sock
[2016-09-15 06:04:58 +0000] [10105] [INFO] Starting gunicorn 19.4.5
[2016-09-15 06:04:58 +0000] [10105] [INFO] Listening at: unix:/tmp/myapp.sock (10105)
[2016-09-15 06:04:58 +0000] [10105] [INFO] Using worker: sync
[2016-09-15 06:04:58 +0000] [10110] [INFO] Booting worker with pid: 10110
[2016-09-15 06:05:01 +0000] [10105] [INFO] Handling signal: int
提供,我在/ opt / myapp / var / run /目录上拥有777权限。唯一的区别是套接字文件的位置。
更新:此应用程序在虚拟机中运行,以vagrant启动,并使用fileshare选项映射/ opt / myapp。