Redis Master/Slave settings and precautions

Source: Internet
Author: User

The master-slave setting of reids is easy to complete in just one sentence. Add it in the slave configuration file redis. conf.

Slaveof 192.168.252.20.5371

192.168.252.20.host IP 5371 is the host port

Start the host and then start the slave. To improve performance, you can set persistence settings for the host instead of for the slave.

If you need a password: Set requirepass 123456 123456 as the password on the host.

Set masterauth 123456 123456 as the password on the slave

Note that when the host goes down, do not start the host instance first. Otherwise, the slave data will be cleared !!!!, Remember.

1: persistence is not enabled in the redis Master/Slave environment;
When the master instance goes down, data from the instance is not affected;
After the master instance recovers, the data on the master instance will continue to be synchronized to the slave instance, that is, the original value will change to NULL;


2: Enable snapshot persistence from the instance in redis master-slave Environment
When the master instance goes down, data from the instance is not affected;
After the master instance recovers, the data on the master instance will continue to be synchronized to the slave instance, that is, the original value will change to NULL;


3: What happens when the master and slave instances are down?

Disable the slave instance and then the master instance! Start the slave instance, test data, and then start the master instance, and then test data!

Practice has proved that, under the condition of redis master-slave read/write splitting, snapshot persistence can only be enabled on the master instance side to ensure that data can be restarted across instances!

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.