gpt4 book ai didi

ruby - Unicorn 在部署后定期无法重新启动 - PID 过时

转载 作者:太空宇宙 更新时间:2023-11-03 15:59:35 28 4
gpt4 key购买 nike

一段时间以来,我一直在尝试自己解决这个问题,但一直没有成功。当我大约有 10% 的时间重新部署我的 Rails 应用程序时,就会发生这种情况。其他 90% 的时间部署顺利进行。

我试了又试,还是没成功。所以我向 SO 群众寻求帮助。

关于我的堆栈的一些信息:我正在使用 chef 在 Ubuntu 14.04 上运行的 vagrant 上生成我的实例,并使用 upstart 到海外 unicorn 。

错误:

srv/www/rails/releases/ef6a792a19f8bb9d36ef4d0ab15ee38ca91a0cd1/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:206:in `pid=': Already running on PID:17694 (or pid=/srv/www/rails/shared/pids/unicorn.pid is stale) (ArgumentError)
from /srv/www/rails/releases/ef6a792a19f8bb9d36ef4d0ab15ee38ca91a0cd1/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:135:in `start'
from /srv/www/rails/releases/ef6a792a19f8bb9d36ef4d0ab15ee38ca91a0cd1/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
from /srv/www/rails/releases/ef6a792a19f8bb9d36ef4d0ab15ee38ca91a0cd1/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `load'
from /srv/www/rails/releases/ef6a792a19f8bb9d36ef4d0ab15ee38ca91a0cd1/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in `<main>'

我的 unicorn Upstart 脚本是 here .而我的 unicorn 配置文件​​可以查看here .

如果您需要更多信息,请告诉我。以上感谢您的帮助和时间。

最佳答案

我也遇到过这个问题。在尝试运行 Unicorn 之前,您需要清除 upstart 脚本中的旧 PID 文件。

rm /srv/www/rails/shared/pids/unicorn.pid

或者,看看 https://github.com/tablexi/capistrano3-unicorn了解确定服务器状态并适当启动/重启 Unicorn 的方法。

关于ruby - Unicorn 在部署后定期无法重新启动 - PID 过时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28417417/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com