Database Reference
In-Depth Information
Adding nodes to a cluster
Cassandra is one of the purest distributed systems, where the nodes are the same. Adding a
new node is just a matter of launching a Cassandra service with almost the same paramet-
ers as any other machine in the ring. In a cloud environment, such as AWS, it is a pretty
common practice to have a machine image of Cassandra that contains the blueprint of a
Cassandra node. Each time you have to add a node to the cluster, you launch the Amazon
Machine Image, tweak a couple of parameters that are specific to the node, and done. It is
as simple as that.
To add a new node to the cluster, you need to have a Cassandra setup that has the follow-
ing:
Set up the node's identity : Edit cassandra.yaml to set the following appro-
priately:
cluster_name : This is the same as the other nodes in the cluster, where
this node is joining in.
listen_address : Set it to the IP or the hostname, where other nodes
connect the Cassandra service on this node. Be warned that leaving this
field empty may not be a good idea. It will assume listen_address is
the same as the hostname, which may or may not be correct. In Amazon
EC2, it is usually just right.
broadcast_address : This may be needed to be set for a multi data
center Cassandra installation.
Seed node : Each node must know the seed node to be able to initialize the gossip
(refer to Chapter 2 , Cassandra Architecture , for the gossip protocol), learn about
the topology, and let other nodes know about itself.
Initial token : This is not needed for default/vnode enabled setup. If you use a
single token per node setup, this step matters. It is the data range this node is going
to be responsible for. One can just leave the initial token, and Cassandra will assign
the token by choosing the middle of a token range of the most loaded node. This is
the fastest way to make a lopsided cluster. The nodes should be well balanced.
Apart from these settings, for any customization in other nodes, cassandra.yaml
should also be incorporate into new nodes configuration.
Now that the node is ready, here are the steps to add new nodes:
Search WWH ::




Custom Search