[英]uWSGI Emperor does not reload Vassal by touching the .ini file
I have multiple uWSGI vassals, all monitored by uwsgi emperor.我有多个 uWSGI vassals,都由 uwsgi 皇帝监控。 I update the code for my app (Django) and I want the emperor to perform a clean reload of one of the vassals.
我更新了我的应用程序 (Django) 的代码,我希望皇帝对其中一个封臣执行一次干净的重新加载。 To do that I
要做到这一点,我
touch vassal-foo.ini
In the logs I see [emperor] reload the uwsgi instance vassal-foo.ini
.在日志中,我看到
[emperor] reload the uwsgi instance vassal-foo.ini
。 This sounds promising, but the app is not reloaded.这听起来很有希望,但该应用程序并未重新加载。 It continues to run the old version.
它继续运行旧版本。 Checking the process (PID) startup time, indeed, it has not been restarted.
检查进程(PID)启动时间,确实没有重启。
Any hints what might cause this?任何提示可能导致这种情况的原因? Few things that might be uncommon:
一些可能不常见的事情:
initctl
initctl
下运行kill -9
-ing the vassal triggers a correct reload (obviously) kill -9
使 vassal 触发正确的重新加载(显然)threading.Thread(target).start()
) running with daemon=True
threading.Thread(target).start()
)中有一个辅助线程,运行daemon=True
Things I tried and did not work:我尝试过但没有奏效的事情:
threading.Thread(target).start()
)threading.Thread(target).start()
)touch --no-dereference vassal-foo.ini
touch --no-dereference vassal-foo.ini
--emperor-nofollow
--emperor-nofollow
开始皇帝vassal-foo.ini: vassal-foo.ini:
master = false
processes = 1
thunder-lock = true
enable-threads = true
socket = /tmp/%n.sock
chmod-socket = 666
vacuum = true
Emperor:皇帝:
exec /tmp/uwsgi --emperor /tmp/configs/uwsgi/ --die-on-term --uid me --gid me --logto /tmp/logs/uwsgi-emperor.log
uWSGI version uWSGI 版本
$ uwsgi --version
2.0.17
The problem is that your vassal not run in master mode.问题是你的 vassal 没有在主模式下运行。
All the ways uwsgi reload a requires master process. uwsgi 重新加载 a 的所有方式都需要主进程。
In emperor mode, when you touch the ini, the emperor send a sighup to the vassal and record in the log that the vassal is reload.在皇帝模式下,当你触摸 ini 时,皇帝会向 vassal 发出一声叹息,并在日志中记录 vassal 正在重新加载。 But if the vassal doesn't has a master it just ignore the sighup.
但是如果 vassal 没有主人,它就会忽略 sighup。 So that is why you see reload in log but nothing happened.
所以这就是为什么您在日志中看到重新加载但没有发生任何事情的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.