I've just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1.
Cassandra starts up fine and the cluster is operational instantly.
Cqlsh is not working (on any of the nodes) and emits the following error:
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
I have tried starting cqlsh up with the hosts own ip, other hosts ip, different ports yet the result remains the same - always connection refused.
cqlsh is implemented with the Python native protocol driver, and connects to the single specified node.
You can ensure this by using "telnet thecassandrahost 9042" from the remote machine, it should not work. In order to bind Cassandra to the external network interface you need to edit the cassandra. yaml configuration file and set the properties " listen_address " and " rpc_address " to your remote IP or "0.0.
You need to edit cassandra.yaml
on the node you are trying to connect to and set the node ip address for rpc_address
and listen_address
and restart Cassandra.
rpc_address
is the address on which Cassandra listens to the client calls.
listen_address
is the address on which Cassandra listens to the other Cassandra nodes.
Try to change the rpc_address
to point to the node's IP instead of 0.0.0.0 and specify the IP while connecting to the cqlsh, as if the IP is 10.0.1.34 and the rpc_port
left to the default value 9160 then the following should work:
cqlsh 10.0.1.34 9160
Or:
cqlsh 10.0.1.34
Also make sure that start_rpc is set to true in /etc/cassandra/cassandra.yaml configuration file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With