CN112685498A - Method for persistence of Redis data on cloud platform - Google Patents

Method for persistence of Redis data on cloud platform Download PDF

Info

Publication number
CN112685498A
CN112685498A CN202011584698.8A CN202011584698A CN112685498A CN 112685498 A CN112685498 A CN 112685498A CN 202011584698 A CN202011584698 A CN 202011584698A CN 112685498 A CN112685498 A CN 112685498A
Authority
CN
China
Prior art keywords
redis
data
persistence
node
cloud platform
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
Application number
CN202011584698.8A
Other languages
Chinese (zh)
Inventor
程铖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Technology Co Ltd
Original Assignee
Unicloud Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Unicloud Technology Co Ltd filed Critical Unicloud Technology Co Ltd
Priority to CN202011584698.8A priority Critical patent/CN112685498A/en
Publication of CN112685498A publication Critical patent/CN112685498A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for persistence of Redis data on a cloud platform, which comprises the following steps: s1, creating two redis instances; s2, setting the two redis as a high-availability cluster with a master-slave structure; one redis is a master node and the other is a slave node; s3, closing the data persistence function of the redis on the main node; and S4, opening the data persistence function of the redis from the node. The method for persisting Redis data on the cloud platform can ensure that the Redis service provides normal read-write service and also can ensure the data persistence function of the Redis service.

Description

Method for persistence of Redis data on cloud platform
Technical Field
The invention belongs to the technical field of cloud platform resource management, and particularly relates to a method for persistence of Redis data on a cloud platform.
Background
Redis is a memory type database, user data is stored in a memory of a computer, and data in the memory can be durably stored on a hard disk at regular time by a Redis service. To ensure that data is not lost. Redis will become read-only when persisting data, and stop accepting data write operations. And after the persistence is finished, the normal state is recovered.
The existing solutions are the following:
first, the drop function of the redis service is turned off.
Second, the tolerant redis service interrupts the write operation service for a certain time.
With respect to the first scheme, there is no problem in a scenario where data persistence is not required, but it is obviously not acceptable in a scenario where data persistence is required.
For the second scheme, service reliability cannot be guaranteed, and a system with high requirements for service reliability or a system with more writing operations is displayed to be unacceptable.
Disclosure of Invention
In view of the above, in order to overcome the above drawbacks, the present invention is directed to a method for persisting Redis data on a cloud platform.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method for persistence of Redis data on a cloud platform comprises the following steps:
s1, creating two redis instances;
s2, setting the two redis as a high-availability cluster with a master-slave structure; one redis is a master node and the other is a slave node;
s3, closing the data persistence function of the redis on the main node;
and S4, opening the data persistence function of the redis from the node.
Further, in step S2, the master node provides a read-write function, and the slave node provides a read-only function.
Compared with the prior art, the method for persisting Redis data on the cloud platform has the following advantages:
the method for persisting Redis data on the cloud platform can ensure that the Redis service provides normal read-write service and also can ensure the data persistence function of the Redis service.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic diagram illustrating a method for restarting persistent Redis service data according to the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
The embodiment provides a method for restarting persistent data of a Redis service, which is used for ensuring that the Redis service provides normal read-write service and ensuring the data persistence function of the Redis service, and the specific technical scheme is as follows:
1, two redis instances are created.
2, the two redis are set as a high available cluster in a master-slave configuration. One redis is the master node and the other is the slave node.
And 3, closing the data persistence function of the redis on the main node.
And 4, opening the data persistence function of the redis from the node.
And 5, the master node provides a read-write function, and the slave node provides a read-only function.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of clearly illustrating the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed method and system may be implemented in other ways. For example, the above described division of elements is merely a logical division, and other divisions may be realized, for example, multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not executed. The units may or may not be physically separate, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (2)

1. A method for persistence of Redis data on a cloud platform is characterized by comprising the following steps:
s1, creating two redis instances;
s2, setting the two redis as a high-availability cluster with a master-slave structure; one redis is a master node and the other is a slave node;
s3, closing the data persistence function of the redis on the main node;
and S4, opening the data persistence function of the redis from the node.
2. The method for Redis data persistence on a cloud platform of claim 1, wherein: in step S2, the master node provides a read/write function, and the slave node provides a read-only function.
CN202011584698.8A 2020-12-28 2020-12-28 Method for persistence of Redis data on cloud platform Pending CN112685498A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011584698.8A CN112685498A (en) 2020-12-28 2020-12-28 Method for persistence of Redis data on cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011584698.8A CN112685498A (en) 2020-12-28 2020-12-28 Method for persistence of Redis data on cloud platform

Publications (1)

Publication Number Publication Date
CN112685498A true CN112685498A (en) 2021-04-20

Family

ID=75454412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011584698.8A Pending CN112685498A (en) 2020-12-28 2020-12-28 Method for persistence of Redis data on cloud platform

Country Status (1)

Country Link
CN (1) CN112685498A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357042A (en) * 2015-10-30 2016-02-24 浪潮(北京)电子信息产业有限公司 High-availability cluster system, master node and slave node
WO2018129787A1 (en) * 2017-01-10 2018-07-19 网宿科技股份有限公司 Data persistence method and system in stream computing
CN108599996A (en) * 2018-04-03 2018-09-28 武汉斗鱼网络科技有限公司 Fault handling method, device and the terminal of data-base cluster
CN109815049A (en) * 2017-11-21 2019-05-28 北京金山云网络技术有限公司 Node delay machine restoration methods, device, electronic equipment and storage medium
CN111680100A (en) * 2020-04-30 2020-09-18 聚好看科技股份有限公司 Redis data synchronization method and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357042A (en) * 2015-10-30 2016-02-24 浪潮(北京)电子信息产业有限公司 High-availability cluster system, master node and slave node
WO2018129787A1 (en) * 2017-01-10 2018-07-19 网宿科技股份有限公司 Data persistence method and system in stream computing
CN109815049A (en) * 2017-11-21 2019-05-28 北京金山云网络技术有限公司 Node delay machine restoration methods, device, electronic equipment and storage medium
CN108599996A (en) * 2018-04-03 2018-09-28 武汉斗鱼网络科技有限公司 Fault handling method, device and the terminal of data-base cluster
CN111680100A (en) * 2020-04-30 2020-09-18 聚好看科技股份有限公司 Redis data synchronization method and server

Similar Documents

Publication Publication Date Title
US20150169313A1 (en) Integrated system and firmware update method
US9753792B2 (en) Method and system for byzantine fault tolerant data replication
US20200201724A1 (en) Storage system and storage system control method
CN102194009A (en) Database hosting method and database hosting platform system
CN111147274B (en) System and method for creating a highly available arbitration set for a cluster solution
CN103605657A (en) Method and device for reconstructing index online
CN102867035A (en) High-availability method and device of distributed document system cluster
CN110737504B (en) Fault-tolerant method, system, terminal and storage medium for deep learning model training
CN103152390A (en) Method and device and nodes and system for node configuration of distributed storage system
CN104054076A (en) Data storage method, database storage node failure processing method and apparatus
CN109859068B (en) Power grid data real-time synchronization system based on resource pool technology
CN110647425A (en) Database recovery method and device
CN114063883A (en) Method for storing data, electronic device and computer program product
KR102089291B1 (en) Method for moving data extent
US10387262B1 (en) Federated restore of single instance databases and availability group database replicas
CN104268097A (en) Metadata processing method and system
CN113553331A (en) Database-based multi-service inter-point log ID generation method
WO2013136371A1 (en) Storage system and data management method
CN103226592A (en) Database-based file system and file storage method
US20030074376A1 (en) File manager for storing several versions of a file
CN112685498A (en) Method for persistence of Redis data on cloud platform
US10942669B2 (en) Information processing apparatus and computer-readable recording medium
US10628444B1 (en) Incremental backup operations for on-line availability groups
US20220091769A1 (en) Method, device and computer program product for managing storage pool
US10387264B1 (en) Initiating backups based on data changes

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: 20210420