CN112134933A - Method and device for realizing OpenStack high-availability cache cluster and storage medium - Google Patents

Method and device for realizing OpenStack high-availability cache cluster and storage medium Download PDF

Info

Publication number
CN112134933A
CN112134933A CN202010921728.3A CN202010921728A CN112134933A CN 112134933 A CN112134933 A CN 112134933A CN 202010921728 A CN202010921728 A CN 202010921728A CN 112134933 A CN112134933 A CN 112134933A
Authority
CN
China
Prior art keywords
data
server
servers
state table
state
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
CN202010921728.3A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010921728.3A priority Critical patent/CN112134933A/en
Publication of CN112134933A publication Critical patent/CN112134933A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a method and a device for realizing an OpenStack high-availability cache cluster and a storage medium, and relates to the technical field of cloud computing. The method comprises the following steps: registering all servers in the Memcached cluster; setting a state table for recording the states of all servers in the Memcached cluster, and initializing the state table; the heartbeat detection process sends heartbeat detection to all servers in the server state table periodically, and carries out fault processing when the servers are in fault; and the data service process receives the data reading request and performs request processing. By adopting the scheme, the time for the service module in the OpenStack to read the data is shortened, and the high availability of the Memcached cluster and the consistency of the cached data in the server are improved.

Description

Method and device for realizing OpenStack high-availability cache cluster and storage medium
Technical Field
The embodiment of the invention relates to the technical field of cloud computing, in particular to a method and a device for realizing an OpenStack high-availability cache cluster and a storage medium.
Background
OpenStack is currently widely applied in various industries as an open-source cloud computing management platform. In the actual use process of the OpenStack cloud management platform, in order to improve the speed of reading data from the database by the OpenStack cloud management platform and improve user experience, a Memcached cluster is used as a data caching service by most service modules of the OpenStack cloud management platform. The specific implementation process is as follows: when data is read, firstly searching whether needed data exists in the Memcached cluster, and if the needed data exists, directly returning corresponding data; otherwise, reading the data from the bottom database, and writing the data into the Memcached cluster while returning the data.
The Memcached cluster is used, so that the time for the OpenStack cloud management platform service module to read data is effectively shortened, and the user experience is improved. But it also has the following disadvantages: due to the fact that the Memcached cluster does not have a high availability mechanism, when an organic machine in the Memcached cluster breaks down, partial cache data can be lost, so that the hit rate of the cache data is reduced, the time for the OpenStack cloud management platform service module to read the data is prolonged, and bad experience is brought to a user.
Disclosure of Invention
The embodiment of the invention provides an OpenStack high-availability cache cluster realization method, an OpenStack high-availability cache cluster realization device and a storage medium.
In order to achieve the purpose, the invention discloses the following technical scheme:
the invention provides a method for realizing an OpenStack high-availability cache cluster on one hand, which comprises the following steps:
setting a state table for recording the states of all servers in the Memcached cluster, and initializing the state table;
the heartbeat detection process sends heartbeat detection to all servers in the server state table periodically, and carries out fault processing when the servers are in fault;
and the data service process receives the data reading request and performs request processing.
Based on the above scheme, further, before setting the state table for recording the states of the servers in the Memcached cluster, the method further includes the following steps:
all servers in the Memcached cluster are registered.
Further, the heartbeat detection process periodically sends heartbeat detection to all servers in the server state table, and performs fault processing when a server fails, including the following steps:
1) the heartbeat detection process sends heartbeat detection to all servers in the server state table periodically;
2) judging whether the server fails, if so, setting the state of the corresponding server in the state table to be an abnormal state, and if not, executing the step 1);
3) and judging whether the server recovers from the fault, if so, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server, setting the state of the corresponding server in the state table to be the normal state, and if not, executing the step 1).
Further, the data service process receives the data reading request and performs request processing, including the following steps:
the data service process receives a data reading request;
randomly selecting a server in a normal state from the state table to process the reading request;
judging whether the cache data of the selected server contains the required data or not,
if yes, directly returning the request data;
if not, reading the needed data from the back-end database and writing the data into all the servers in the Memcached cluster.
Another aspect of the present invention provides an apparatus for implementing an OpenStack high-availability cache cluster, where the apparatus includes:
the initialization unit is used for registering all the servers in the Memcached cluster, and setting and initializing a state table for recording the states of all the servers in the Memcached cluster;
the heartbeat detection unit periodically sends heartbeat detection to all servers in the state table through a heartbeat detection process, and carries out fault processing when the servers are in fault;
and the data service unit receives the data reading request through the data service process and performs request processing.
Based on the above apparatus, further, the heartbeat detecting unit includes:
the heartbeat detection sending module is used for periodically sending heartbeat detection to all servers in the state table through a heartbeat detection process;
the fault judgment processing module is used for judging whether the server has a fault or not and setting the state of the corresponding server in the state table to be an abnormal state when the server has the fault;
and the fault recovery judging and processing module is used for judging whether the server recovers from the fault, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server after the server recovers from the fault, and simultaneously setting the state of the corresponding server in the state table to be in the normal state.
Further, the data service unit includes:
the data request receiving module is used for receiving a data reading request through a data service process and randomly selecting a server in a normal state from the state table to process the reading request;
and the data request processing module is used for judging whether the cache data of the selected server contains the required data, if so, directly returning the request data, and if not, reading the required data from the back-end database and writing the data into all servers in the Memcached cluster.
In addition, the present invention further provides a computer storage medium, where the computer storage medium contains program instructions, and when the program instructions are run on a computer device, the computer device is caused to execute the implementation method of the OpenStack high-availability cache cluster described above.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
1. according to the method, the device and the storage medium for realizing the OpenStack high-availability cache cluster, the state of each server in the Memcached cluster is recorded by using the server state table, then heartbeat detection is periodically sent to the servers in the state table through a heartbeat detection process, after the servers recover from faults, the state of the corresponding server in the state table is updated, cache data synchronization is carried out in the server in a normal state, and the high-availability of the Memcached cluster and the hit rate of the cache data in the server are improved.
2. According to the method, the device and the storage medium for realizing the OpenStack high-availability cache cluster, when a data reading request is received, a server in a normal state is randomly selected from a state table to process the reading request, when cache data of the server does not contain required data, the required data is read from a back-end database and written into all servers in a Memcached cluster, consistency of the cache data in all normal servers is ensured, time for a service module in the OpenStack to read the data is shortened, and user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flowchart of an implementation method of an OpenStack high-availability cache cluster according to an embodiment of the present application;
FIG. 2 is a flow chart of a process for sending heartbeat detection and fault handling in the heartbeat detection process of FIG. 1;
FIG. 3 is a flowchart illustrating a process of receiving a data read request and processing the request by the data service process of FIG. 1;
fig. 4 is a schematic structural diagram of an implementation apparatus of an OpenStack high-availability cache cluster according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart illustrating a method for implementing an OpenStack high-availability cache cluster according to an embodiment of the present invention.
Referring to fig. 1, the method of the present embodiment includes the following steps:
s1, registering all servers in the Memcached cluster;
s2, setting a state table for recording the states of all servers in the Memcached cluster, and initializing the state table of the servers;
s3, the heartbeat detection process sends heartbeat detection, and the data service process receives a data reading request, which specifically includes:
s31, the heartbeat detection process sends heartbeat detection to all servers in the state table periodically, and fault processing is carried out when the servers are in fault;
and S32, the data service process receives the data reading request and carries out request processing.
Further, as shown in fig. 2, in the step S31, the heartbeat detecting process periodically sends heartbeat detections to all servers in the server state table, and performs failure handling when a server fails, including the following steps:
1) the heartbeat detection process sends heartbeat detection to all servers in the server state table periodically;
2) judging whether the server fails, if so, setting the state of the corresponding server in the state table to be an abnormal state, and if not, executing the step 1);
3) and judging whether the server recovers from the fault, if so, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server, setting the state of the corresponding server in the state table to be the normal state, and if not, executing the step 1).
Further, as shown in fig. 3, in the step S32, the data service process receives the data reading request and performs request processing, including the following steps:
the data service process receives a data reading request;
randomly selecting a server in a normal state from the state table to process the reading request;
judging whether the cache data of the selected server contains the required data or not,
if yes, directly returning the request data;
and if not, reading the required data from the back-end database, receiving a data writing request, and writing the data into all servers in the Memcached cluster.
Fig. 4 shows a schematic structural diagram of an implementation apparatus of an OpenStack high-availability cache cluster according to an embodiment of the present invention.
Referring to fig. 4, the apparatus of the present embodiment includes:
the initialization unit 1 is configured to register all servers in the Memcached cluster, and set and initialize a state table for recording states of the servers in the Memcached cluster;
the heartbeat detection unit 2 is configured to periodically send heartbeat detection to all servers in the server state table through a heartbeat detection process, and perform fault processing when the servers are in fault;
and the data service unit 3 is configured to receive the data reading request through the data service process and perform request processing.
Specifically, in the apparatus of this embodiment, the heartbeat detection unit 2 is specifically configured to include:
the heartbeat detection sending module is used for periodically sending heartbeat detection to all servers in the state table through a heartbeat detection process;
the fault judgment processing module is used for judging whether the server has a fault or not and setting the state of the corresponding server in the state table to be an abnormal state when the server has the fault;
and the fault recovery judging and processing module is used for judging whether the server recovers from the fault, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server after the server recovers from the fault, and simultaneously setting the state of the corresponding server in the state table to be in the normal state.
Further, as shown in the figure, the data service unit 3 is configured to include:
the data request receiving module is used for receiving a data reading request through a data service process and randomly selecting a server in a normal state from the state table to process the reading request;
and the data request processing module is used for judging whether the cache data of the selected server contains the required data, if so, directly returning the request data, and if not, reading the required data from the back-end database and writing the data into all servers in the Memcached cluster.
Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium contains program instructions, and when the program instructions are run on a computer device, the computer device is enabled to execute the implementation method of the OpenStack high-availability cache cluster in the foregoing embodiment.
In the above embodiment of the present invention, on one hand, the state of all servers of the Memcached cluster is recorded by using the server state table, and after the failed server is recovered, all cache data are synchronized from the servers in normal state while the state table is updated, so that the high availability of the Memcached cluster and the consistency of the cache data in all servers are ensured. On the other hand, when the required data does not exist in the cache data, the data is read from the back-end database and then written into all the servers with normal states in the Memcached cluster, so that the consistency of the cache data in all the normal servers is ensured.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and it will be apparent to those skilled in the art that any modification, improvement and equivalent substitution made without departing from the principle of the present invention are included in the protection scope of the present invention.

Claims (8)

1. A method for realizing an OpenStack high-availability cache cluster is characterized by comprising the following steps:
setting a state table for recording the states of all servers in the Memcached cluster, and initializing the state table;
the heartbeat detection process sends heartbeat detection to all servers in the state table periodically, and carries out fault processing when the servers are in fault;
and the data service process receives the data reading request and performs request processing.
2. The method for implementing the OpenStack high-availability cache cluster according to claim 1, wherein before setting the state table for recording the states of the servers in the Memcached cluster, the method further comprises the following steps:
all servers in the Memcached cluster are registered.
3. The method for implementing the OpenStack high-availability cache cluster according to claim 1, wherein the heartbeat detection process periodically sends heartbeat detection to all servers in the state table, and performs failure handling when a server fails, including the following steps:
1) the heartbeat detection process sends heartbeat detection to all servers in the server state table periodically;
2) judging whether the server fails, if so, setting the state of the corresponding server in the state table to be an abnormal state, and if not, executing the step 1);
3) and judging whether the server recovers from the fault, if so, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server, setting the state of the corresponding server in the state table to be the normal state, and if not, executing the step 1).
4. The method for implementing the OpenStack high-availability cache cluster according to claim 1, wherein the data service process receives a data reading request and performs request processing, comprising the following steps:
the data service process receives a data reading request;
randomly selecting a server in a normal state from the state table to process the reading request;
judging whether the cache data of the selected server contains the required data or not,
if yes, directly returning the request data;
if not, reading the needed data from the back-end database and writing the data into all the servers in the Memcached cluster.
5. An apparatus for implementing an OpenStack high-availability cache cluster, comprising:
the initialization unit is used for registering all the servers in the Memcached cluster, and setting and initializing a state table for recording the states of all the servers in the Memcached cluster;
the heartbeat detection unit is used for periodically sending heartbeat detection to all servers in the server state table through a heartbeat detection process and carrying out fault processing when the servers are in fault;
and the data service unit receives the data reading request through the data service process and performs request processing.
6. The apparatus for implementing an OpenStack high-availability cache cluster according to claim 5, wherein the heartbeat detection unit includes:
the heartbeat detection sending module is used for periodically sending heartbeat detection to all servers in the state table through a heartbeat detection process;
the fault judgment processing module is used for judging whether the server has a fault or not and setting the state of the corresponding server in the state table to be an abnormal state when the server has the fault;
and the fault recovery judging and processing module is used for judging whether the server recovers from the fault, randomly selecting a server in a normal state from the state table to perform cache data synchronization on the server after the server recovers from the fault, and simultaneously setting the state of the corresponding server in the state table to be in the normal state.
7. The apparatus for implementing an OpenStack high-availability cache cluster according to claim 5, wherein the data service unit comprises:
the data request receiving module is used for receiving a data reading request through a data service process and randomly selecting a server in a normal state from the state table to process the reading request;
and the data request processing module is used for judging whether the cache data of the selected server contains the required data, if so, directly returning the request data, and if not, reading the required data from the back-end database and writing the data into all servers in the Memcached cluster.
8. A computer storage medium containing program instructions that, when run on a computer device, cause the computer device to perform the method for implementing an OpenStack high availability cache cluster according to any one of claims 1 to 4.
CN202010921728.3A 2020-09-04 2020-09-04 Method and device for realizing OpenStack high-availability cache cluster and storage medium Pending CN112134933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010921728.3A CN112134933A (en) 2020-09-04 2020-09-04 Method and device for realizing OpenStack high-availability cache cluster and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010921728.3A CN112134933A (en) 2020-09-04 2020-09-04 Method and device for realizing OpenStack high-availability cache cluster and storage medium

Publications (1)

Publication Number Publication Date
CN112134933A true CN112134933A (en) 2020-12-25

Family

ID=73847228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010921728.3A Pending CN112134933A (en) 2020-09-04 2020-09-04 Method and device for realizing OpenStack high-availability cache cluster and storage medium

Country Status (1)

Country Link
CN (1) CN112134933A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434345A (en) * 2021-06-15 2021-09-24 浙江大华技术股份有限公司 Method, cluster, equipment, platform and storage medium for hardware cluster failure management

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519112A (en) * 2018-05-22 2019-11-29 山东数盾信息科技有限公司 A kind of method for realizing the continuous High Availabitity of dynamic in cluster storage system
CN111031126A (en) * 2019-12-10 2020-04-17 江苏满运软件科技有限公司 Cluster cache sharing method, system, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519112A (en) * 2018-05-22 2019-11-29 山东数盾信息科技有限公司 A kind of method for realizing the continuous High Availabitity of dynamic in cluster storage system
CN111031126A (en) * 2019-12-10 2020-04-17 江苏满运软件科技有限公司 Cluster cache sharing method, system, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434345A (en) * 2021-06-15 2021-09-24 浙江大华技术股份有限公司 Method, cluster, equipment, platform and storage medium for hardware cluster failure management

Similar Documents

Publication Publication Date Title
US11341003B2 (en) Availability of a storage system
CN101997823B (en) Distributed file system and data access method thereof
US6687849B1 (en) Method and apparatus for implementing fault-tolerant processing without duplicating working process
CN103516736A (en) Data recovery method of distributed cache system and a data recovery device of distributed cache system
CN109491609B (en) Cache data processing method, device and equipment and readable storage medium
CN106802892B (en) Method and equipment for checking consistency of main and standby data
CN105024879A (en) Virtual machine fault detection and recovery system and virtual machine detection, recovery and starting method
US20210374155A1 (en) Synchronizing changes to stale components of a distributed object using synchronization bitmaps
CN109918226A (en) A kind of silence error-detecting method, device and storage medium
US11983438B2 (en) Technique for improving operations log indexing
CN111625199B (en) Method, device, computer equipment and storage medium for improving reliability of solid state disk data path
WO2016192045A1 (en) Access system and method for data storage
CN112134933A (en) Method and device for realizing OpenStack high-availability cache cluster and storage medium
US11531621B2 (en) Selective endpoint isolation for self-healing in a cache and memory coherent system
CN116724297A (en) Fault processing method, device and system
CN112905668A (en) Database derivative method, apparatus, and medium based on distributed data stream processing engine
US11036574B2 (en) Recovery of first failure data capture logs
CN113051428A (en) Method and device for storing and backing up front end of camera
US9348704B2 (en) Electronic storage system utilizing a predetermined flag for subsequent processing of each predetermined portion of data requested to be stored in the storage system
CN114020525B (en) Fault isolation method, device, equipment and storage medium
CN114840364A (en) Method and device for backing up storage data in memory and electronic equipment
CN111124275B (en) Monitoring service optimization method and device of distributed block storage system
CN113791934A (en) Data recovery method, computing device and storage medium
CN102447721B (en) A kind of method of backup and device
US11720457B2 (en) Remote direct memory access (RDMA)-based recovery of dirty data in remote memory

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