I have a cluster of 4 nodes in a data center dc1 Rack1. Now I have to create data center dc2 into same cluster. Will I need to reconfigure whole cluster or is there any way?
2 Answers
Before adding new datacenter in production environment, the first step should be to prevent the client from connecting to the new datacenter and to ensure reads or writes does not query the new datacenter unless it is completely ready to serve since it may result into latency and timeout errors.
These are few point should follow while adding a new datacenter.
- Make sure to change QUORUM consistency level to LOCAL_QUORUM and ONE to LOCAL_ONE so your driver wont hit new data center until it is not ready to serve.
- you have to Alter Keyspaces to use network topology if not using (Do not mention new datacenter in Alter Keyspace command at this point).
- if using PropertyFileSnitch, cassandra-topology.properties file should be updated with new node's IPs on all the existing nodes.
After adding datacenter successfully. 1.alter Keyspace to set replication factor in new datacenter and mention the number of replica as well.
You need to make changes in existing cluster, but the full list of actions depends on how it's currently configured (replication of keyspaces, use of snitches, etc.). The whole procedure is described in great details on DataStax site.