How to scale and replace a node in cassandra

Adding a node and replacing a DOWN node, the steps are the same, but the startup parameters are different.

First: prepare a new machine, the configuration of cassandra uses the same configuration as a normal node in the cluster.

Second: Then you can start, add a node, as long as bin/cassandra is started.

If it is to replace a node (assuming that the ip of the DOWN node is 192.168.1.101), when starting, you can use bin/cassandra -Dcassandra.replace_address=192.168.1.101 to start (only the first time, and then directly bin/cassandra Just start it)

The third is to wait for the data migration. When you use nodetool status on other machines to see that the status of the new node becomes the UN status, it means that the migration is complete. You can also view the progress of the data migration on the new node with nodetool netstats.

Note: If your cluster has a large amount of data, this data migration process will bring a lot of load to the cluster. You need to do two things before starting a new node:

1. Turn off compression on all nodes.

nodetool disableautocompaction turn off automatic compaction

nodetool stop COMPACTION Stops an ongoing compaction.

When the new node is started, also execute nodetool disableautocompaction.

After the data migration is complete, let go nodetool enableautocompaction

2. Limit data migration traffic on all nodes

./nodetool setstreamthroughput 32

The limit is 32mbps Assuming your cluster has 10 machines, the traffic to your new node is about 32*10mbps.
You can gradually increase this value according to the progress of data migration and the number of completed nodes.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326831058&siteId=291194637