How to add or remove nodes in a Redis cluster?

Add node:

  1. Install Redis on the new node and ensure that all nodes are using the same configuration file.
  2. Group meeting with the new node at IP address and port number .
  3. Make a copy of the cluster with the specified master node ID.
  4. Rebalance the cluster to allow new nodes to participate in data sharding. This can be done by running the CLUSTER REBALANCE command or by automatically balancing by sending data to existing nodes.

Remove node.

  1. Forget the cluster node with the specified ID.
  2. If the node to be deleted is a master node, it needs to be removed from the master node list and also removed from the slave node list.
  3. If the number of nodes in the cluster is less than required, manual re-balancing of the cluster is necessary to ensure data is evenly distributed across existing nodes.
bannerAds