Saturday, December 8, 2018

Adding DataCenter to Cassandra.

These steps guide you through Adding Datacenter in Cassandra.

Step 1: Know how the application is writing/Reading. In the sense if it is quorum set to local_quorum or each_quorum - Datastax Drive - Set to DCAwareRoundRobinPolicy

Step 2: If cassandra is started on new nodes, stop it and remove the data, log, saved_cache, commit log files.

Step 3: Major cassandra.yaml changes
 - auto_bootstrap: false
 - -seeds
 - endpoint snitch
 - listen address
 - rpc address
 - num tokens

Step 4: Update the relevant propert file snitch
 - cassandra rackdc properties file

Step 5: Start now cassandra

Step 6: After all nodes start in the Datacenter
 - set replication factor of keyspace to dc name and number of replicas needed
 - run nodetool rebuild specifying the existing datacenter on all nodes in the new datacenter
 - Change to true or remove auto_bootstrap: false in the cassandra.yaml file.

Step 7: We need to update seed node on all nodes in the cluster and do a restart.

Step 8: nohup nodetool rebuild -dc abc-dc1 -ks keyspace_name table_name >> /tmp/$(date +%Y-%m-%d)_`hostname -i`rebuild.log 2>&1 &

***

No comments:

Post a Comment