Redis Cluster Advanced-Add new node to cluster

Source: Internet
Author: User
Tags redis cluster
Using clusters

The main record is the operation of learning Jedis. third, add new nodes to the cluster

Depending on the newly added node type, there are 2 ways to add new nodes to the cluster.

1: If you add a new node that is a master, then we need to create an empty node and then move some hash buckets to this empty node.

2: To add the new node is slave, then we will set the new node as a replica of a node in the cluster.

Add master node Master

Create a new port6305 node (using the same configuration file as before) and start.

executes the command ./REDIS-TRIB.RB add-node 127.0.0.1:6305 127.0.0.1:6300, add the new node to the cluster.

The first parameter is the address of the new node, and the second parameter is the IP and port of any node that already exists.

We can see that the new node has been added to the cluster: cluster nodes

6305 has been added as master, but the 1> new node does not contain any data because he does not contain any hash slots. 2> when a cluster needs to upgrade a node to a new master node, the node is not selected because there is no hash slot.

Next, as soon as you move some of the hash buckets in the cluster to the new node, the new node becomes the real master.

to add a slave from a node (a replica of a master node)

Create a new empty node and start the connection

Execute command cluster replicate (ID of any one master)


Reprinted from Http://redis.readthedocs.org/en/latest/topic/cluster-tutorial.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.