Apache Cassandra remote access

user1588782 picture user1588782 · Sep 2, 2012 · Viewed 37k times · Source

I have installed Apache Cassandra on the remote Ubuntu server. How to allow remote access for an Apache Cassandra database? And how to make a connection?

Answer

CraigJPerry picture CraigJPerry · Sep 3, 2012

Remote access to Cassandra is via its thrift port (although note that the JMX port can be used to perform some limited operations).

The thrift port is defined in cassandra.yaml by the rpc_port parameter, which defaults to 9160. Your cassandra node should be bound to the IP address of your server's network card - it shouldn't be 127.0.0.1 or localhost which is the loopback interface's IP, binding to this will prevent direct remote access. You configure the bound address with the rpc_address parameter in cassandra.yaml. Setting this to 0.0.0.0 says "listen on all network interfaces" which may or may not be suitable for you.

To make a connection you can use:

  • The cassandra-cli in the cassandra distribution's bin directory provides simple get / set / list operations and depends on Java
  • The cqlsh shell which provides CQL access to cassandra, this depends on Python
  • A higher level interface such as Apollo