Changing keyspace replication strategy in Datastax Cassandra ( Part 5 )

                                                             
                                                                   

In production environment, network aware topology must be set. Default SimpleStrategy
will not work if you want to add rack and datacenter in to an existing cluster. In production environment use NetworkTopologyStrategy. Before changing topology we must make sure inter node communication is network aware for that change the Snitch properties.



Step 1) Change the snitch.

            cat /etc/dse/cassandra/cassandra.yaml | grep endpoint_snitch:

            endpoint_snitch: GossipingPropertyFileSnitch



Step 2) After changing snitch, specify the datacenter and rack information in 

             properties file.
  
            cat /etc/dse/cassandra/cassandra-rackdc.properties |grep -E 'dc=|rack='
    
            dc=SearchGraph
            rack=rack1

Step 3) Any change in cassandra.yaml file require node restart. Restart each node  one by one.
        
             service dse restart

Step 4) Changed keyspace topology.

             ALTER KEYSPACE tech_app1 WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'SearchGraph' : 2};

            ALTER KEYSPACE tech_app2 WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'SearchGraph' : 2};

             ALTER KEYSPACE tech_chat WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'SearchGraph' : 2};


Step 5) Run a sequential repair and nodetool cleanup on each node.

             nodetool repair
             nodetool cleanup                      

Comments

Popular posts from this blog

Datastax Error : Cannot start node if snitch's data center (dc1) differs from previous data center (dc2)

Datastax Error : Cassandra - Saved cluster name Test Cluster != configured name

Configure Nagios plugin " check_logfiles " for scanning log file

Popular posts from this blog

Datastax Error : Cannot start node if snitch's data center (dc1) differs from previous data center (dc2)

Datastax Error : Cassandra - Saved cluster name Test Cluster != configured name

Configure Nagios plugin " check_logfiles " for scanning log file