简体   繁体   English

uWSGI Emperor 不会通过触摸 .ini 文件重新加载 Vassal

[英]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:一些可能不常见的事情:

  • Neither the emperor nor the vassal run in master mode皇帝和封臣都不会在主模式下运行
  • Emperor was installed with pip and runs under initctl用pip安装了Emperor,在initctl下运行
  • kill -9 -ing the vassal triggers a correct reload (obviously) kill -9使 vassal 触发正确的重新加载(显然)
  • I use symlinks我使用符号链接
  • I have a secondary thread inside my python app ( threading.Thread(target).start() ) running with daemon=True我的 python 应用程序( threading.Thread(target).start() )中有一个辅助线程,运行daemon=True

Things I tried and did not work:我尝试过但没有奏效的事情:

  • Run the process without any additional threads (remove threading.Thread(target).start() )在没有任何额外线程的情况下运行进程(删除threading.Thread(target).start()
  • Touching with touch --no-dereference vassal-foo.ini触摸touch --no-dereference vassal-foo.ini
  • Starting emperor with --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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM