Setting up a Cassandra cluster is very simple to do. Simply install the software, make a few configuration changes, and startup the service. In the example below, we will show how to create a very small development cluster using only (3) servers.

Each node must be correctly configured before starting the cluster.

1) Install Cassandra on each node.
2) Choose a name for the cluster.
3) Get the IP address of each node.
4) Determine which nodes will be seed nodes. Do not make all nodes seed nodes.
5) Determine the snitch and replication strategy. The GossipingPropertyFileSnitch and NetworkTopologyStrategy are recommended for production environments.

Software Install:

# apt-get install software-properties-common
# add-apt-repository ppa:webupd8team/java
# sudo apt-get update
# sudo apt-get install oracle-java7-installer
# java –version
# echo “deb stable main” | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
# apt-get install curl
# curl -L | sudo apt-key add –
# sudo apt-get update
# sudo apt-get install dsc20=2.0.14-1 cassandra=2.0.14

Because the Debian packages start the Cassandra service automatically, you must stop the server and clear the data:
Doing this removes the default cluster_name (Test Cluster) from the system table. All nodes must use the same cluster name.

# sudo service cassandra stop
# sudo rm -rf /var/lib/cassandra/data/system/*

Setting up a Cluster:

# vi /etc/cassandra/cassandra.yaml

cluster_name: ‘CassandraPOC1’
– seeds: “,”
endpoint_snitch: GossipingPropertyFileSnitch

Possible Changes to:

If you plan on separating your nodes by data center or rack you will need to make the following changes below.

# vi /etc/cassandra/

# indicate the rack and dc for this node

Start Cassandra:

# sudo service cassandra start &

To check that the ring is up and running, run:

$ nodetool status

Leave a Reply

Your email address will not be published. Required fields are marked *