连接到Cassandra的节点在EC2上的Ruby on Rails的一个datastax集群 [英] connecting to cassandra nodes on a datastax cluster on EC2 Ruby on Rails

查看:370
本文介绍了连接到Cassandra的节点在EC2上的Ruby on Rails的一个datastax集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了2卡桑德拉节点,2个搜索节点和2分析节点的datastax卡桑德拉企业集群。

I created a datastax cassandra Enterprise cluster with 2 cassandra nodes, 2 search nodes and 2 Analytics nodes.

一切似乎都正常除了工作,我无法从外部连接到它。如果我NODE0服务器上我可以运行卡桑德拉,CLI,并连接到Cassandra的节点上的端口9160,但是当我试图用的 datastax护栏的宝石,我得到没有Live服务器我也试过datastax devCenter它试图连接到本机端口9042,但也没有工作。我真的很纳闷,任何帮助是AP preciated。

Everything seems to work correctly EXCEPT, I can't connect to it from outside. If I'm on node0 server I can run the cassandra-cli and connect to the cassandra nodes on port 9160 but when I tried to connect using datastax-rails gem, I get "No live servers" I also tried datastax devCenter which tries to connect to the native port 9042 but also didn't work. I'm really puzzled, any help is appreciated.

所以,一些挖后,我发现了一些问题。

So after some digging I found some issues

   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

现在的问题是如何

The question now is how

推荐答案

听起来像是你需要打开你的EC2安全组外端口9160.具体的安全组,你的 NODE0 正在使用。

Sounds like you need to open up your EC2 security group to the outside on port 9160. Specifically the security group that your node0 is using.

您可以在这里找到更多关于他们的信息:

You can find more information about them here:

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

这篇关于连接到Cassandra的节点在EC2上的Ruby on Rails的一个datastax集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆