Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Cassandra to localhost using cqlsh?

Tags:

I set rpc_port to the public IP address, and now I can connect to Cassandra just fine from an outside server.

However, I cannot connect from the Cassandra server itself, using cqlsh

I am getting an error.Thar are:

 Connection error: Could not connect to localhost:9160 

Is there a configuration, I can change to be able to connect from the server itself ?

like image 600
Albert Lim Avatar asked Jun 01 '14 03:06

Albert Lim


People also ask

What protocol Cqlsh uses to connect to a Cassandra node?

cqlsh is implemented with the Python native protocol driver, and connects to the single specified node.


2 Answers

  1. Check the cassandra.yaml file on the line with rpc_port : normally by default = 9160
  2. Login to the machine hosting cassandra
  3. Try cqlsh 127.0.0.1 9160 : should be ok in any case
  4. try cqlsh [IP of host] 9160 : if ok then cassandra reachable from lan, if ok then cassandra is not reachable from lan but only localhost 127.0.0.1
like image 119
LeGeekDOzoZoo Avatar answered Sep 30 '22 21:09

LeGeekDOzoZoo


You need to connect to cassandra through the rpc_address defined in cassandra.yaml. For example, I use cqlsh 10.0.80.49 9160.

like image 21
Daniel Compton Avatar answered Sep 30 '22 20:09

Daniel Compton