2.2-redis Master-Slave configuration

Source: Internet
Author: User
Tags install redis

Redis installation Configuration Master-Slave # supports a master multi-slave, remember to close SELinux


Two servers: Master (192.168.31.105) and slave (192.168.31.112)

Install Redis and start with the steps described earlier

Master config file does not move

Add a row to the slave configuration file

Slaveof 192.168.31.105 6379

Masterauth Aminglinux//If the Lord sets a password, add this line

Start master and slave, respectively



Test Redis Master-Slave

On master:

Redis-cli

>set K1 v1

>get K1

"V1"


On slave:

Redis-cli

>get K1

"V1"



Redis Master-Slave Other related configurations

slave-read-only Yes //Let from read-only

repl-ping-slave-period //Set slave the frequency of pings to master, which is initiated every 10s. Detect survival

repl-timeout //Set slave ping does not pass the master number of S after the timeout

Repl-disable-tcp-nodelay No//open tcp_nodelay, will use less bandwidth, but there will be delay, so it is recommended to close

Repl-backlog-size 1MB//sync Queue Length, Backuplog is a buffer of master, master will write the data to the buffer, slave will synchronize the data from the buffer after the master disconnects.

Repl-backlog-ttl 3600//Master disconnect, buffer expiration, default 1 hours

slave-priority //Multiple Slave can be set priority, the lower the value of the higher priority, applied to the cluster, support slave switch to master, the highest priority will switch

Min-slaves-to-write 3//and used in conjunction with the following, it means that master found that there are more than 3 slave latency higher than 10s, then master will temporarily stop the write operation. If either of these values is 0, the function is turned off, and the default first value is 0.

Min-slaves-max-lag 10


2.2-redis Master-Slave configuration

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.