使用 Foreman 重新启动单个进程
我已经使用 foreman 一段时间了,以集中的方式扩展我的各种 ruby 流程,它对我来说工作得很好。
无论如何,我希望有一些功能来重新启动进程,甚至给它更多的控制权,比如杀死一个进程并再次启动它,在当前的实现中,当我杀死一个进程时,主工头中的整个进程都会停止。这里有任何解决方法或解决方案吗?
提前致谢
I've been using foreman for a while now to scale my various ruby processes in a centralized manner, and it is working perfectly for me .
Anyways I would like to have some feature to restart a process or even to give it more control like to kill a process and start it again, in the current implementation when I kill one process the whole process in the main foreman stop . any workaround or solution here ?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然
foreman start
对于开发来说非常方便,但我不推荐它用于生产。我建议使用 upstart,但还有其他替代方案 - foreman 还支持导出到 bluepill、inittab 和 runit(我自己从未使用过其中任何一个)。我过去也使用过god,它对于启动和监控进程非常有效。我写了一个 foreman_god gem 来使用 Procfiles 和 god,这简化了配置(不需要导出任何配置文件)。
或者,还有一个导出脚本,可以从 Procfile 导出 god 配置文件。
While
foreman start
is very convenient for development, I would not recommend it for production. I recommend using upstart, but there are also other alternatives - foreman also supports exporting to bluepill, inittab and runit (I've never used any of these myself).I've also used god in the past, and it worked quite well for starting and monitoring processes. I wrote a foreman_god gem to use Procfiles with god, which simplifies the configuration (no need to export any config files).
Alternatively, there is also an export script that exports god config files from your Procfile.
似乎这个答案是在 John Mosses foreman_restartable 的分叉内, https://github.com/jmoses/foreman
It seems that answer within the fork of John Mosses foreman_restartable , https://github.com/jmoses/foreman