Can't connect to cassandra node from different host

Probably the remote Cassandra node is not bound to the external network interface but to the loopback one (this is the default configuration). 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.0.0" (not all versions of Cassandra support wildcard addresses).

Check also that the firewall is properly configured or disabled (sudo service iptables stop).


Set the config parameter where this file is located. Possibly /etc/cassandra/cassandra.yaml.

cassandra.yaml

listen_address: 192.x.x.x
rpc_address: 192.x.x.x

Then, restart the service.


1.Update:./conf/cassandra.yaml

rpc_address: 0.0.0.0 ("0.0.0.0" allow anywhere IP,but you can appoint an IP)

\# broadcast_rpc_address: 1.2.3.4 (Delete comment if rpc_address=0.0.0.0)

2.restart

./bin/cassandra

Case: I met a problem that I can't remote access cassandra When I using java access cassandra