Question

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

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

Was it helpful?

Solution

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

OTHER TIPS

I was getting the same error and got this to work by using disable_node_auto_discovery!

You can see in the documentation for this method that it says "This is primarily helpful when the cassandra cluster is communicating internally on a different ip address than what you are using to connect. A prime example of this would be when using EC2 to host a cluster. Typically, the cluster would be communicating over the local ip addresses issued by Amazon, but any clients connecting from outside EC2 would need to use the public ip."

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top