我创建了一个带有 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
现在的问题是如何