Xinxing analyzes master-slave replication in Redis, and Xinxing analyzes master-slave redis

Source: Internet
Author: User

Xinxing analyzes master-slave replication in Redis, and Xinxing analyzes master-slave redis

First, let's briefly introduce the replication in Redis:

(1) the same master can synchronize multiple slave instances.

(2) Server Load balancer can also accept connections and synchronization requests from other Server Load balancer instances. This effectively shares the synchronization pressure on the master node.

(3) The master server provides services for slaves in a non-blocking manner. Therefore, during master-slave synchronization, the client can still submit query or modify requests.

(4) The slave server also completes Data Synchronization in a non-blocking manner. During synchronization, if a client submits a query request, Redis returns the data before synchronization.

(5) In order to share the read operation pressure on the master, the slave server can provide the read-only operation service for the client, and the write service must still be completed by the master.

(6) The master can save the data to slaves, thus avoiding the need for an independent process in the master to complete this operation.


How replication works:

After slave is started and connected to the master, it will send a SYNC command. After that, the master will start the background storage process and collect all commands received for modifying the dataset. After the background process is executed, the master will transmit the entire database file to the slave, to complete a full synchronization. The slave server saves the database files and loads them into the memory. After that, the master continues to send all the collected modification commands and new modification commands to slaves in sequence, and slaves will execute these data modification commands this time to achieve the final data synchronization. If the connection between the Server Load balancer instance and the master instance is disconnected, the Server Load balancer instance can automatically retrain the master instance. However, after the connection is successful, a full synchronization task is automatically executed.


Replication Configuration:

Remove the # In the # slaveof <masterip> <masterport> in the configuration file and modify it to the corresponding information.






















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.