本文介绍了升级到1.9.3红宝石后客户端超时AWS Couchbase集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之后,我们升级到3.2.8 Rails的使用Ruby 1.9.3(从1.8.7),我们的Couchbase的客户再也不能访问我们的AWS集群(Couchbase 1.8社区版)。

After we upgrade to Rails 3.2.8 with Ruby 1.9.3 (from 1.8.7), our Couchbase client could no longer access our AWS cluster (Couchbase 1.8 Community Edition).

1.9.3p194 :011 > c = Couchbase.new("http://ec2-184-169-237-63.us-west-1.compute.amazonaws.com:8091")
=> #<Couchbase::Bucket:0x007fe12d9e6c98 "http://ec2-184-169-237-63.us-west-1.compute.amazonaws.com:8091/pools/default/buckets/default/" default_format=:document, default_flags=0x0, quiet=false, connected=true, timeout=2500000> 

1.9.3p194 :012 > c.get("hello")
Couchbase::Error::Timeout: failed to get value (key="hello", error=0x16)
    from (irb):12:in `get'
    from (irb):12
    from /Users/playmeshinc/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
    from /Users/playmeshinc/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /Users/playmeshinc/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

在管理面板,我们甚至看不到任何请求到达服务器。

On the admin panel, we cannot even see any request reaching the server.

但是,如果我们使用memcache协议中的端口11211,一切正常。如果我们尝试在同一code和我们当地的couchbase集群(OSX)上相同的电话,事情的作品就好。

However, if we use the memcache protocol on port 11211, everything works well. If we try the same code and same call on our local couchbase cluster (OSX), things works just fine.

任何想法,那会发生什么?那是因为Ruby的Couchbase客户端不与AWS或者Ruby 1.9.3兼容?

Any idea what might have happened? Is that because the Ruby Couchbase client is not compatible with AWS or Ruby 1.9.3?

推荐答案

其实我想通了,这是因为在AWS上没戏客户端将返回内部IPS它们无法接触到外部的机器,这就是为什么它超时,当我从测试外面。

Actually I figured out, that's because moxi client on AWS would return internal ips which are not accessible to external machines, that's why it timed out when I was testing from outside.

这篇关于升级到1.9.3红宝石后客户端超时AWS Couchbase集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 07:59