EngineYard上的Redis Connection问题

时间:2013-09-19 16:59:37

标签: ruby-on-rails-3 engineyard

嘿我正在尝试将我的应用程序连接到单个引擎实例上的redis: redis-cli ping得到了pong,并且在应用程序中作为gem包含的服务器似乎正在运行。

当我手动运行bundle exec foreman start在这里是输出:

16:42:24 worker_slow.1 | started with pid 9334
16:42:24 clock.1       | started with pid 9335
16:42:43 clock.1       | I, [2013-09-19T16:42:43.159853 #9335]  INFO -- : Starting clock for 1 events: [ run_clockwork ]
16:42:43 clock.1       | I, [2013-09-19T16:42:43.160464 #9335]  INFO -- : Triggering 'run_clockwork'
16:42:43 clock.1       | 2013-09-19T16:42:43Z 9335 TID-oswnco03o INFO: Sidekiq client using redis://localhost:6379/0 with options {}
16:42:43 clock.1       | E, [2013-09-19T16:42:43.385730 #9335] ERROR -- : ERR wrong number of arguments for 'set' command (Redis::CommandError)
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis/client.rb:85:in `call'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:675:in `block in set'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:36:in `block in synchronize'
16:42:43 clock.1       | /usr/lib64/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:36:in `synchronize'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:673:in `set'
16:42:43 clock.1       | /data/rsscom/releases/20130919162848/app/models/redis_lock.rb:3:in `block in acquire'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/connection_pool-1.1.0/lib/connection_pool.rb:49:in `with'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/sidekiq-2.13.1/lib/sidekiq.rb:67:in `redis'
16:42:43 clock.1       | /data/rsscom/releases/20130919162848/app/models/redis_lock.rb:3:in `acquire'
16:42:43 clock.1       | /data/rsscom/releases/20130919162848/lib/clock.rb:10:in `block in <top (required)>'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:51:in `call'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:51:in `execute'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:46:in `run'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:61:in `block in tick'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:59:in `each'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:59:in `tick'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:49:in `block in run'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:48:in `loop'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:48:in `run'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork.rb:26:in `run'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/bin/clockwork:19:in `<top (required)>'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bin/clockwork:23:in `load'
16:42:43 clock.1       | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bin/clockwork:23:in `<main>'

我甚至不确定从哪里开始寻找set命令以及它为什么接收错误数量的参数。有什么建议吗?

2 个答案:

答案 0 :(得分:0)

我稍微挖了一下。您可以查找此处发出的set命令:

https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L675

您可以将调试器放在此处,尝试复制方案并获得确切的错误。

Redis' set命令的工作方式如下:

SET <key_name> <value>

例如:

SET name 'Avi'

获取最佳细节:

http://redis.io/commands/set

答案 1 :(得分:0)

使用了gem redis-rb,它扩展了SET方法,但不是最后几个args。只有名字/值。