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.



Prerequisites
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 http://debian.datastax.com/community stable main” | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
# apt-get install curl
# curl -L http://debian.datastax.com/debian/repo_key | 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: “10.10.10.63,10.10.10.64”
listen_address: 10.10.10.63
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/cassandra-rackdc.properties

# indicate the rack and dc for this node
dc=DC1
rack=RAC1

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 *