Dinesh Kumar
Dinesh Kumar

Reputation: 151

How to migrate single datacenter cluster to multiple datacenter cluster in cassandra>

Provide recommended configuration to migrate the data from the single data center cassandra cluster to multiple data center cassandra cluster. Currenlty i have the single data center cluster environment with following configurations, i) No of nodes: 3 ii) Replication Factor : 2 iii) Strategy: SimpleStrategy iv) endpoint_snitch: SimpleSnitch

And now i am planning to add 2 more nodes which is in different location. So i thought of moving to Multiple data center cluster with following confiruations. i) No of nodes: 5 ii) RF: dc1=2, dc2=2 iii) Strategy: NetworkTopolofyStrategy iv). endpoint_snitch: PropertyFileSnitch (I have the cassandra.topolofy.properties file)

What is the procedure to migrate the data without losing any data?

Please let me know the recommended steps to follow or any guide which i can refer. Please let me know if further info is required.

Upvotes: 1

Views: 1984

Answers (2)

arjones
arjones

Reputation: 460

I just found this excellent tutorial on migrating Cassandra: Cassandra Migration To EC2 by highscalability.com

Although the details will be found at the original article, an outline of the main steps are:

1. Cassandra Multi DC Support

  1. Configure the PropertyFileSnitch
  2. Update the replication strategy
  3. Update the client connection setting

2. Setup Cassandra On EC2

  1. Start the nodes
  2. Stop the EC2 nodes and cleanup
  3. Start the nodes
  4. Place data replicas in the cluster on EC2

3. Decommission The Old DC And Cleanup

  1. Decommission the seed node(s)
  2. Update your client settings
  3. Decommission the old data center

Upvotes: -1

Roman Tumaykin
Roman Tumaykin

Reputation: 1931

  1. Complete repairs on all nodes.
  2. Take snapshot on all nodes to have a fall back point.
  3. Decommission each node that is not a pure Cassandra workload. Repair the ring each time you decommission a node.
  4. Update keyspaces with NetworkTopologyStrategy and replication factor to match the original RF

    ALTER KEYSPACE keyspace_name WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter_name' : 2 };

  5. Change snitch on each node with restart.

  6. Add nodes in a different datacenter. Make sure that when you add them you have auto_bootstrap: false in the cassandra.yaml

  7. Run nodetool rebuild original_dc_name on each new node.

Upvotes: 2

Related Questions