uWSGI触摸重载选项不起作用

时间:2016-11-02 14:55:36

标签: python flask uwsgi

我尝试在.ini文件和命令行中使用touch-reload选项。两者都没有帮助。这是我的启动日志:

*** Starting uWSGI 2.0.14 (64bit) on [Wed Nov  2 17:46:38 2016] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 05 October 2016 20:03:58
os: Linux-3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016
current working directory: /home/mutex/crm
detected binary path: /usr/sbin/uwsgi
chdir() to /opt/crm/application
*** WARNING: you are running uWSGI without its master process manager ***
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /opt/crm/sock/uwsgi.sock fd 3
Python version: 2.7.5 (default, Sep 15 2016, 22:37:39)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
*** Operational MODE: preforking ***
added /opt/crm/ to pythonpath.
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1909850 pid: 20099 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (pid: 20099, cores: 1)
spawned uWSGI worker 2 (pid: 20104, cores: 1)
spawned uWSGI worker 3 (pid: 20105, cores: 1)
spawned uWSGI worker 4 (pid: 20106, cores: 1)

这不是所有消息,我将其截断了一点。 这是我的配置:

[mutex@p401790 crm]$ cat uwsgi.ini 
[uwsgi]
env=PYTHONIOENCODING=utf-8
env=LANG=en_US.UTF-8
master=0
workers=4
chdir=/opt/crm/application
socket=/opt/crm/sock/uwsgi.sock
pythonpath=/opt/crm
module=runserver
callable=app
logto=/opt/crm/log/uwsgi.log
logformat=[%(ctime)] %(addr) - %(host) %(method) %(uri) %(status) %(msecs)ms
touch-reload=/opt/crm/reload.ini
plugins = python
gid=nginx
uid=nginx
py-autoreload = 1

py-autoreload选项也可以正常工作。我做错了什么?

1 个答案:

答案 0 :(得分:2)

要使这些选项正常工作(并且通常能够正常重新加载uWSGI服务器),服务器必须使用master进程模式(docs)运行 - 所以你需要在master=true中设置uwsgi.ini

相关问题