1
votes

I am trying to set up a two-node Cassandra cluster on two EC2 machines in the same region & security group. Each machine has one cassandra instance running. I have chaned the cassandra.yaml file to add both of these to the same cluster. But I am not able to do so. These are the changed configuration options in the cassandra.yaml file I have made. Both the machines belong to us-east DC. (I am able to ping each other as well, just FYI). I am using Apache Cassandra version 1.1.6.

EC2 Machine1: listen_address - private ip of this machine. rpc_address - 0.0.0.0 seeds - private ip of the EC2 machine1. endpoint_snitch - Ec2Snitch (I have also tried with SimpleSnitch & Ec2MultiRegionSnitch) initial_token - first token generated by token-generator tool for two nodes. I did a nodetool move to this token for this cassandra instance.

EC2 Machine2: listen_address - private ip of this machine rpc_address - 0.0.0.0 seeds - private ip of the EC2 machine1 endpoint_snitch - Ec2Snitch (I have also tried with SimpleSnitch & Ec2MultiRegionSnitch) initial_token - second token generated by token-generator tool for two nodes. I did a nodetool move to this token for this cassandra instance.

These settings should automatically add both the cassandra instances to the same ring when restart the instances. But when I run nodetool -h localhost ring command, both the machines are running in their own cluster, not in the same.

Is there anything that I am missing in the configuration here?

1
Had you open the firewall between the 2 machines for Cassandra communication ? - jfg956
Yes I have opened the firewall. They belong to the same security group. - user582348
Is the cluster name same in both the yaml files? - Tamil
Yes, the cluster name is same as well. the default 'Test Cluster'. - user582348
Having both instances under the same security group is not enough - AWS policy is to deny group members internal communication unless implicitly specified. Make sure this SG allows incoming connections to the Casandra ports originating from that SG. - Froyke

1 Answers

1
votes

I have many time created a cassandra cluster on EC2.And from your configuration setting I would suggest to change listen_address and rpc_address to the private ip of particular machines.