Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Master-slave synchronization method and device, master server and storage medium

A master server and server technology, applied in the direction of instruments, special data processing applications, electrical digital data processing, etc., can solve the problems of low master-slave synchronization efficiency and achieve the effect of improving synchronization efficiency

Active Publication Date: 2018-06-22
WUBA
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] During the master-slave synchronization process of the existing Redis database server, after the master-slave server is disconnected, the slave server needs to re-copy all the data on the master server, resulting in a disconnection Post-wire master-slave synchronization is inefficient

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Master-slave synchronization method and device, master server and storage medium
  • Master-slave synchronization method and device, master server and storage medium
  • Master-slave synchronization method and device, master server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0043] Such as figure 1 As shown, the embodiment of the present invention provides a master-slave synchronization method, which is executed in the master server, such as figure 1 As shown, the method includes:

[0044] S101: Determine the ratio of the storage capacity occupied by the incremental file to the storage capacity occupied by the main database backup file;

[0045] S102: When the determined ratio meets a preset copy condition, make the slave server copy the incremental file in a preset copy buffer area according to the maximum displacement of the slave server.

[0046] The embodiment of the present invention first determines the ratio of the storage capacity occupied by the incremental file to the storage capacity occupied by the main database backup file, and then determines the relationship between the determined ratio and the preset copy condition, and only when the determined ratio meets the preset copy condition, Make the slave server copy the incremental file in the p...

Embodiment 2

[0055] The embodiment of the present invention provides a master-slave synchronization method. Specifically, the embodiment of the present invention provides a method for selecting incremental replication and full replication. In the embodiment of the present invention, the method first determines whether the maximum displacement of the slave server is in the Copy the buffer area, if it is not, then perform full copy, if it is, then further select incremental copy and full copy.

[0056] In the embodiment of the present invention, incremental copy means copy from the copy buffer area, and full copy means copy of the backup file of the main database.

[0057] The embodiment of the present invention improves S101 of the first embodiment, that is, the ratio of the storage capacity occupied by the incremental file to the storage capacity occupied by the main database backup file may include:

[0058] Receiving the synchronization request from the slave server;

[0059] If it is determined...

Embodiment 3

[0071] The embodiment of the present invention provides a master-slave synchronization method. Specifically, on the basis of Embodiment 1, the embodiment of the present invention provides a method for determining the storage capacity of an incremental file, that is, the determined incremental file Before the ratio of the occupied storage capacity to the storage capacity occupied by the main database backup file, it can include:

[0072] The storage capacity of the incremental file is determined according to the writing rate and the writing time of the incremental file written to the copy buffer area.

[0073] For example, multiply the write rate and the write time to obtain the storage capacity of the incremental file.

[0074] In the embodiment of the present invention, the storage capacity of the incremental file is determined by the write rate and the write time, and the determination method is quick and efficient, which further improves the efficiency of master-slave synchronizat...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a master-slave synchronization method and device, a master server and a storage medium. The method comprises the steps that the specific value of storage capacity occupied by an incremental file to storage capacity occupied by a master database backup file is determined; and when the determined specific value meets a preset duplication condition, a slave server is made to duplicate the incremental file in a preset duplication cache region according to maximum displacement of the slave server. Through the master-slave synchronization method and device, the master serverand the storage medium, on the premise of guaranteeing data consistency, master-slave synchronization efficiency is effectively improved, and highly-available time of service is prolonged.

Description

Technical field [0001] The present invention relates to the field of data synchronization, in particular to a master-slave synchronization method, device, master server and storage medium. Background technique [0002] Taking a device as a reference object, the process of copying the data of the reference object to other devices at regular intervals is called master-slave synchronization. For example, in the master-slave synchronization of the server, the replicated server is the master, and the server that replicates the master is called the slave. [0003] In the master-slave synchronization process of the existing Redis database server, after the master-slave server is disconnected, the slave server needs to re-copy all the data on the master server, resulting in low efficiency of master-slave synchronization after the disconnection. Summary of the invention [0004] In order to overcome the above-mentioned drawbacks, the technical problem to be solved by the present invention i...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/275
Inventor 李跃红
Owner WUBA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products