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?
Remote access to Cassandra is via its thrift port for Cassandra 2.0. In Cassandra 2.0. x, the default cqlsh listen port is 9160 which is defined in cassandra. yaml by the rpc_port parameter.
It's currently a key part of the Apache Software Foundation and can be used by anyone wanting to benefit from it. Cassandra stands out among database systems and offers some advantages over other systems.
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:
For anyone finding this question now, the top answer is out of date.
Apache Cassandra's thrift interface is deprecated and will be removed in Cassandra 4.0. The default client port is now 9042.
As noted by Tyler Hobbs, you will need to ensure that the rpc_address parameter is not set to 127.0.0.1 or localhost (it is localhost by default). If you set it to 0.0.0.0
to listen on all interfaces, you will also need to set broadcast_rpc_address to either the node's public or private IP address (depending on how you plan to connect to Cassandra)
Cassandra-cli is also deprecated and Apollo is no longer active. Use cqlsh in lieu of cassandra-cli and the Java driver in lieu of Apollo.
I do not recommend making the JMX port accessible remotely unless you secure it properly by enabling SSL and strong authentication.
Hope this is helpful.
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