【问题标题】:Client timeout on AWS Couchbase cluster after upgrading to Ruby 1.9.3升级到 Ruby 1.9.3 后 AWS Couchbase 集群上的客户端超时
【发布时间】:2013-10-25 12:00:41
【问题描述】:

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

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>'

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

但是,如果我们在端口 11211 上使用 memcache 协议,一切正常。如果我们在本地 couchbase 集群 (OSX) 上尝试相同的代码和相同的调用,一切都会正常工作。

知道可能发生了什么吗?是因为 Ruby Couchbase 客户端与 AWS 或 Ruby 1.9.3 不兼容吗?

【问题讨论】:

    标签: ruby-on-rails-3 amazon-web-services couchbase


    【解决方案1】:

    其实我想通了,是因为 AWS 上的 moxi 客户端会返回外部机器无法访问的内部 ip,这就是为什么我在外部测试时它超时的原因。

    【讨论】:

      【解决方案2】:

      Gem 绝对兼容 EC2 和 1.9.3。您使用的是什么版本的 couchbase gem?什么版本的libcouchbase?听起来罪魁祸首可能是 rvm 或其他东西。我建议尝试 gem 卸载,然后重新安装。还要确保 libcouchbase 是最新的。

      【讨论】:

      • 我们在 AWS 上使用 couchbase server 1.8。我们(两个不同的工程师在两个不同的盒子上)尝试了客户端版本 1.2.0.dp6,然后是 1.1.1 和 1.1.3。他们都无法连接到 aws 服务器。 1.1.1 和 1.1.3 给了我们以下错误:Couchbase::Error::Connect: failed to get value (key="aaa", error=0x17)
      • 我在ec2-50-18-227-192.us-west-1.compute.amazonaws.com:8091/pools/… 上启动了一个服务器,你能检查一下你是否可以使用couchbase 来设置/获取一些价值吗?我可以连接到服务器,但是 set/get 会超时。
      • 如果您尝试通过 Internet 连接到 couchbase 服务器,很可能会遇到超时问题。它是为高性能而设计的,如果连接和执行操作需要很长时间,它们将超时。我建议在前面使用连接到 Couchbase 的 API,而不是直接从笔记本电脑/台式机连接到远程 ec2 机器。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多