Reputation: 146
I followed Datastax instruction to set a cluster on EC2 http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMILaunch.html all is working fine and cluster is created.
My question is how? How does the instances know each other IP? Initially I assumed it is read from meta-data, but I did not find the info there.
Upvotes: 3
Views: 669
Reputation: 341
Basically, you have opened some tcp ports for their connection. 7000 port is used for internal node communication. And 9042 is used for CQL native transport.
So you can check these ports in your command line. They all should be opened.
Upvotes: 0
Reputation: 13709
Cassandra uses "seed nodes" to propagate node topology information to the whole cluster, including addresses of all the nodes. According to the DataStax documentation, AMI sets all the seed nodes. I would expect that AMI modifies each node's cassandra.yaml file to configure those seed nodes.
Edit:
It finds the seed nodes because you configure them in the cassandra.yaml file on each node when you create your cluster, or AMI does it on your behalf. As each node comes up, it looks in its cassandra.yaml for the list of seed nodes, contacts them, and they provide the list of all the nodes they know about. In other words, all the nodes that have contacted them. As new nodes join, there presence is propagated through the cluster, and the seed nodes keep the master list.
Upvotes: 1
Reputation: 146
I believe I have an answer: Reflector, a centralize datastax service getting requests from each server and group by reservation id. After some time, each can query and get the IP of the other members.
"The reflector is used to keep track of which IPs are in the cluster of DSE/C that is being initiated. The reflector receives the internal IP address, the public dns, the reservation id, and the clustername to keep track of the clusters' seeds. This data is saved to a SQLite database. If another request to the php file is sent after 5 minutes of inactivity, the database is cleared and started fresh to keep the list of IPs as fresh as possible to avoid conflicts and keep your privacy."
The call to the reflector is in https://github.com/riptano/ComboAMI/blob/2.5/ds2_configure.py#L445
Upvotes: 1