首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Opsworks - Chef: Rake in opsworks chef hook running sidekiq

Opsworks - Chef: Rake in opsworks chef hook running sidekiq
EN

Stack Overflow用户
提问于 2015-01-10 03:08:57
回答 1查看 409关注 0票数 0

我在opsworks中使用before_restart.rb钩子,当它运行“rakei18n:js:export”时,我遇到了一个问题。我不知道为什么要用这把叉子跑sidekiq。它仅在opsworks的设置阶段失败。当我部署它时,这个错误就消失了。

代码语言:javascript
复制
[2015-01-09T18:52:17+00:00] INFO: deploy[/srv/www/XXX] queueing checkdeploy hook /srv/www/XXX/releases/20150109185157/deploy/before_restart.rb
[2015-01-09T18:52:17+00:00] INFO: Processing execute[rake i18n:js:export] action run (/srv/www/XXXX/releases/20150109185157/deploy/before_restart.rb line 3)


Error executing action `run` on resource 'execute[rake i18n:js:export]'


Mixlib::ShellOut::ShellCommandFailed

Expected process to exit with [0], but received '1'
---- Begin output of bundle exec rake i18n:js:export ----
STDOUT: 2015-01-09T18:52:30Z 1808 TID-92c6g INFO: Sidekiq client with redis options {}
STDERR: /home/deploy/.bundler/XXXX/ruby/2.1.0/gems/redis-3.1.0/lib/redis/client.rb:309:in `rescue in establish_connection': Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED) (Redis::CannotConnectError)
EN

回答 1

Stack Overflow用户

发布于 2018-03-07 00:28:44

Sidekiq客户端(不是sidekiq服务器)正在运行,因为它是在初始化器中定义的。当rake运行时,它加载整个rails应用程序环境。因此,要么允许环境变量在config/initializers/sidekiq.rb中禁用sidekiq客户端,要么确保在运行此命令的实例上正确配置redis-server。

代码语言:javascript
复制
unless ENV['DISABLE_SIDEKIQ']
  # Sidekiq.configure...
end

DISABLE_SIDEKIQ=true bundle exec rake do:stuff
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27867516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档