Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataStax Devcenter fails to connect to the remote cassandra database

Tags:

cassandra

OS: CentOS 6.4 (server)

I have successfully installed (yum install dsc20) the cassandra database layer in my server and can connect to it using the CQL SHel (cqlsh). But I need to run queries remotely using the DataStax's DevCenter software. So I installed it (DevCenter) in a separate workstation. (CentOS 6.4 - desktop) and tried to add a new connection in order to connect to the cassandra db.

So I gave the IP of the "CentOS 6.4 - server" (in which cassandra database is running) for the host and the port as 9160. But when testing the connection it fails.

I also tried to turn off the firewall in the server, (/etc/init.d/iptables stop). But was no luck.

I'm sure this may be due to some misconfiguration which I cannot figure out. I'll be grateful, if someone can give me a solution for this as I was researching for this and found no answers. Thank you very much in advance.

like image 752
Tharanga Avatar asked Dec 13 '13 20:12

Tharanga


1 Answers

DataStax DevCenter being built on top of the DataStax Java driver has the same connectivity requirements as the driver. Namely:

  1. start_native_transport: true
  2. rpc_address: IP or hostname reachable from the client
  3. Machines in the cluster accept connections on port 9042 (the native_transport_port config option)

If rpc_address is set to either a private IP or to 0.0.0.0, DevCenter will not know what node to connect to.

If your cluster has multiple nodes and these are using rpc_address: 0.0.0.0, even if you configure DevCenter with the IP(s) of a couple of nodes, it will still have issues discovering the other nodes in the cluster.

In cassandra.yaml there's a comment/warning about using rpc_address: 0.0.0.0:

Note that unlike ListenAddress above, it is allowed to specify 0.0.0.0 here if you want to listen on all interfaces, but that will break clients that rely on node auto-discovery.

Note: it is possible that in the future DevCenter might be able to ignore/filter out nodes in the cluster configured with rpc_address: 0.0.0.0.

like image 183
Alex Popescu Avatar answered Sep 21 '22 10:09

Alex Popescu