Cassandra unable to contact seeds if using AWS Elastic IP address... only works with private IP address

StackOverflow https://stackoverflow.com/questions/21261098

Question

I created 3 instances with 3 Elastic IP addresses pointing to these instances.

I did a yum install of dsc: dsc12.noarch 1.2.13-1 @datastax

And the /etc/cassandra/default.conf/cassandra.yaml has the: - seeds: [Elastic IP list]

But when I start cassandra via "service cassandra start" I see in /var/log/cassandra/cassandra.log: ... Exception encountered during startup: Unable to contact any seeds! ... And sure enough "nodetool status" shows: Failed to connect to '127.0.0.1:7199': Connection refused

BUT: If I change the value of the seeds to use the "private IP" of the instance, cassandra starts just fine. I would expect it work just fine with the Elastic IP's, but it doesn't.

Do you know why that is?

The reason I want the Elastic IP's to work is that I know the IP address ahead of time, so that when I provision a machine with Puppet, I can pre-populate the seeds in cassandra.yaml file. I don't know the private IP address until after the machine has booted :(

This is almost a duplicate of: Cassandra on Amazon EC2 with Elastic IP addresses

Was it helpful?

Solution

I believe your problem comes from the seed IP's not being the same as the node's Broadcast IP's . To change this modify the following line in each of your Cassandra.yamls

# Address to broadcast to other Cassandra nodes
# Leaving this blank will set it to the same value as listen_address
broadcast_address: <node's elastic ip> #uncomment this line
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top