Installing Cassandra 2.0.7 Cluster on Red Hat 6.4

Aug - 01 2014 | By

cassandra-header

Download Files

Download and uncompress the Cassandra files to your a folder of your choice

Setting up a Cluster

On Master Node Open conf/cassandra.yaml

  • cluster_name: “MyCluster” (used to identify this cluster)
  • seeds: “192.168.1.1″
  • rpc_address: 192.168.1.1
  • listen_address:192.168.1.1
  • auto_snapshot: false (so we don’t take a snapshot before we do a commands like truncate which can timeout requests)

On Each Slave (optional) Open cassandra.yaml

  • cluster_name: “MyCluster”      (Must match master cluster name)
  • seeds: “192.168.1.1″               (IP address of master)
  • rpc_address: 192.168.1.2        (IP address of this slave)
  • listen_address: 192.168.1.2     (IP address of this slave)
  • auto_snapshot: false

NOTE: you may have to delete /user/var/lib/cassandra on each machien for the cluster name to take effect NOTE: Cluster names have to match! otherwise you’ll get “unable to gossip with any seeds”

 


 

Start Cassandra

open a terminal window and “cd” to the installed folder and run

  • bin/cassandra

Stop Cassandra

kill `ps axu | grep CassandraDaemon | awk ‘{print $2}’`


 

Test Connection

CQLSH_HOST=192.168.1.1 bin/cqlsh


 

To find out which node of the cluster your inserted data was partitioned too.

nodetool -h 127.0.0.1 -p 7199 getendpoints DB Table Partition Key Eg : nodetool -h 127.0.0.1 -p 7199 getendpoints wfm_rta employee_status “333″:”49999″   will return the IP address of that cluster node


 

Removing and re-adding a Dead node in a Cluster

On one of the active nodes run this…

nodetool status

 

cassandra node down

 

We see that the node is down now run

nodetool -h *.*.*.170 removenode c1df4653-884d-4dc5-b029-b9b8951b0eec

This make take some time

On the dead node machine you can now start Cassandra service You’ll now see this..

 

cassandra node rejoining

 

then after a few min you’ll see this

 

cassandra node joined

Comments are closed. Please see front page on how to contact me