I too faced the same issue where I had my Cassandra and application (Cassandra client) running on different machines.
AddHost: 10.10.1.141
AddHost: 127.0.0.1
RemoveHost: 10.10.1.141
When I checked my Cassandra ring status, I noticed that the Cassandra was running with the address 127.0.0.1
, instead of 10.10.1.141
root@10.10.1.141:/opt/dsc-cassandra$ **bin/nodetool ring**
Address Rack Status State Load Owns Token
127.0.0.1 rack1 Up Normal 169.87 KB 100.00% -9217929600007243236
127.0.0.1 rack1 Up Normal 169.87 KB 100.00% -9140762708880451456
127.0.0.1 rack1 Up Normal 169.87 KB 100.00% -8952943573583903866
127.0.0.1 rack1 Up Normal 169.87 KB 100.00% -8891950316930533160*
In conf/cassandra.yaml
, I had specified the hostname instead of IP address for listen_address
. The cassandra resoved the hostname to localhost (127.0.0.1
) instead of the actual IP (10.10.1.141
).
After changing the listen_address
to the actual IP, the client established connection successfully.
listen_address: 10.10.1.141