Easy to implement redis master-slave configuration, chain, one master, multiple slave

Source: Internet
Author: User
Easy Implementation of redis master-slave configuration, chain, a master-slave multi-slave Nima is boring, a windows also to play master-slave, despise !!! Let's not talk about it much. Tom takes the initiative to search for Redis... Haha... The default configuration of the master, from: the original copy of the master 1, change the default port 6379 to 6380 # Acceptconnectionsonthespecif

Easy Implementation of redis master-slave configuration, chain, a master-slave multi-slave Nima is boring, a windows also to play master-slave, despise !!! Let's not talk about it much. Tom takes the initiative to search for Redis... Haha... The default configuration of the master, from: the original copy of the master 1, change the default port 6379 to 6380 # Accept connections on the specif

Easy to implement redis master-slave configuration, chain, one master, multiple slave

How boring Nima is. If I had a windows system, I still went to play master-slave games. despise it !!!

Let's not talk about it much. Tom takes the initiative to search for Redis... Haha...

The default configuration of the master,

SLAVE: original copy of the master

1. Change the default port 6379 to 6380.

# Accept connections on the specified port, default is 6379

Port 6380

2, # slaveof

Slaveof localhost 6379

The above is not enough. Please try it in Linux.

The first step is to configure three instances, slave1 and slave2, which are both original and intact copies of the master.

The configuration is master: port 6379.

Slave1

Port 6380

Slaveof localhost 6379

Slave2

Port 6381

Slaveof localhost 6380

The relationships are as follows: master <---- slave1 <---- slave2 (now it is chained)

Finally, let's take a look at the synchronization. The first is the master: set master slave. We found that the other two slaves can get the master.

However, when slave1 executes set slave master, get slave on the master returns-1 while slave2 returns master

But I can't hide a master, multiple slaves.

The master node is two slave nodes: slave1 slave2

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.