0

我创建了一个带有 2 个 cassandra 节点、2 个搜索节点和 2 个分析节点的 datastax cassandra Enterprise 集群。

一切似乎都正常工作,除了我无法从外部连接到它。如果我在 node0 服务器上,我可以运行 cassandra-cli 并连接到端口 9160 上的 cassandra 节点,但是当我尝试使用datastax-rails gem 连接时,我得到“没有实时服务器”我还尝试了 datastax devCenter,它试图连接到本机端口 9042 但也没有工作。我真的很困惑,任何帮助表示赞赏。

所以经过一番挖掘后,我发现了一些问题

   1. Port 9160 is connected and I can connect to it from telnet node0_ip 9160
   2. when I run rake ds:migrate, I get No live servers in node0_ip 
   3. I tried to connect to 'cassandra' gem instead from IRB and tried 
      a. client = Cassandra.new('example', 'node0_ip:9160')
      b. client.insert(:users, "5", {'screen_name' => "buttonscat4"})

     I got a similar error with ThriftClient::NoServersAvailable: No live servers but this time with all the IPs of all the nodes in the cluster

  4. I tried adding "client.disable_node_auto_discovery!" and I was able to connect and add stuff using 'cassandra' Gem. 

  5. I also found on https://github.com/cassandra-rb/cassandra/issues/171 that I need to  change your server to bind on a non-loopback address but have no idea what does that mean

现在的问题是如何

4

2 回答 2

1

听起来您需要在端口 9160 上向外部开放您的 EC2 安全组。特别是您node0正在使用的安全组。

您可以在此处找到有关它们的更多信息:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

于 2014-03-19T15:34:15.880 回答
0

我遇到了同样的错误,并通过使用 disable_node_auto_discovery 让它工作!

您可以在此方法的文档中看到它说“当 cassandra 集群在与您用于连接的 IP 地址不同的 IP 地址上进行内部通信时,这主要是有用的。一个典型的例子是使用 EC2 托管集群。通常,集群将通过 Amazon 发布的本地 IP 地址进行通信,但任何从 EC2 外部连接的客户端都需要使用公共 IP。”

http://rdoc.info/github/cassandra-rb/cassandra/master/Cassandra:disable_node_auto_discovery

于 2014-08-19T01:07:50.267 回答