当前位置:网站首页>Redis configuration (III) -- master-slave replication
Redis configuration (III) -- master-slave replication
2022-06-12 06:19:00 【leo_ messi94】
Redis Master slave copy
What is it? ?
Master slave copy : After the host data is updated, according to the configuration and Policy , Automatic synchronization to the standby machine master/slaver Mechanism ,Master Write first ,Slave Mainly reading
use :
- Read / write separation , Performance expansion
- Rapid disaster recovery

Configure temporary slave server :

step :
- Set up three conf file , Port number 、 The file names are different


- Start with these profiles redis

- View server status info replication, You can see that each server is the primary server

- Set up a slave server called a server :slaveof ip port
Set up 6380 and 6381 by 6379 From the server
- see 6379:

Configure permanent master-slave servers
Configure in profile :
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. A few things to understand ASAP about Redis replication.
#
# 1) Redis replication is asynchronous, but you can configure a master to
# stop accepting writes if it appears to be not connected with at least
# a given number of slaves.
# 2) Redis slaves are able to perform a partial resynchronization with the
# master if the replication link is lost for a relatively small amount of
# time. You may want to configure the replication backlog size (see the next
# sections of this file) with a sensible value depending on your needs.
# 3) Replication is automatic and does not need user intervention. After a
# network partition slaves automatically try to reconnect to masters
# and resynchronize with them.
#
# slaveof <masterip> <masterport>
From the server, you can only read but not write

One master and two slaves :
- A slave server goes down , Then the master server performs a write operation , At this point, reconnect the slave server and set the slave server of the master server ; Does the slave server still have the value written by the master server during this period ?
answer : Yes , Whenever programming the slave server of the master server , Have all the data of the master server - Whether the slave can write ?
answer : Can not be - host shutdown What happens after ?
answer : The slave machine waits in place and waits for the host machine to work .
The principle of replication

It's passed down from generation to generation

- Set again 6381 The primary server of :slaveof 127.0.0.1 6380
- 6379 The state of : and 6381 No contact

- 6380 The state of : The Lord is 6379, There's another one 6381

- problem :
- If at this time 6379 It's down. ,6380 Still can not be promoted to the primary server , Need to carry out slaveof no one Set up , Set it to not follow any servers
- If 6380 It's down. , Then there is no master-slave relationship
Sentinel mode :

Configure sentinel mode

Activate the sentry :


Fault problem in sentinel mode :

Manual downtime 6379, View the sentinel server log :
selection 6380 For the new master server 

see 6380 Details :
Back online 6379, From the server

The problem is : Replication delay 
边栏推荐
- Unity3d script captures a sub area from the screen and saves it as texture2d, which is used to save pictures and maps
- LeetCode-剑指Offer(第二版)个人题解完整版
- Leetcode sword finger offer (Second Edition) complete version of personal questions
- dlib 人脸检测
- Redis queue
- Simple spiral ladder generation for Houdini program modeling
- Directx11 advanced tutorial PBR (1) summary of physical phenomena of light
- Understand Houdini's (heightfield) remap operation
- Image processing: image[:,:,:: -1], image[:,: -1,:], image[:,: -1,:]
- Houdini & UE4 programmed generation of mountains and multi vegetation scattering points
猜你喜欢
![How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]](/img/65/a214d137e230b1a1190feb03660f2c.jpg)
How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]

RMB classification II

Unity implements smooth interpolation

Performance optimization metrics and tools

Simulateur nightGod ADB View log

Summary of some problems in sensor bring up

SQLite cross compile dynamic library

Understand Houdini's (heightfield) remap operation

AI作业ch8

Redis queue
随机推荐
Leetcode-1535. Find the winner of the array game
Open the camera in unity3d and display the contents of the camera in the scene as texture2d
. Net core - pass Net core will Net to cross platform
English语法_副词_有无ly,意义不同
RMB classification II
EBook list page
Highlight detection with pairwise deep ranking for first person video summary (thesis translation)
Video summary with long short term memory
Simple spiral ladder generation for Houdini program modeling
Project progress on February 28, 2022
Video based fire smoke detection using robust AdaBoost
Introduction to the method of diligently searching for the alliance procedure
Leetcode 第 80 场双周赛题解
Unity3d script captures a sub area from the screen and saves it as texture2d, which is used to save pictures and maps
Houdini script vex learning
Bulk Rename Utility
Cv2.fillpoly coco annotator segment coordinate conversion to mask image
cv2.fillPoly coco annotator segment坐标转化为mask图像
(UE4 4.27) customize globalshader
Unity custom translucent surface material shader