Search code examples
cassandracqlubuntu-server

Can't connect to Cassandra remote host using cqlsh


I have cassandra running on single node in Ubuntu Server 14.04 (with IP 10.3.2.92 and I am connected via VPN to the same network of the server). The following parameters in the file cassandra.yaml were changed:

listen_address: 10.3.2.92
rpc_address: 10.3.2.92
- seeds: "10.3.2.92"

rpc_port: 9160 and native_transport_port: 9042, so they are set to default. 

When I do in OSX in my machine:

./cqlsh 10.3.2.92 9160

I get the following error:

Connection error: ('Unable to connect to any servers', {'10.3.2.92': error(None, "Tried connecting to [('10.3.2.92', 9042)]. Last error: timed out")})

I have already tried nodetool enablethrift on server after started cassandra doing sudo service dse start, but without success. I tried at port 9042 too.

What am I doing wrong ?

Thanks in advance

EDIT :

Changed the native_transport_port to 8080 and it works. My private network admins blocked 9xxx ports.


Solution

  • Basically cqlsh knows how to talk with a node by using 9042 only. If you are interested in 9160 you should use the cassandra-cli but this tool has been deprecated.

    Anyway, since you tried 9042 I think you have some other networking issue. Just to make sure can you try if you are managing to pull off telnet 10.3.2.92 9042 if this doesn't work, check firewall settings on the node.