0
votes

I've just started working with Cassandra (homebrew install), version 3.7 and cqlsh version 5.0.1. , OS X El Capitan

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(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error:
Connection refused")})
3
Did you double check that the port is correct? - Steffen Harbich
Check your nodetool status. The IP address you see is the one you should specify with the cqlsh command (it's probably not 127.0.0.1). - Aaron

3 Answers

0
votes

Edit cqlsh and change DEFAULT_HOST = IP and then run cqlsh.

0
votes

I think the first step you should be doing is running netstat -ntpl. This should list down all the ports active on the system. Check for Local Address there you shall find a IP prepended with 9042.

Use this IP to connect ie cqlsh IP . If you do not find the 9042 port in the netstat output than check your cassandra.yaml file. Grep for native_transport_port see if it is 9042 or something different.

If different than connect on that port via cqlsh.

0
votes

For future reference, if someone else gets it.

I'm running [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4].

Add start_native_transport: true field in cassandra.yaml file, by default it doesn't enables it and so no rpc communication with client.

Now try connecting with cqlsh rpc_endpoint(rpc addr set in cassandra.yaml).