CN109684406A - Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room - Google Patents
Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room Download PDFInfo
- Publication number
- CN109684406A CN109684406A CN201811347403.8A CN201811347403A CN109684406A CN 109684406 A CN109684406 A CN 109684406A CN 201811347403 A CN201811347403 A CN 201811347403A CN 109684406 A CN109684406 A CN 109684406A
- Authority
- CN
- China
- Prior art keywords
- redis cluster
- value
- key
- main
- cluster
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The embodiment of the present disclosure provides method, apparatus, electronic equipment and the readable storage medium storing program for executing of a kind of redis cluster backup data across computer room, to realize the redis cluster backup data across computer room.The described method includes: carrying out double write operations to the main redis cluster for being distributed in different computer rooms and from redis cluster, double write operations include the write operation carried out to the main redis cluster, and for the write operation carried out from redis cluster after the write operation success carried out for the main redis cluster;Detect whether double write operations fail;In the case where double write operations failure, by the key value storage in the key-value value for being successfully written the main redis cluster to kafka queue, so that it is described from redis cluster according to the key value in the kafka queue, the key-value value for being successfully written the main redis cluster is backuped into local.
Description
Technical field
The embodiment of the present disclosure is related to field of computer technology more particularly to a kind of redis cluster backup data across computer room
Method, apparatus, electronic equipment and readable storage medium storing program for executing.
Background technique
The high availability of service refers to during the system external of multiple service nodes composition provides service, wherein one
When a service node breaks down, which will not interrupt the service of system external offer.
Currently, the relevant technologies provide the technical solution of the database back-up data across computer room, the feelings across computer room are improved
The high availability of database under condition.However, being directed to redis cluster, the relevant technologies provide only the redis cluster backup of same computer room
The technical solution of data, the technical solution are not particularly suited for the redis cluster across computer room.
Summary of the invention
The embodiment of the present disclosure provides the method, apparatus of redis cluster backup data across computer room a kind of, electronic equipment and can
Storage medium is read, to realize the redis cluster backup data across computer room.
Embodiment of the present disclosure first aspect provides a kind of method of redis cluster backup data across computer room, the side
Method includes:
Double write operations, double write operation packets are carried out to the main redis cluster for being distributed in different computer rooms and from redis cluster
The write operation carried out to the main redis cluster is included, and, in the write operation success carried out for the main redis cluster
Afterwards for the write operation carried out from redis cluster;
Detect whether double write operations fail;
In the case where double write operations failure, it will be successfully written in the key-value value of the main redis cluster
The storage of key value to kafka queue so that it is described from redis cluster according to the key value in the kafka queue, will successfully write
The key-value value for entering the main redis cluster backups to local.
In a kind of optional embodiment, detect whether double write operations succeed, comprising:
Whether detection fails for the write operation carried out from redis cluster, alternatively, detection for for it is described from
Redis cluster carry out write operation buffer queue whether expire, wherein double write operations fail the case where be for it is described from
Whether the write operation that redis cluster carries out fails, alternatively, for for the caching team for carrying out write operation from redis cluster
Column have been expired.
Embodiment of the present disclosure second aspect provides a kind of method of redis cluster backup data across computer room, is applied to
From redis cluster, it is described from redis cluster from main redis aggregated pattern in different computer rooms, which comprises
From the key value read in kafka queue in the key-value value for being successfully written the main redis cluster;
According to the key value, the key- for being successfully written the main redis cluster is read from the main redis cluster
Value value;
The key-value value for being successfully written the main redis cluster is backuped into local.
In a kind of optional embodiment, the key-value value for being successfully written the main redis cluster is backuped to this
Ground, comprising:
The key-value value of the main redis cluster will be successfully written compared with the key-value value being locally stored;
In the more new edition that the key-value value for being successfully written the main redis cluster is the key-value value being locally stored
In the case where this, the key-value value being locally stored, and the key-value value that the main redis cluster will be successfully written are deleted
It stores to local.
In a kind of optional embodiment, the method also includes:
Detect whether the main redis cluster breaks down;
In the case where the main redis cluster breaks down, by it is described from redis cluster configuration be new main redis
Cluster.
The embodiment of the present disclosure third aspect provides a kind of device of redis cluster backup data across computer room, the dress
It sets and includes:
Double write operation modules, for writing behaviour to the main redis cluster for being distributed in different computer rooms and from the progress of redis cluster is double
Make, double write operations include the write operation carried out to the main redis cluster, and, for the main redis cluster into
For the write operation carried out from redis cluster after capable write operation success;
Detection module, for detecting whether double write operations fail;
Memory module, for the main redis cluster will to be successfully written in the case where double write operations failure
Key value storage in key-value value to kafka queue so that it is described from redis cluster according in the kafka queue
Key value, the key-value value for being successfully written the main redis cluster is backuped into local.
In a kind of optional embodiment, the detection module includes:
Detection sub-module is directed to whether the write operation carried out from redis cluster fails for detecting, alternatively, detection
For whether having expired for the buffer queue for carrying out write operation from redis cluster, wherein the feelings of double write operation failures
Whether condition is to fail for the write operation carried out from redis cluster, alternatively, for carrying out for described from redis cluster
The buffer queue of write operation has been expired.
Embodiment of the present disclosure fourth aspect provides a kind of device of redis cluster backup data across computer room, is applied to
From redis cluster, it is described from redis cluster from main redis aggregated pattern in different computer rooms, described device includes:
First read module, for reading the key-value for being successfully written the main redis cluster from kafka queue
Key value in value;
Second read module, for being read from the main redis cluster and being successfully written the master according to the key value
The key-value value of redis cluster;
Backup module, for the key-value value for being successfully written the main redis cluster to be backuped to local.
The 5th aspect of the embodiment of the present disclosure provides a kind of computer readable storage medium, is stored thereon with computer program,
The step in the method as described in the application first aspect or second aspect is realized when the program is executed by processor.
The aspect of the embodiment of the present disclosure the 6th provides a kind of electronic equipment, including memory, processor and is stored in memory
Computer program that is upper and can running on a processor, the processor realize the application first aspect or second aspect when executing
The step of described method.
By adopting the above technical scheme, for the redis cluster across computer room, proposing will be had been written by kafka queue
The data of main redis cluster are from main redis cluster transmission to from redis cluster.In this way, it is double write failure in the case where, from
Redis cluster can read from main redis cluster according to the key value in kafka queue and have been written into main redis cluster
Key-value value, and backup to local.The redis cluster backup data across computer room are realized, the redis across computer room is improved
The availability of cluster.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention
Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings
Obtain other attached drawings.
Fig. 1 is the flow chart of the method for the redis cluster backup data across computer room that one embodiment of the application proposes;
Fig. 2 is the flow chart of the method for the redis cluster backup data across computer room that another embodiment of the application proposes;
Fig. 3 is the schematic diagram of the device for the redis cluster backup data across computer room that one embodiment of the application proposes;
Fig. 4 is the schematic diagram of the device for the redis cluster backup data across computer room that another embodiment of the application proposes;
Fig. 5 is the schematic diagram for the electronic equipment that one embodiment of the application provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
It is the stream of the method for the redis cluster backup data across computer room that one embodiment of the application proposes with reference to Fig. 1, Fig. 1
Cheng Tu.As shown in Figure 1, method includes the following steps:
Step S11: carrying out double write operations to the main redis cluster for being distributed in different computer rooms and from redis cluster, described double
Write operation includes the write operation carried out to the main redis cluster, and, behaviour is write what is carried out for the main redis cluster
For the write operation carried out from redis cluster after making successfully.
In the present embodiment, main redis cluster and from redis aggregated pattern in different computer rooms.When needing data cached,
Write operation is carried out to main redis cluster first, by the data buffer storage for needing to cache to main redis cluster, the i.e. main redis of synchronous write
Cluster, then will have been written into the data write-in of main redis cluster from redis cluster, i.e. asynchronous write is from redis cluster.
Step S12: whether detection double write operations fail.
In one embodiment, step S12 the following steps are included:
Whether detection fails for the write operation carried out from redis cluster, alternatively, detection for for it is described from
Redis cluster carry out write operation buffer queue whether expire, wherein double write operations fail the case where be for it is described from
Whether the write operation that redis cluster carries out fails, alternatively, for for the caching team for carrying out write operation from redis cluster
Column have been expired.
During the data that will have been written into main redis cluster are written from redis cluster, it is possible that write-in is lost
The case where losing, it is also possible to the full situation of buffer queue occur, determine double write operation failures in both cases.
Step S13: in the case where double write operations failure, the key- of the main redis cluster will be successfully written
Key value storage in value value to kafka queue so that it is described from redis cluster according to the key in the kafka queue
Value, backups to local for the key-value value for being successfully written the main redis cluster.
In the present embodiment, in order to realize the redis cluster backup data across computer room, kafka queue is used, is passed through
Kafka queue will have been written into the data of main redis cluster from main redis cluster transmission to from redis cluster.
Specifically, the key value in the key-value value for having been written into main redis cluster is stored to kafka queue, so
Afterwards from redis cluster when detecting kafka queue not is sky, the key value in kafka queue is read, and according to kafka queue
In key value, read from main redis cluster and have been written into the key-value value of main redis cluster, and backup to local.
By adopting the above technical scheme, for the redis cluster across computer room, proposing will be had been written by kafka queue
The data of main redis cluster are from main redis cluster transmission to from redis cluster.In this way, it is double write failure in the case where, from
Redis cluster can read from main redis cluster according to the key value in kafka queue and have been written into main redis cluster
Key-value value, and backup to local.The redis cluster backup data across computer room are realized, the redis across computer room is improved
The availability of cluster.
Another embodiment of the application provides a kind of method of redis cluster backup data across computer room, is applied to from redis
Cluster, from redis cluster from main redis aggregated pattern in different computer rooms.It is that another embodiment of the application proposes with reference to Fig. 2, Fig. 2
The redis cluster backup data across computer room method flow chart.As shown in Fig. 2, method includes the following steps:
Step S21: from the key read in kafka queue in the key-value value for being successfully written the main redis cluster
Value;
Step S22: it according to the key value, is read from the main redis cluster and is successfully written the main redis cluster
Key-value value;
Step S23: the key-value value for being successfully written the main redis cluster is backuped into local.
In the present embodiment, it from redis cluster when detecting kafka queue not is sky, reads in kafka queue
Key value, and according to the key value in kafka queue, the key- for having been written into main redis cluster is read from main redis cluster
Value value, and backup to local.
In one embodiment, step S23 includes:
The key-value value of the main redis cluster will be successfully written compared with the key-value value being locally stored;
In the more new edition that the key-value value for being successfully written the main redis cluster is the key-value value being locally stored
In the case where this, the key-value value being locally stored, and the key-value value that the main redis cluster will be successfully written are deleted
It stores to local.
In the present embodiment, from redis cluster from main redis cluster read have been written into main redis cluster
After key-value value, examines have been written into whether the version of the key-value value of main redis cluster is latest edition first,
It is i.e. whether newer than the version of the key-value value of local cache, if it is, deleting the key-value value being locally stored, and will
The key-value value for having been written into main redis cluster is stored to local;If it is not, then explanation nothing is backed up, thus abandon from master
That reads in redis cluster has been written into the key-value value of main redis cluster.
In one embodiment, the method also includes:
Detect whether the main redis cluster breaks down;
In the case where the main redis cluster breaks down, by it is described from redis cluster configuration be new main redis
Cluster.
In the present embodiment, after realizing the redis cluster backup data across computer room using the above method, from redis
The data cached in cluster and the data cached in main redis cluster are synchronous.If detecting that event occurs for main redis cluster
Barrier, then can be used as new main redis cluster from redis cluster and continue data buffer storage, improve the redis collection across computer room
The reliabilty and availability of group.
Based on the same inventive concept, one embodiment of the application provides a kind of dress of redis cluster backup data across computer room
It sets.It is the schematic diagram of the device for the redis cluster backup data across computer room that one embodiment of the application provides with reference to Fig. 3, Fig. 3.
As shown in figure 3, the device includes:
Double write operation modules 301, it is double for being carried out to the main redis cluster for being distributed in different computer rooms and from redis cluster
Write operation, double write operations include the write operation carried out to the main redis cluster, and, it is being directed to the main redis collection
For the write operation carried out from redis cluster after the write operation success that group carries out;
Detection module 302, for detecting whether double write operations fail;
Memory module 303, for the main redis cluster will to be successfully written in the case where double write operations failure
Key-value value in the storage of key value to kafka queue so that it is described from redis cluster according to the kafka queue
In key value, the key-value value for being successfully written the main redis cluster is backuped into local.
In a kind of optional embodiment, the detection module includes:
Detection sub-module is directed to whether the write operation carried out from redis cluster fails for detecting, alternatively, detection
For whether having expired for the buffer queue for carrying out write operation from redis cluster, wherein the feelings of double write operation failures
Whether condition is to fail for the write operation carried out from redis cluster, alternatively, for carrying out for described from redis cluster
The buffer queue of write operation has been expired.
Based on the same inventive concept, another embodiment of the application provides a kind of redis cluster backup data across computer room
Device is applied to from redis cluster, it is described from redis cluster from main redis aggregated pattern in different computer rooms.With reference to Fig. 4, Fig. 4
It is the schematic diagram of the device for the redis cluster backup data across computer room that one embodiment of the application provides.As shown in figure 4, the dress
It sets and includes:
First read module 401, for reading the key- for being successfully written the main redis cluster from kafka queue
Key value in value value;
Second read module 402, for being read from the main redis cluster described in being successfully written according to the key value
The key-value value of main redis cluster;
Backup module 403, for the key-value value for being successfully written the main redis cluster to be backuped to local.
In a kind of optional embodiment, backup module includes:
Comparative sub-module, for by be successfully written the main redis cluster key-value value and the key- being locally stored
Value value compares;
Submodule is handled, for being the key- being locally stored being successfully written the key-value value of the main redis cluster
In the case where the more new version of value value, the key-value value being locally stored is deleted, and the main redis collection will be successfully written
The key-value value of group is stored to local.
In a kind of optional embodiment, described device further include:
Detection module, for detecting whether the main redis cluster breaks down;
Configuration module, it is described from redis cluster configuration for inciting somebody to action in the case where the main redis cluster breaks down
For new main redis cluster.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
Based on the same inventive concept, another embodiment of the application provides a kind of computer readable storage medium, stores thereon
There is computer program, the step in the method as described in any of the above-described embodiment of the application is realized when which is executed by processor
Suddenly.
Based on the same inventive concept, another embodiment of the application provides a kind of electronic equipment, including memory, processor and
The computer program that can be run on a memory and on a processor is stored, the processor realizes the application above-mentioned when executing
Step in method described in one embodiment.
Fig. 5 is the schematic diagram for the electronic equipment 500 that one embodiment of the application provides.For example, electronic equipment 500 can be shifting
Mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, Medical Devices, body-building are set
It is standby, personal digital assistant etc..
Referring to Fig. 5, electronic equipment 500 may include following one or more components: processing component 502, memory 504,
Power supply module 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor module 514, with
And communication component 516.
The integrated operation of the usual control device 500 of processing component 502, such as with display, telephone call, data communication, phase
Machine operation and record operate associated operation.Processing component 502 may include that one or more processors 520 refer to execute
It enables, to complete all or part of the steps of the method for above-mentioned implementation failure transfer.In addition, processing component 502 may include one
Or multiple modules, convenient for the interaction between processing component 502 and other assemblies.For example, processing component 502 may include multimedia
Module, to facilitate the interaction between multimedia component 508 and processing component 502.
Memory 504 is configured as storing various types of data to support the operation in electronic equipment 500.These data
Example include any application or method for being operated on electronic equipment 500 instruction, contact data, telephone directory
Data, message, picture, video etc..Memory 504 can by any kind of volatibility or non-volatile memory device or it
Combination realize, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable
Except programmable read only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, fastly
Flash memory, disk or CD.
Power supply module 506 provides electric power for the various assemblies of electronic equipment 500.Power supply module 506 may include power supply pipe
Reason system, one or more power supplys and other with for electronic equipment 500 generate, manage, and distribute the associated component of electric power.
Multimedia component 508 includes the screen of one output interface of offer between the electronic equipment 500 and user.
In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch surface
Plate, screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touches
Sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding
The boundary of movement, but also detect duration and pressure associated with the touch or slide operation.In some embodiments,
Multimedia component 508 includes a front camera and/or rear camera.When electronic equipment 500 is in operation mode, as clapped
When taking the photograph mode or video mode, front camera and/or rear camera can receive external multi-medium data.It is each preposition
Camera and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 510 is configured as output and/or input audio signal.For example, audio component 510 includes a Mike
Wind (MIC), when electronic equipment 500 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone
It is configured as receiving external audio signal.The received audio signal can be further stored in memory 504 or via logical
Believe that component 516 is sent.In some embodiments, audio component 510 further includes a loudspeaker, is used for output audio signal.
I/O interface 512 provides interface between processing component 502 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock
Determine button.
Sensor module 514 includes one or more sensors, for providing the state of various aspects for electronic equipment 500
Assessment.For example, sensor module 514 can detecte the state that opens/closes of electronic equipment 500, the relative positioning of component, example
As the component be electronic equipment 500 display and keypad, sensor module 514 can also detect electronic equipment 500 or
The position change of 500 1 components of electronic equipment, the existence or non-existence that user contacts with electronic equipment 500, electronic equipment 500
The temperature change of orientation or acceleration/deceleration and electronic equipment 500.Sensor module 514 may include proximity sensor, be configured
For detecting the presence of nearby objects without any physical contact.Sensor module 514 can also include optical sensor,
Such as CMOS or ccd image sensor, for being used in imaging applications.In some embodiments, which may be used also
To include acceleration transducer, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 516 is configured to facilitate the communication of wired or wireless way between electronic equipment 500 and other equipment.
Electronic equipment 500 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.Show at one
In example property embodiment, communication component 516 receives broadcast singal or broadcast from external broadcasting management system via broadcast channel
Relevant information.In one exemplary embodiment, the communication component 516 further includes near-field communication (NFC) module, short to promote
Cheng Tongxin.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module
(UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, electronic equipment 500 can be by one or more application specific integrated circuit (ASIC), number
Word signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing two kinds of redis collection across computer room
The method of group's Backup Data, specifically, the method for redis cluster backup data of the first method across computer room includes:
Double write operations, double write operation packets are carried out to the main redis cluster for being distributed in different computer rooms and from redis cluster
The write operation carried out to the main redis cluster is included, and, in the write operation success carried out for the main redis cluster
Afterwards for the write operation carried out from redis cluster;
Detect whether double write operations fail;
In the case where double write operations failure, it will be successfully written in the key-value value of the main redis cluster
The storage of key value to kafka queue so that it is described from redis cluster according to the key value in the kafka queue, will successfully write
The key-value value for entering the main redis cluster backups to local.
In a kind of optional embodiment, detect whether double write operations succeed, comprising:
Whether detection fails for the write operation carried out from redis cluster, alternatively, detection for for it is described from
Redis cluster carry out write operation buffer queue whether expire, wherein double write operations fail the case where be for it is described from
Whether the write operation that redis cluster carries out fails, alternatively, for for the caching team for carrying out write operation from redis cluster
Column have been expired.
The method of second of redis cluster backup data across computer room is applied to from redis cluster, described from redis collection
Group is from main redis aggregated pattern in different computer rooms, which comprises
From the key value read in kafka queue in the key-value value for being successfully written the main redis cluster;
According to the key value, the key- for being successfully written the main redis cluster is read from the main redis cluster
Value value;
The key-value value for being successfully written the main redis cluster is backuped into local.
In a kind of optional embodiment, the key-value value for being successfully written the main redis cluster is backuped to this
Ground, comprising:
The key-value value of the main redis cluster will be successfully written compared with the key-value value being locally stored;
In the more new edition that the key-value value for being successfully written the main redis cluster is the key-value value being locally stored
In the case where this, the key-value value being locally stored, and the key-value value that the main redis cluster will be successfully written are deleted
It stores to local.
In a kind of optional embodiment, the method also includes:
Detect whether the main redis cluster breaks down;
In the case where the main redis cluster breaks down, by it is described from redis cluster configuration be new main redis
Cluster.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 504 of instruction, above-metioned instruction can be executed above-mentioned across computer room to complete by the processor 520 of electronic equipment 500
Redis cluster backup data method.For example, the non-transitorycomputer readable storage medium can be ROM, deposit at random
Access to memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..When the instruction in storage medium is by electronic equipment
Processor execute when so that the step of electronic equipment is able to carry out the method for the above-mentioned redis cluster backup data across computer room.
Provided herein the method for the redis cluster backup data across computer room not with any certain computer, virtual system
Or other equipment are inherently related.Various general-purpose systems can also be used together with teachings based herein.It is retouched according to above
It states, it is obvious for constructing structure required by the system with the present invention program.In addition, the present invention is not also directed to any spy
Determine programming language.It should be understood that can use various programming languages realizes summary of the invention described herein, and right above
The description that language-specific is done is in order to disclose the best mode of carrying out the invention.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, such as right
As claim reflects, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows tool
Thus claims of body embodiment are expressly incorporated in the specific embodiment, wherein each claim conduct itself
Separate embodiments of the invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any
Can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
In the method for microprocessor or digital signal processor (DSP) to realize implementation failure transfer according to an embodiment of the present invention
The some or all functions of some or all components.The present invention is also implemented as executing method as described herein
Some or all device or device programs (for example, computer program and computer program product).Such reality
Existing program of the invention can store on a computer-readable medium, or may be in the form of one or more signals.
Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or in any other forms
It provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word " comprising " does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
Claims (10)
1. a kind of method of the redis cluster backup data across computer room, which is characterized in that the described method includes:
Double write operations are carried out to the main redis cluster for being distributed in different computer rooms and from redis cluster, double write operations include pair
The write operation that the main redis cluster carries out, and, the needle after the write operation success carried out for the main redis cluster
To the write operation carried out from redis cluster;
Detect whether double write operations fail;
In the case where double write operations failure, by the key in the key-value value for being successfully written the main redis cluster
Value storage arrive kafka queue so that it is described from redis cluster according to the key value in the kafka queue, will be successfully written
The key-value value of the main redis cluster backups to local.
2. the method according to claim 1, wherein whether detection double write operations succeed, comprising:
Detection is directed to whether the write operation carried out from redis cluster fails, alternatively, detection is described from redis for being directed to
Whether the buffer queue that cluster carries out write operation has expired, wherein the case where double write operations fail is for described from redis
Whether the write operation that cluster carries out fails, alternatively, for having carried out the buffer queue of write operation from redis cluster for described
It is full.
3. a kind of method of the redis cluster backup data across computer room, which is characterized in that be applied to from redis cluster, it is described from
Redis cluster is from main redis aggregated pattern in different computer rooms, which comprises
From the key value read in kafka queue in the key-value value for being successfully written the main redis cluster;
According to the key value, the key-value for being successfully written the main redis cluster is read from the main redis cluster
Value;
The key-value value for being successfully written the main redis cluster is backuped into local.
4. according to the method described in claim 3, it is characterized in that, the key-value that the main redis cluster will be successfully written
Value backups to local, comprising:
The key-value value of the main redis cluster will be successfully written compared with the key-value value being locally stored;
In the more new version that the key-value value for being successfully written the main redis cluster is the key-value value being locally stored
In the case of, the key-value value being locally stored is deleted, and the key-value value for being successfully written the main redis cluster is stored
To local.
5. according to the method described in claim 3, it is characterized in that, the method also includes:
Detect whether the main redis cluster breaks down;
In the case where the main redis cluster breaks down, by it is described from redis cluster configuration be new main redis cluster.
6. a kind of device of the redis cluster backup data across computer room, which is characterized in that described device includes:
Double write operation modules, for carrying out double write operations to the main redis cluster for being distributed in different computer rooms and from redis cluster,
Double write operations include the write operation carried out to the main redis cluster, and, it is carried out for the main redis cluster
Write operation success after for the write operation carried out from redis cluster;
Detection module, for detecting whether double write operations fail;
Memory module, for the key- of the main redis cluster will to be successfully written in the case where double write operations failure
Key value storage in value value to kafka queue so that it is described from redis cluster according to the key in the kafka queue
Value, backups to local for the key-value value for being successfully written the main redis cluster.
7. device according to claim 6, which is characterized in that the detection module includes:
Detection sub-module is directed to whether the write operation carried out from redis cluster fails for detecting, alternatively, detection is used for
For it is described from redis cluster carry out write operation buffer queue whether expire, wherein double write operations failure the case where be
Whether fail for the write operation carried out from redis cluster, alternatively, for carrying out writing behaviour from redis cluster for described
The buffer queue of work has been expired.
8. a kind of device of the redis cluster backup data across computer room, which is characterized in that be applied to from redis cluster, it is described from
From main redis aggregated pattern in different computer rooms, described device includes: redis cluster
First read module, for being successfully written in the key-value value of the main redis cluster from reading in kafka queue
Key value;
Second read module, for being read from the main redis cluster and being successfully written the main redis according to the key value
The key-value value of cluster;
Backup module, for the key-value value for being successfully written the main redis cluster to be backuped to local.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor
The step in method a method as claimed in any one of claims 1 to 5 is realized when row.
10. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor
Machine program, which is characterized in that the step of processor realizes method a method as claimed in any one of claims 1 to 5 when executing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811347403.8A CN109684406A (en) | 2018-11-13 | 2018-11-13 | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811347403.8A CN109684406A (en) | 2018-11-13 | 2018-11-13 | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109684406A true CN109684406A (en) | 2019-04-26 |
Family
ID=66185769
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811347403.8A Pending CN109684406A (en) | 2018-11-13 | 2018-11-13 | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109684406A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110362432A (en) * | 2019-07-23 | 2019-10-22 | 深信服科技股份有限公司 | A kind of backup method, device, equipment and storage medium |
CN110795503A (en) * | 2019-10-18 | 2020-02-14 | 北京达佳互联信息技术有限公司 | Multi-cluster data synchronization method and related device of distributed storage system |
CN111190766A (en) * | 2019-12-12 | 2020-05-22 | 北京淇瑀信息科技有限公司 | HBase database-based cross-machine-room cluster disaster recovery method, device and system |
CN111880956A (en) * | 2020-07-24 | 2020-11-03 | 北京达佳互联信息技术有限公司 | Data synchronization method and device |
CN112235361A (en) * | 2020-09-28 | 2021-01-15 | 青海绿能数据有限公司 | Photovoltaic power plant data switching platform |
CN113051108A (en) * | 2021-03-26 | 2021-06-29 | 北京明略昭辉科技有限公司 | Data backup method and system |
CN113434515A (en) * | 2021-07-23 | 2021-09-24 | 深圳智多豚物联技术有限公司 | Distributed high-speed storage system based on persistent redis storage service |
CN114048268A (en) * | 2021-11-23 | 2022-02-15 | 百融云创科技股份有限公司 | Double-write technical method and system based on transaction id |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7437598B2 (en) * | 2004-12-23 | 2008-10-14 | Xiv Ltd. | System, method and circuit for mirroring data |
CN104202375A (en) * | 2014-08-22 | 2014-12-10 | 广州华多网络科技有限公司 | Method and system for synchronous data |
CN108055343A (en) * | 2017-12-26 | 2018-05-18 | 北京奇虎科技有限公司 | For the method for data synchronization and device of computer room |
CN108228397A (en) * | 2016-12-22 | 2018-06-29 | 深圳市优朋普乐传媒发展有限公司 | The method and apparatus that a kind of cluster span computer room synchronizes |
CN108347476A (en) * | 2018-01-22 | 2018-07-31 | 广东欧珀移动通信有限公司 | Across computer room method of data synchronization, device and server |
-
2018
- 2018-11-13 CN CN201811347403.8A patent/CN109684406A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7437598B2 (en) * | 2004-12-23 | 2008-10-14 | Xiv Ltd. | System, method and circuit for mirroring data |
CN104202375A (en) * | 2014-08-22 | 2014-12-10 | 广州华多网络科技有限公司 | Method and system for synchronous data |
CN108228397A (en) * | 2016-12-22 | 2018-06-29 | 深圳市优朋普乐传媒发展有限公司 | The method and apparatus that a kind of cluster span computer room synchronizes |
CN108055343A (en) * | 2017-12-26 | 2018-05-18 | 北京奇虎科技有限公司 | For the method for data synchronization and device of computer room |
CN108347476A (en) * | 2018-01-22 | 2018-07-31 | 广东欧珀移动通信有限公司 | Across computer room method of data synchronization, device and server |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110362432A (en) * | 2019-07-23 | 2019-10-22 | 深信服科技股份有限公司 | A kind of backup method, device, equipment and storage medium |
CN110362432B (en) * | 2019-07-23 | 2023-12-29 | 深信服科技股份有限公司 | Backup method, device, equipment and storage medium |
CN110795503A (en) * | 2019-10-18 | 2020-02-14 | 北京达佳互联信息技术有限公司 | Multi-cluster data synchronization method and related device of distributed storage system |
CN111190766A (en) * | 2019-12-12 | 2020-05-22 | 北京淇瑀信息科技有限公司 | HBase database-based cross-machine-room cluster disaster recovery method, device and system |
CN111880956A (en) * | 2020-07-24 | 2020-11-03 | 北京达佳互联信息技术有限公司 | Data synchronization method and device |
CN111880956B (en) * | 2020-07-24 | 2023-12-05 | 北京达佳互联信息技术有限公司 | Data synchronization method and device |
CN112235361A (en) * | 2020-09-28 | 2021-01-15 | 青海绿能数据有限公司 | Photovoltaic power plant data switching platform |
CN113051108A (en) * | 2021-03-26 | 2021-06-29 | 北京明略昭辉科技有限公司 | Data backup method and system |
CN113434515A (en) * | 2021-07-23 | 2021-09-24 | 深圳智多豚物联技术有限公司 | Distributed high-speed storage system based on persistent redis storage service |
CN113434515B (en) * | 2021-07-23 | 2022-10-14 | 深圳智多豚物联技术有限公司 | Distributed high-speed storage system based on persistent redis storage service |
CN114048268A (en) * | 2021-11-23 | 2022-02-15 | 百融云创科技股份有限公司 | Double-write technical method and system based on transaction id |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109684406A (en) | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room | |
WO2020192311A1 (en) | Master-slave server switching method and apparatus, electronic device and storage medium | |
US9900422B2 (en) | Mobile terminal and method of controlling therefor | |
EP2306290B1 (en) | Mobile terminal and method of controlling application execution in a mobile terminal | |
KR101759451B1 (en) | Method, device and terminal, program and recording medium for restoring firmware program | |
EP2549717B1 (en) | Mobile terminal and controlling method thereof | |
US8798684B2 (en) | Mobile terminal and controlling method thereof | |
US10042596B2 (en) | Electronic device and method for controlling the same | |
CN107357704B (en) | Application program detection method, terminal and computer readable storage medium | |
CN106126685B (en) | Page loading method and device | |
KR101635030B1 (en) | Method for data synchronization and mobile terminal using this method | |
CN108702414A (en) | A kind of screen locking method and device | |
CN107979851B (en) | Abnormal data reporting method and device | |
KR20170084558A (en) | Electronic Device and Operating Method Thereof | |
EP2530575A1 (en) | Mobile terminal and controlling method thereof | |
CN108702412A (en) | A kind of display methods and device | |
CN111597797A (en) | Method, device, equipment and medium for editing social circle message | |
CN109684123B (en) | Problem resource positioning method, device, terminal and storage medium | |
WO2023116505A1 (en) | Module processing method and apparatus for foreground and background separation system, and storage medium | |
CN109586951A (en) | Implement method, apparatus, electronic equipment and the readable storage medium storing program for executing of failure transfer | |
CN110457192A (en) | A kind of file monitor method and device, terminal, storage medium | |
CN111290882B (en) | Data file backup method, data file backup device and electronic equipment | |
CN115904181A (en) | Window management method and device | |
CN106502809B (en) | A kind of multi-platform application program adaptation method, device and terminal device | |
KR20120070048A (en) | Mobile terminal and method for managing task |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190426 |