Whether in the cluster or in the master-slave structure, the Redis new node and the existing master (slave) node of the message synchronization is through the form of Sync command to practice the Redis synchronization mechanism, the new master server from the server master-slave: This is the normal master-slave structure, We use the Telnet tool to simulate the main library from the database, and then look at its interaction with the main library, the main library responds to the main library to indicate the port number replconf listening-port 6381+ok send Snyc command at this time the main library response, It considers itself to have built a library from which the received content will be written to the hard disk, and any commands from the main library will be synchronized to the slave library after the initialization of the RDB snapshot is completed, for example, we execute set AA1 AA2 simulation from the library immediately received Redis adopted an optimistic copy of the strategy, that is, tolerance of master-slave differences exist, we can set Min-slaves-to-write 3 Min-slaves-to-max-lag 10来 Set the minimum number of received from the database and master-slave connection heartbeat time
Principles of Redis Replication