WO2014000430A1 - 一种实现高可用集群的心跳服务的方法及装置 - Google Patents

一种实现高可用集群的心跳服务的方法及装置 Download PDF

Info

Publication number
WO2014000430A1
WO2014000430A1 PCT/CN2013/070155 CN2013070155W WO2014000430A1 WO 2014000430 A1 WO2014000430 A1 WO 2014000430A1 CN 2013070155 W CN2013070155 W CN 2013070155W WO 2014000430 A1 WO2014000430 A1 WO 2014000430A1
Authority
WO
WIPO (PCT)
Prior art keywords
sequence number
heartbeat message
message sequence
read
server
Prior art date
Application number
PCT/CN2013/070155
Other languages
English (en)
French (fr)
Inventor
高军利
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014000430A1 publication Critical patent/WO2014000430A1/zh
Priority to US14/584,342 priority Critical patent/US9658912B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a method and apparatus for implementing a heartbeat service of a highly available cluster. Background technique
  • the dual-machine mode in the magnetic array dual-machine mode transmits heartbeat, switching execution and other control information through the heartbeat service, and the normal heartbeat service is carried in IP, time division multiplexer, light, serial port and the like. Above the hardware.
  • the HA cluster In the HA cluster, when the heartbeat service fails, the HA cluster, which is originally a whole and coordinated, splits into two or more independent individuals. Because they lost contact with each other, they thought that other individuals had failed. The consequence was that each individual would compete for shared resources and read and write shared storage, that is, read and write operations on the disk array at the same time, resulting in data corruption. For the brain split. Data corruption is difficult to repair and time-consuming and laborious, and it is likely to be completely damaged, resulting in economic losses that cannot be estimated.
  • the prevention of brain splitting may be a method of using a redundant heartbeat link, that is, using a Transmission Control Protocol (TCP), a User Datagram Protocol (UDP), a serial port, and the like.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • serial port a serial port
  • the above communication methods can be used at the same time, or only one type can be used, and the rest can be used as an alternative communication method.
  • the redundant heartbeat link fails, brain splitting inevitably occurs. Summary of the invention
  • Embodiments of the present invention provide a method and apparatus for implementing a heartbeat service of a highly available cluster, which solves the problem of brain splitting and improves the security of data protection.
  • the embodiment of the present invention provides a method for implementing a heartbeat service of a high-availability cluster, including: the server writes heartbeat count information to a disk array, where the heartbeat count information includes a serial number of the heartbeat message of the server, and the peer end is read. a heartbeat message sequence number, an active/standby state information, a heartbeat message, and a heartbeat message length, so that the corresponding one or more servers read the heartbeat count information of the server in the disk array;
  • the heartbeat count information written by the corresponding one or more servers to the corresponding one or more servers in the disk array is read, and the writing and reading operations are repeated.
  • the embodiment of the invention further provides a server for implementing a heartbeat service of a highly available cluster, which comprises:
  • a writing unit configured to write the heartbeat counting information into the disk array, where the heartbeat counting information includes a serial number of the write heartbeat message of the server, a serial number of the read heartbeat message, an active/standby state information, a heartbeat message, and a heartbeat a length of the message, so that the corresponding one or more servers read the heartbeat counting information of the server in the disk array; and the reading unit is configured to read the corresponding one or more servers to write to the Heartbeat counting information of the corresponding one or more servers in the disk array,
  • the writing unit and the reading unit are also used to repeat the writing and reading operations, respectively.
  • the host and the backup machine perform read and write operations on the disk for storing the heartbeat counting information, thereby solving the problem of brain splitting and improving the security of data protection.
  • Embodiment 1 is a flowchart of a method according to Embodiment 1 of the present invention.
  • FIG. 3 is a device diagram of a server according to Embodiment 3 of the present invention.
  • FIG. 1 is a flowchart of a method for implementing a heartbeat service of a high-availability cluster according to the present invention. As shown in FIG. 1, the method may include:
  • the server writes heartbeat counting information to the disk array, where the heartbeat counting information includes a serial number of the heartbeat message of the server, a serial number of the peer heartbeat message, an active/standby state information, a heartbeat message, and a heartbeat message length.
  • the disk array mode mainly provides switching after the disk array is provided. Protection of data integrity and continuity. User data is usually placed on the disk array. When the host is down, the standby machine continues to retrieve the original data from the disk array.
  • VI, V2 and DB logical disks
  • VI and V2 are used for writing.
  • DB is used to record user data.
  • the sizes of VI, V2, and DB can be customized and can be planned according to specific needs. For example, VI and V2 have a small footprint and can be allocated a small logical space.
  • the DB contains the remaining logical space.
  • the content organization of VI and V2 is the same, as shown in Table 1.
  • the local end writes the unsigned. After each message is written, the counter is incremented once, using physical I/O or based on the operation sequence number, and the file I/O is written to the WSeq side of the voting disk partition.
  • the heartbeat message of the primary and backup machines needs to be explained.
  • the primary state is the host that uses the magnetic array to provide services in the dual-machine;
  • the standby state is the host that does not use the magnetic array in the dual-machine;
  • the standby device detects that the host is faulty, it is ready to be activated for a period of time to prevent the peer from competing.
  • the peer detects that it is ready to activate, it will not compete for the resource upgrade.
  • the active state indicates that the active activation state ends. Start activating the resource and mount the state of the magnetic array.
  • the server can be written to the disk array by physical input/output, or it can be written to the disk array by operating system-based file input/output.
  • the corresponding one or more servers After the server writes to the disk array, the corresponding one or more servers read the heartbeat count information of the servers in the disk array. It can be seen from Table 1 that when the server writes successfully, the write heartbeat sequence number of the server needs to be accumulated once, and a default positive integer can be defined. Each time it is written, the heartbeat sequence number is added and the positive integer is added as a new write. Heartbeat message serial number. After the server reads the heartbeat count information of the corresponding one or more servers of the disk array, the server reads the peer heartbeat message sequence number and adds the positive integer as the new read peer heartbeat message sequence. number.
  • the corresponding heartbeat sequence number of one or more servers is added to the positive integer as the new write heartbeat message sequence number, each time After a read operation, the serial number of the read peer heartbeat message of the corresponding one or more servers is also added as the new serial number of the read peer heartbeat message.
  • the server is a host
  • the corresponding server is a standby. If the server is a standby, the corresponding server is the host. For example, when the server is a host and the corresponding server is a standby device, after the standby device writes the heartbeat count information to the disk array, the host reads the heartbeat count information written by the standby device. The heartbeat count information read is consistent with the type of heartbeat count information written by the host.
  • the serial number of the write heartbeat message of the host is defined as WSeql
  • the serial number of the read peer heartbeat message of the host is defined as RSeql
  • the serial number of the write heartbeat message of the standby machine is defined as WSeq2
  • the read end of the standby machine The heartbeat message sequence number is defined as RSeq2.
  • the whole process can be used as an example of tl-14 time, as follows:
  • the host writes heartbeat count information to VI, wherein the heartbeat count information includes the host's write heartbeat message sequence number WSeql, and the host reads the peer heartbeat message.
  • the standby machine reads the heartbeat count information in the VI.
  • the standby machine After entering t3 (t3>t2), the standby machine writes the heartbeat counting information to V2, and the heartbeat counting information written by the standby machine includes the write heartbeat message sequence number WSeq2 of the standby machine, and the standby machine reads the peer heartbeat message sequence number RSeq2.
  • the host needs to determine whether the WSeq1 stored by itself is equal to the RSeq2 read from the disk array. If they are equal, the next time is performed. If the write operation is not equal, it is judged that the disk array is abnormal. This may be caused by a third party misoperation of the disk array or a failure of the disk array itself. In this case, the host assigns WSeql to RSeq2 and rewrites it to the VI, the process is unchanged.
  • the standby machine After the backup machine reads the heartbeat count information on the disk array, the standby machine needs to determine whether the WSeq2 stored by itself is equal to the RSeq1 read from the disk array, and if it is equal, proceed One write operation, if not equal, assign WSeq2 to RSeq1 and rewrite to V2.
  • This method provides a disk array-based heartbeat protection mechanism and has a strong self-healing capability for disk array exception handling. When the heartbeat link is faulty, the link between the host or the standby device and the disk array is faulty. Even if the brain crack occurs, the faulty host or the standby machine cannot access the magnetic array. Therefore, the disk array is not simultaneously performed. Read and write, effectively protect data security.
  • Embodiment 2 of the present invention In the method for implementing the heartbeat service of the high-availability cluster, the host and the backup machine perform read and write operations on the disk for storing the heartbeat counting information, thereby solving the problem of brain splitting and improving the security of data protection.
  • Embodiment 2 of the present invention :
  • a method for implementing a heartbeat service of a highly available cluster is as follows:
  • the disk array approach provides data integrity and continuity protection through disk arrays.
  • User data is usually placed on the disk array.
  • the standby machine continues to retrieve the original data from the disk array.
  • one service requires two servers to execute, one is active, that is, the primary server, referred to as the host, and the other one handles the standby state. , and the standby server, referred to as the standby machine.
  • VI and V2 are used to write and read heartbeat data, and can also be written and read.
  • DB is used to record user data.
  • the sizes of VI, V2, and DB can be customized and can be planned according to specific needs. For example, the occupation of VI, V2 The space is not large, you can allocate a smaller logical space for it, and the DB contains the remaining logical space.
  • the content organization of VI and V2 is the same as shown in Table 1 of Embodiment 1.
  • N is a positive integer greater than 3.
  • the host writes heartbeat counting information to the VI.
  • the host writes heartbeat count information to the VI through physical input/output read/write, and can also write heartbeat count information to the VI through an operating system-based file input/output method.
  • the heartbeat counting information includes a write heartbeat message sequence number, a read end heartbeat message sequence number, an active/standby state information, a heartbeat message, and a heartbeat message length.
  • the write heartbeat message sequence number is incremented after each write success, and N is the default. A positive integer, for ease of understanding, in this embodiment, the write heartbeat message sequence number is incremented by one after each successful write.
  • the serial number of the read heartbeat message is the serial number of the write heartbeat message written by the host to read the standby machine on V2.
  • the active/standby status information is whether it is active or standby. For a certain service, the status of the primary backup can be Mutual conversion, if the primary server is down, the standby server can be promoted to the primary server, and the original primary server is reduced to the standby server.
  • the standby machine reads the heartbeat counting information of the VI.
  • the standby machine reads the heartbeat count information of the VI, and assigns the serial number of the read peer heartbeat message of the standby machine to the serial number of the write heartbeat message of the read host, and each read succeeds, and the read end of the standby machine
  • the heartbeat message sequence number is incremented by 1.
  • the serial number of the write heartbeat message of the host is defined as WSeql
  • the serial number of the read peer heartbeat message of the host is defined as RSeql
  • the serial number of the write heartbeat message of the standby machine is defined as WSeq2
  • the read end of the standby machine The heartbeat message sequence number is defined as RSeq2.
  • the host writes heartbeat count information to VI, wherein the heartbeat count information includes the host's write heartbeat message sequence number WSeql, and the host reads the peer end.
  • the standby machine When t2 is entered (t2>tl), the standby machine reads the heartbeat count information in the VI.
  • the standby machine writes the heartbeat counting information to V2.
  • the standby machine writes the heartbeat count information to V2, and the specific processing is the same as S202.
  • the standby machine writes the heartbeat count information to V2
  • the heartbeat count information written by the standby machine includes the write heartbeat message sequence number WSeq2 of the standby machine, and the standby machine reads the peer heartbeat message.
  • the host reads the heartbeat count information of the V2.
  • the heartbeat count message of V2 is consistent with the heartbeat count message type of the VI.
  • Both the host and the standby determine the write heartbeat message sequence number saved by itself and the read peer heartbeat message sequence number read from the disk array before writing and reading. From the time t1 to t4, the relationship between RSeql, RSeq2, WSeql and WSeq2 is not difficult to find.
  • WSeql is equal to RSeq2, or equal to RSeq2+l, which is normal.
  • WSeq2 is equal to RSeql.
  • RSeql+1 is in the normal state.
  • the host judges whether WSeq1 is equal to RSeq2 before writing, and judges whether WSeq1 is equal to RSeq2+1 before reading; the standby determines whether WSeq2 is equal to RSeq1 before writing, and determines whether WSeq2 is equal to RSeq1+l before reading. Therefore, when the host determines that WSeql is equal to RSeq2, or equals RSeq2+l, the server repeats the write and read operations. Similarly, when the standby machine determines that WSeq2 is equal to RSeql or equals RSeql+1, the server repeats the write and read operations.
  • the host writes the heartbeat count information to VI for the second time.
  • the standby machine reads the heartbeat count information of the VI for the second time.
  • the host determines that WSeql is not equal to RSeq2+l and is not equal to RSeq2, it determines that the disk array is abnormal. This may be caused by a third party misoperation of the disk array or a failure of the disk array itself. In this case, the host assigns WSeql to RSeq2 and rewrites it to the VI with the same flow.
  • the standby machine determines that WSeq2 is not equal to RSeql+1 and does not equal RSeq1, it determines that the disk array is abnormal.
  • the standby machine assigns WSeq2 to RSeql, which is heavy Newly written to V2, the process is unchanged. This method provides a disk array-based heartbeat protection mechanism and has a strong self-healing capability for disk array exception handling.
  • the link between the host or the standby device and the disk array is faulty. Even if the brain crack occurs, the faulty host or the standby machine cannot access the magnetic array. Therefore, the disk array is not simultaneously performed. Read and write, effectively protect data security.
  • the disk array can be divided into multiple arrays (such as VI, V2, V3, ... and DB for storing user data), and the process is the same as the hot standby process.
  • Embodiment 3 of the present invention In the method for implementing the heartbeat service of the high-availability cluster, the host and the backup machine perform read and write operations on the disk for storing the heartbeat counting information, thereby solving the problem of brain splitting and improving the security of data protection.
  • Embodiment 3 of the present invention :
  • An embodiment of the present invention provides a server for implementing a heartbeat service of a highly available cluster, as shown in FIG. 3, including:
  • the writing unit 301 is configured to write the heartbeat counting information into the disk array, where the heartbeat counting information includes a serial number of the heartbeat message of the server, a serial number of the reading heartbeat message, an active/standby state information, a heartbeat message, and a heartbeat message length, such that the corresponding one or more servers read heartbeat count information of the server in the disk array;
  • the disk array approach provides data integrity and continuity protection through disk arrays.
  • User data is usually placed on the disk array.
  • the standby machine continues to retrieve the original data from the disk array.
  • VI Take dual-system hot backup (based on hot backup of two servers with high availability) as an example, It is planned to be three logical disks, named VI, V2 and DB respectively.
  • VI and V2 are used to write and read heartbeat data, and can also write and read the server's primary standby state.
  • DB is used for DB. Record user data.
  • the sizes of VI, V2, and DB can be customized and can be planned according to specific needs. For example, VI and V2 take up less space and can allocate smaller logical space for them. DB contains the remaining logical space.
  • the content organization of VI and V2 is the same as shown in Table 1 of the embodiment.
  • the write unit 301 can be written to the disk array by physical input/output, or can be written to the disk array by an operating system-based file input/output method.
  • the accumulating unit When the writing unit 301 writes successfully, the accumulating unit accumulates the write heartbeat sequence number once, and defines a default positive integer. Each time it is written, the heartbeat sequence number is added and the positive integer is added as a new write heartbeat message sequence. number. After the read unit of the server reads the heartbeat count information of the corresponding one or more servers of the disk array, the accumulating unit of the server also adds the serial number of the read peer heartbeat message of the server to the positive integer. The new read peer heartbeat message serial number.
  • the corresponding heartbeat sequence number of one or more servers is added to the positive integer as the new write heartbeat message sequence number, each time After a read operation, the serial number of the read peer heartbeat message of the corresponding one or more servers is also added as the new serial number of the read peer heartbeat message.
  • the reading unit 302 is configured to read heartbeat counting information written by the corresponding one or more servers to the corresponding one or more servers in the disk array;
  • the writing unit 301 and the reading unit 302 are also used to repeat the writing and reading operations, respectively.
  • the server is a host
  • the corresponding server is a standby machine.
  • the server is the standby machine, and the corresponding server is the host.
  • the reading unit 302 of the host reads the heartbeat counting information written by the standby machine.
  • the read heartbeat count information is consistent with the type of heartbeat count information written by the host.
  • the serial number of the write heartbeat message of the host is defined as WSeql
  • the serial number of the read peer heartbeat message of the host is defined as RSeql
  • the serial number of the write heartbeat message of the standby machine is defined as WSeq2
  • the read heartbeat of the standby machine is read.
  • the message sequence number is defined as RSeq2.
  • the write unit 301 of the host writes the heartbeat count information to the VI, wherein the heartbeat count information includes the host's write heartbeat message sequence number WSeql, and the host reads
  • the peer heartbeat message sequence number RSeq1 the active/standby state information, the heartbeat message, and the heartbeat message length are taken.
  • the determining unit of the host needs to determine whether the WSeq1 stored by itself is equal to the RSeq2 read from the disk array. If they are equal, the writing unit 301 performs the next writing operation. If they are not equal, the determining unit determines that the disk array is abnormal. This may be caused by a third party misoperation of the disk array or a failure of the disk array itself. In this case, the write unit of the host assigns WSeql to RSeq2 and rewrites to VI, and the flow remains unchanged.
  • the judging unit of the standby machine needs to judge the WSeq2 stored by itself and the RSeql read from the disk array. Whether they are equal, if they are equal, the next write operation is performed. If they are not equal, the write unit of the standby machine assigns WSeq2 to RSeq1 and rewrites it to V2.
  • This approach provides a disk array-based heartbeat protection mechanism that is highly self-healing for disk array exception handling.
  • the host and the standby judging unit may determine that the host and the standby judging unit both write the heartbeat message sequence number and the slave disk array saved by the unit before the unit write and read unit reads.
  • the read peer end heartbeat message serial number read in the judgment is judged. From the time t1 to t4, the relationship between RSeql, RSeq2, WSeql and WSeq2 is not difficult to find.
  • WSeql is equal to RSeq2, or equal to RSeq2+l, which is normal.
  • WSeq2 is equal to RSeql.
  • RSeql+1 is in the normal state.
  • the host determines whether WSeq1 is equal to RSeq2 by the determining unit before the writing unit writes, and determines whether WSeq1 is equal by the determining unit before the reading unit reads RSeq2+l;
  • the standby machine judges whether WSeq2 is equal to RSeq1 by the judging unit before the writing unit writes, and judges whether WSeq2 is equal to RSeq1+1 by the judging unit before the reading unit reads. Therefore, when the judgment unit of the host determines that WSeq1 is equal to RSeq2 or equals RSeq2+l, the write unit of the host performs the next write operation, and the read unit performs the next read operation.
  • the write unit of the standby machine performs the next write operation, and the read unit performs the next read operation. Then, when the host judging unit judges that WSeq1 is not equal to RSeq2+l and is not equal to RSeq2, it determines that the disk array is abnormal. This may be caused by a third party misoperation of the disk array or a failure of the disk array itself. In this case, the host writes the WSeql to RSeq2 and rewrites it to the VI, the process is unchanged.
  • the standby determination unit determines that WSeq2 is not equal to RSeql+1 and is not equal to RSeq1, it determines that the disk array is abnormal.
  • the standby write unit assigns WSeq2 to RSeql and rewrites it to V2, and the flow is unchanged.
  • the link between the host or the standby device and the disk array is faulty. Even if the brain crack occurs, the faulty host or the standby machine cannot access the magnetic array. Therefore, the disk array is not simultaneously performed. Read and write, effectively protect data security.
  • the writing unit of the server writes the disk for storing the heartbeat counting information
  • the reading unit of the server reads the disk for storing the heartbeat counting information.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a hardware plus software functional unit.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
  • the aforementioned storage medium Including: U disk, mobile hard disk, Read-Only Memory (ROM), Random Access Memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Hardware Redundancy (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明实施例提供一种实现高可用集群的心跳服务的方法,包括:服务器将心跳计数信息写入磁盘阵列中,所述心跳计数信息包括所述服务器的写心跳消息序列号、读取对端心跳消息序列号、主备状态信息、心跳消息和心跳消息长度,以便对应的一台或多台服务器读取所述磁盘阵列中的所述服务器的心跳计数信息;读取所述对应的一台或多台服务器写入至所述磁盘阵列中的所述对应的一台或多台服务器的心跳计数信息,重复所述写入和读取操作。相应地,本发明实施例还提供一种服务器,解决了脑裂的问题,提高了数据保护的安全性。

Description

一种实现高可用集群的心跳服务的方法及装置 技术领域
本发明实施例涉及通信技术领域, 尤其涉及一种实现高可用集群的心 跳服务的方法及装置。 背景技术
随着电信及 IT大容量关系式数据库应用, 海量数据要求系统提供大容 量、 高速访问及双机可靠性机制, 这种系统要求高可用 ( High Available , HA ) 集群能够可靠性有效切换数据库业务到备用服务器, 一般而言, 磁 阵双机模式下主备双机会通过心跳服务来传递心跳、 倒换执行等控制信 息, 而平常心跳服务都是承载于 IP、 时分复用器、 光线、 串口等磁阵之外 硬件之上。
在 HA集群中, 当心跳服务故障时, 本来为一整体、 动作协调的 HA集 群, 就分裂成为 2个及以上独立的个体。 由于相互失去了联系, 都以为是 其他个体出了故障, 后果是每个独立的个体都会争抢共享资源, 同时读写 共享存储, 即同时对磁盘阵列进行读写操作, 导致数据损坏, 称之为脑裂。 数据损坏修复困难并且费时费力, 很可能彻底损坏, 造成经济损失无法估 量。
现有技术中, 防止脑裂可以是釆用冗余心跳链路的方式, 即釆用传输 控制协议 ( Transmission Control Protocol , TCP ) 、 用户数据包协议 ( User Datagram Protocol , UDP ) 、 串口等通讯方式来传递心跳, 减少主备出现 脑裂, 保证临界资源数据库的安全。 以上几种通讯方式可以同时使用, 也 可以只使用一种, 其余当备选的通讯方式。 但是, 当冗余心跳链路出故障 时, 不可避免地会出现脑裂。 发明内容
本发明实施例提供一种实现高可用集群的心跳服务的方法及装置, 解 决了脑裂的问题, 提高了数据保护的安全性。
本发明实施例提供一种实现高可用集群的心跳服务的方法, 包括: 服务器将心跳计数信息写入磁盘阵列中, 所述心跳计数信息包括所述 服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主备状态信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读取所述磁盘阵 列中的所述服务器的心跳计数信息;
读取所述对应的一台或多台服务器写入至所述磁盘阵列中的所述对 应的一台或多台服务器的心跳计数信息, 重复所述写入和读取操作。
本发明实施例还提供一种实现高可用集群的心跳服务的服务器, 包 括:
写入单元, 用于将心跳计数信息写入磁盘阵列中, 所述心跳计数信息 包括所述服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主备状 态信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读取所 述磁盘阵列中的所述服务器的心跳计数信息; 读取单元, 用于读取所述对 应的一台或多台服务器写入至所述磁盘阵列中的所述对应的一台或多台 服务器的心跳计数信息, 所述写入单元和所述读取单元, 还分别用于重复所述写入和读取操 作。
本实施例提供的对实现高可用集群的心跳服务的方法, 主机和备机对 用于存储心跳计数信息的磁盘进行读写操作, 解决了脑裂的问题, 提高了 数据保护的安全性。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下 面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在 不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例一的方法流程图;
图 2为本发明实施例二的方法流程图;
图 3为本发明实施例三的服务器的装置图; 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动的前 提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明实施例一: 图 1为本发明对实现高可用集群的心跳服务的一个方法实施例的流程 图, 如图 1所示, 该方法可以包括:
S101、 服务器将心跳计数信息写入磁盘阵列中, 所述心跳计数信息包 括所述服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主备状态 信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读取所述 磁盘阵列中的所述服务器的心跳计数信息; 对于一个基于磁盘阵列的方式的高可用集群来说,磁盘阵列方式主要 通过磁盘阵列提供切换后, 对数据完整性和连续性的保障。 用户数据一般 会放在磁盘阵列上, 当主机宕机后,备机继续从磁盘阵列上取得原有数据。
以双机热备(基于高可用的两台服务器的热备份)为例, 将磁盘阵列 规划为 3个逻辑盘, 这里分别命名为 VI , V2及 DB , 其中, VI , V2都用 于写入和读取心跳数据, 也可以写入和读取服务器的主备用状态, DB 则 用于记录用户数据。 VI、 V2及 DB的大小可以自定义, 可以根据具体需 要来进行规划。 例如, VI、 V2 的占用空间不大, 可以为其分配较小的逻 辑空间, DB包含剩下的逻辑空间。 VI、 V2的内容组织是一样的, 如表 1 所示。
表 1
Figure imgf000005_0001
0x5A000000为正在激活
0x00005A5A为备用
0x0000005A为预备激活
2 本端写 消 无符号 每写入一条消息后该计数器累 加一次, 釆用物理 I /O 或基于操 息序列 号 整形 , 32 作系统的文件 I /O 方式写入到本 WSeq 端投票磁盘分区中
3 本端读取 无符号 每读取对端一条消息计数累加 一次, 釆用物理 I /O 方式或基于 对端消 息 整形 , 32 操作系统的文件 I /O 写入到本端 投票磁盘分区中
序 列 号 位 RSeq
4 心跳消 息 无符号 消息区长度,最大不超过 64KB 长度 整形 , 32 位
5 心跳消息 BYTES 主、 备机的心跳消息 需要说明的是, 主用状态为双机中使用磁阵提供业务的主机; 备用态为 双机中未使用磁阵提供业务的主机; 预备激活态表示的是: 备机检测到主机 故障时准备激活, 保持一段时间, 防止对端争抢, 对端检测到准备激活就不 会争抢资源升主; 正在激活态表示的是: 预备激活态结束, 开始激活资源, 挂载磁阵的状态。 服务器可通过物理的输入 /输出方式写入磁盘阵列中 ,也可通过基于操 作系统的文件输入 /输出方式写入磁盘阵列中。 在服务器写入至磁盘阵列后, 对应的一台或多台服务器读取该磁盘阵 列中服务器的心跳计数信息。 由表 1可知, 当服务器写入成功时, 该服务器的写心跳序列号需要累 加一次, 可定义一个默认的正整数, 每写入一次, 写心跳序列号加上该正 整数, 作为新的写心跳消息序列号。 而服务器每一次读取磁盘阵列的对应 的一台或多台服务器的心跳计数信息后, 服务器的读取对端心跳消息序列 号也要加上该正整数作为新的读取对端心跳消息序列号。 同理, 若对应的 一台或多台服务器每进行一次写入操作后, 对应的一台或多台服务器的写 心跳序列号加上该正整数, 作为新的写心跳消息序列号, 每进行一次读取 操作后, 对应的一台或多台服务器的读取对端心跳消息序列号也要加上该 正整数作为新的读取对端心跳消息序列号。
S102、 读取所述对应的一台或多台服务器写入至所述磁盘阵列中的所 述对应的一台或多台服务器的心跳计数信息, 重复所述写入和读取操作。
以双机热备为例, 若该服务器是主机, 则对应的服务器是备机, 若该 服务器是备机, 则对应的服务器是主机。 以该服务器是主机, 对应服务器 是备机为例, 当备机写入心跳计数信息至磁盘阵列后, 主机读取备机写入 的心跳计数信息。 读取的心跳计数信息与主机写入的心跳计数信息类型一 致。 为了方便说明, 将主机的写心跳消息序列号定义为 WSeql , 主机的读 取对端心跳消息序列号定义为 RSeql , 备机,的写心跳消息序列号定义为 WSeq2 , 备机的读取对端心跳消息序列号定义为 RSeq2。 整个流程可用 tl— 14时刻为例 , 具体如下:
初始化时, 定义 WSeql=RSeq2=0X0001 , WSeq2=RSeql=0X0001; tl 时刻, 主机写入心跳计数信息至 VI , 其中的心跳计数信息包括主机的 写心跳消息序列号 WSeql、 主机读取对端心跳消息序列号 RSeql、 主备状 态信息、 心跳消息和心跳消息长度, 具体地, 其中的 WSeql=0X0001 , RSeql=0X0001 , tl过程结束, WSeql 累加 1 得到 WSeql=0X0002。 进入 t2 时刻 (t2>tl ) , 备机读取 VI 中的心跳计数信息, 读取到的心跳计数 信息具体为 RSeql = WSeql =0X0001 , t2过程结束 RSeq2 累加 1 得到 RSeq2 =0X0002。 进入 t3时刻 ( t3>t2 ) , 备机写入心跳计数信息至 V2 , 备机写入的心跳计数信息包括备机的写心跳消息序列号 WSeq2、备机读取 对端心跳消息序列号 RSeq2、 主备状态信息、 心跳消息和心跳消息长度, 具体地, 其中的 WSeq2=0X0001 , RSeq2=0X0002, t3 过程结束, WSeq2 累加 1 得到 WSeq2=0X0002。 进入 t4时刻(t4>t3), 主机读取 V2中的心跳 计数信息,读取到的 RSeq2= 0X0002 , WSeq2=0X0001 , t4过程结束, RSeql 累加 1得到 0X0002。
需要说明的是,在主机每次读取磁盘阵列上的备机的心跳计数信息之 后, 主机需要判断自身存储的 WSeql与从磁盘阵列中读取到的 RSeq2是 否相等, 如果相等, 则进行下一次的写入操作, 如果不相等, 则判断判断 磁盘阵列异常。 其原因可能是第三方对磁盘阵列进行误操作, 或者是磁盘 阵列本身的故障导致。 对于此种情况, 主机将 WSeql赋值为 RSeq2 , 重新 写入至 VI , 其流程不变。 同理, 对于备机来说, 在备机每次读取磁盘阵 列上的心跳计数信息之后, 备机需要判断自身存储的 WSeq2 与从磁盘阵 列中读取到的 RSeql是否相等, 相等则进行下一次的写入操作, 不相等则 将 WSeq2赋值为 RSeql , 重新写入至 V2。 这种方式可提供一种基于磁盘 阵列的心跳保护机制, 对于磁盘阵列异常处理有很强的自愈能力。 对于心跳链路故障时, 其主机或者备机与磁盘阵列的链路是故障的 , 即使脑裂情况出现, 故障主机或者备机也无法访问磁阵, 因此, 也就不会 同时对磁盘阵列进行读写, 有效保护数据安全。
本实施例提供的对实现高可用集群的心跳服务的方法, 主机和备机对 用于存储心跳计数信息的磁盘进行读写操作, 解决了脑裂的问题, 提高了 数据保护的安全性。 本发明实施例二:
如图 2所示, 在本实施例中, 对实现高可用集群的心跳服务的方法流 程如下:
S201、 将磁盘阵列规划为 N个逻辑盘;
对于一个基于磁盘阵列的方式的高可用集群来说,磁盘阵列方式主要 通过磁盘阵列提供切换后, 对数据完整性和连续性的保障。 用户数据一般 会放在磁盘阵列上, 当主机宕机后,备机继续从磁盘阵列上取得原有数据。
对于双机热备(基于高可用的两台服务器的热备份)来说, 某一项业 务需要两台服务器来执行, 一台处于激活状态, 即主服务器, 简称主机, 另外一台处理待命状态, 及备服务器, 简称备机。
以双机热备为例, 将磁盘阵列规划为 3 个逻辑盘, 这里分别命名为 VI , V2及 DB , 其中, VI , V2都用于写入和读取心跳数据, 也可以写入 和读取服务器的主备用状态, DB则用于记录用户数据。 VI、 V2及 DB的 大小可以自定义, 可以根据具体需要来进行规划。 例如, VI、 V2 的占用 空间不大, 可以为其分配较小的逻辑空间, DB包含剩下的逻辑空间。 VI、 V2的内容组织是一样的, 如实施例 1的表 1所示。
需要说明的是, 对于主机个数大于 2的高可用多集群来说, 磁盘阵列 规划的逻辑盘个数为 N, N为大于 3的正整数。
S202、 主机写入心跳计数信息至 VI;
主机通过物理的输入 /输出读写方式将心跳计数信息写入至 VI , 也可 以通过基于操作系统的文件输入 /输出方式将心跳计数信息写入至 VI。 其 中, 心跳计数信息包括写心跳消息序列号、 读取对端心跳消息序列号、 主 备状态信息、 心跳消息和心跳消息长度, 写心跳消息序列号每写入成功一 次之后累加 N, N为默认的正整数, 为了方便理解, 本实施例中, 写心跳 消息序列号每写入成功一次之后累加 1。 读取对端心跳消息序列号是主机 读取 V2上的备机写入的写心跳消息序列号, 主备状态信息即自身是主用 还是备用, 对于某一业务来说, 主备用的状态可以相互转化, 若主用服务 器宕机, 则备用服务器可升为主用服务器, 原来的主用服务器则降为备用 服务器。
S203、 备机读取 VI的心跳计数信息;
备机读取 VI的心跳计数信息, 将备机的读取对端心跳消息序列号赋 值为读取到的主机的写心跳消息序列号之后, 每读取成功一次, 备机的读 取对端心跳消息序列号加 1。
为了方便说明, 将主机的写心跳消息序列号定义为 WSeql , 主机的读 取对端心跳消息序列号定义为 RSeql , 备机,的写心跳消息序列号定义为 WSeq2 , 备机的读取对端心跳消息序列号定义为 RSeq2。 则主机写入心跳 计数信息至 VI之后,下一次待写入 VI的 WSeql为本次写入的 WSeql+1 ; 备机读取 VI的心跳计数信息之后, 下一次待读取的 RSeq2为本次读取的 RSeq2+l 。 例 如 , 初 始 化 时 , 定 义 WSeql=RSeq2=0X0001 , WSeq2=RSeql=0X0001 ; tl 时刻, 主机写入心跳计数信息至 VI , 其中的 心跳计数信息包括主机的写心跳消息序列号 WSeql、主机读取对端心跳消 息序列号 RSeql、 主备状态信息、 心跳消息和心跳消息长度, 具体地, 其 中的 WSeql=0X0001 , RSeql=0X0001 , tl过程结束, WSeql 累加 1 得到 WSeql=0X0002。 进入 t2时刻 ( t2>tl ) , 备机读取 VI中的心跳计数信息, 读取到的心跳计数信息具体为 RSeql = WSeql =0X0001 , t2 过程结束 RSeq2累加 1 得到 RSeq2 =0X0002。
S204、 备机写入心跳计数信息至 V2;
备机写入心跳计数信息至 V2, 具体处理同 S202。 接上例, 进入 t3时 刻 (t3>t2 ) , 备机写入心跳计数信息至 V2, 备机写入的心跳计数信息包 括备机的写心跳消息序列号 WSeq2、备机读取对端心跳消息序列号 RSeq2、 主备状态信息、心跳消息和心跳消息长度,具体地,其中的 WSeq2=0X0001 , RSeq2=0X0002 , t3过程结束, WSeq2累加 1 得到 WSeq2=0X0002。
S205、 主机读取 V2的心跳计数信息;
V2的心跳计数消息与 VI的心跳计数消息类型一致。接上例, 进入 t4 时刻(t4>t3), 主机读取 V2中的心跳计数信息, 读取到的 RSeq2= 0X0002, WSeq2=0X0001 , t4过程结束, RSeql 累加 1得到 0X0002。
若 VI , V2的原有的緩冲区已写满, 则可另申请新的緩冲区, 或者, 从第一次写入緩冲区的位置开始到 VI , V2的緩冲区的末尾依次覆盖原来 写入的信息。
S206、判断主机的写心跳消息序列号与备机的读取对端心跳消息序列 号的关系;
主机和备机都会在写入和读取之前对自身保存的写心跳消息序列号 和从磁盘阵列中读取的读取对端心跳消息序列号进行判断。由 tl一 t4时刻, RSeql、 RSeq2、 WSeql和 WSeq2的关系不难得出, 对于主机来说 WSeql 等于 RSeq2, 或者等于 RSeq2+l时, 属于正常状态, 同理, 对于备机来说, WSeq2等于 RSeql , 或者等于 RSeql+1时, 属于正常状态。 具体地, 主机 在写入之前判断 WSeql是否等于 RSeq2 , 在读取之前判断 WSeql是否等 于 RSeq2+l ; 备机在写入之前判断 WSeq2是否等于 RSeql ,在读取之前判 断 WSeq2是否等于 RSeql+l。 故在主机判断出 WSeql等于 RSeq2, 或者 等于 RSeq2+l时,服务器重复写入与读取操作。同理,在备机判断出 WSeq2 等于 RSeql ,或者等于 RSeql+1时,服务器重复写入与读取操作。接上例, t5 时刻 , 主机第 二次将心跳计数信息 写入至 VI , 此时 RSeql=WSeql=0X0002 , t5时刻结束, WSeql 累加 1 得到 WSeql=0X0003。 t6 时刻, 备机第二次读取 VI 的心跳计数信息, 此时读取的 WSeql=RSeql=0X0002。
那么, 当主机判断出 WSeql 不等于 RSeq2+l , 且不等于 RSeq2, 则 判断磁盘阵列异常。 其原因可能是第三方对磁盘阵列进行误操作, 或者是 磁盘阵列本身的故障导致。 对于此种情况, 主机将 WSeql赋值为 RSeq2 , 重新写入至 VI ,其流程不变。同理,当备机判断出 WSeq2不等于 RSeql+1 , 且不等于 RSeql , 则判断磁盘阵列异常。 备机将 WSeq2赋值为 RSeql , 重 新写入至 V2 , 其流程不变。 这种方式可提供一种基于磁盘阵列的心跳保 护机制, 对于磁盘阵列异常处理有很强的自愈能力。
对于心跳链路故障时, 其主机或者备机与磁盘阵列的链路是故障的, 即使脑裂情况出现, 故障主机或者备机也无法访问磁阵, 因此, 也就不会 同时对磁盘阵列进行读写, 有效保护数据安全。
对于多集群的情况, 可将磁盘阵列分为多个阵列 (如分配为 VI , V2, V3 , …及用于存储用户数据的 DB ) , 其流程同双机热备的流程。
本实施例提供的对实现高可用集群的心跳服务的方法, 主机和备机对 用于存储心跳计数信息的磁盘进行读写操作, 解决了脑裂的问题, 提高了 数据保护的安全性。 本发明实施例三:
本发明实施例提供一种实现高可用集群的心跳服务的服务器, 如图 3 所示, 包括:
写入单元 301 , 用于将心跳计数信息写入磁盘阵列中, 所述心跳计数 信息包括所述服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主 备状态信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读 取所述磁盘阵列中的所述服务器的心跳计数信息;
对于一个基于磁盘阵列的方式的高可用集群来说,磁盘阵列方式主要 通过磁盘阵列提供切换后, 对数据完整性和连续性的保障。 用户数据一般 会放在磁盘阵列上, 当主机宕机后,备机继续从磁盘阵列上取得原有数据。
以双机热备(基于高可用的两台服务器的热备份)为例, 将磁盘阵列 规划为 3个逻辑盘, 这里分别命名为 VI , V2及 DB , 其中, VI , V2都用 于写入和读取心跳数据, 也可以写入和读取服务器的主备用状态, DB 则 用于记录用户数据。 VI、 V2及 DB的大小可以自定义, 可以根据具体需 要来进行规划。 例如, VI、 V2 的占用空间不大, 可以为其分配较小的逻 辑空间, DB包含剩下的逻辑空间。 VI、 V2的内容组织是一样的, 如实施 例的表 1所示。
写入单元 301可通过物理的输入 /输出方式写入磁盘阵列中 ,也可通过 基于操作系统的文件输入 /输出方式写入磁盘阵列中。
当写入单元 301写入成功时, 累加单元将写心跳序列号累加一次, 可 定义一个默认的正整数, 每写入一次, 写心跳序列号加上该正整数, 作为 新的写心跳消息序列号。 而服务器的读取单元每一次读取磁盘阵列的对应 的一台或多台服务器的心跳计数信息后, 服务器的累加单元也要将服务器 的读取对端心跳消息序列号加上该正整数作为新的读取对端心跳消息序 列号。 同理, 若对应的一台或多台服务器每进行一次写入操作后, 对应的 一台或多台服务器的写心跳序列号加上该正整数, 作为新的写心跳消息序 列号, 每进行一次读取操作后, 对应的一台或多台服务器的读取对端心跳 消息序列号也要加上该正整数作为新的读取对端心跳消息序列号。
读取单元 302, 用于读取所述对应的一台或多台服务器写入至所述磁 盘阵列中的所述对应的一台或多台服务器的心跳计数信息;
所述写入单元 301和所述读取单元 302, 还分别用于重复所述写入和 读取操作。
以双机热备为例, 若该服务器是主机, 则对应的服务器是备机, 若该 服务器是备机, 则对应的服务器是主机。
以该服务器是主机, 对应服务器是备机为例, 当备机写入心跳计数信 息至磁盘阵列后, 主机的读取单元 302读取备机写入的心跳计数信息。 读 取的心跳计数信息与主机写入的心跳计数信息类型一致。
为了方便说明, 将主机的写心跳消息序列号定义为 WSeql , 主机的读 取对端心跳消息序列号定义为 RSeql , 备机的写心跳消息序列号定义为 WSeq2 , 备机的读取对端心跳消息序列号定义为 RSeq2。 整个流程可用 tl— 14时刻为例 , 具体如下:
初始化时, 定义 WSeql=RSeq2=0X0001 , WSeq2=RSeql=0X0001; tl 时刻, 主机的写入单元 301写入心跳计数信息至 VI , 其中的心跳计数 信息包括主机的写心跳消息序列号 WSeql、主机读取对端心跳消息序列号 RSeql , 主备状态信息、 心跳消息和心跳消息长度, 具体地, 其中的 WSeql=0X0001 , RSeql=0X0001 , tl过程结束, 主机的累加单元将 WSeql 累加 1 得到 WSeql=0X0002。 进入 t2时刻 ( t2>tl ) , 备机的读取单元读 取 VI中的心跳计数信息, 读取到的心跳计数信息具体为 RSeql = WSeql =0X0001 , t2 过程结束备机的累加单元将 RSeq2 累加 1 得到 RSeq2 =0X0002。 进入 t3 时刻 (t3>t2 ) , 备机的写入单元写入心跳计数信息至 V2 , 备机的写入单元写入的心跳计数信息包括备机的写心跳消息序列号 WSeq2、 备机读取对端心跳消息序列号 RSeq2、 主备状态信息、 心跳消息 和心跳消息长度, 具体地, 其中的 WSeq2=0X0001 , RSeq2=0X0002 , t3 过程结束, 备机的累加单元将 WSeq2累加 1 得到 WSeq2=0X0002。 进入 t4时刻(t4>t3), 主机的读取单元 302读取 V2中的心跳计数信息, 读取到 的 RSeq2= 0X0002 , WSeq2=0X0001 , t4过程结束,主机的累加单元将 RSeql 累加 1得到 0X0002。
需要说明的是,在主机的读取单元 302每次读取磁盘阵列上的备机的 心跳计数信息之后, 主机的判断单元需要判断自身存储的 WSeql 与从磁 盘阵列中读取到的 RSeq2是否相等, 如果相等, 则写入单元 301进行下一 次的写入操作, 如果不相等, 则判断单元判断磁盘阵列异常。 其原因可能 是第三方对磁盘阵列进行误操作, 或者是磁盘阵列本身的故障导致。 对于 此种情况, 主机的写入单元将 WSeql赋值为 RSeq2 , 重新写入至 VI , 其 流程不变。 同理, 对于备机来说, 在备机的读取单元每次读取磁盘阵列上 的心跳计数信息之后, 备机的判断单元需要判断自身存储的 WSeq2 与从 磁盘阵列中读取到的 RSeql是否相等, 相等则进行下一次的写入操作, 不 相等则备机的写入单元将 WSeq2赋值为 RSeql , 重新写入至 V2。 这种方 式可提供一种基于磁盘阵列的心跳保护机制, 对于磁盘阵列异常处理有很 强的自愈能力。
主机和备机判断单元进行判断的另外一种方式可以是: 主机和备机的判 断单元都会在写入单元写入和读取单元读取之前对自身保存的写心跳消 息序列号和从磁盘阵列中读取的读取对端心跳消息序列号进行判断。 由 tl一 t4时刻, RSeql、 RSeq2、 WSeql和 WSeq2的关系不难得出, 对于主 机来说 WSeql等于 RSeq2 , 或者等于 RSeq2+l时,属于正常状态, 同理, 对于备机来说, WSeq2等于 RSeql , 或者等于 RSeql+1时, 属于正常状 态。 具体地, 主机在写入单元写入之前通过判断单元判断 WSeql是否等 于 RSeq2 , 在读取单元读取之前通过判断单元判断 WSeql 是否等于 RSeq2+l ; 备机在写入单元写入之前通过判断单元判断 WSeq2是否等于 RSeql , 在读取单元读取之前通过判断单元判断 WSeq2 是否等于 RSeql+l。 故在主机的判断单元判断出 WSeql 等于 RSeq2 , 或者等于 RSeq2+l 时, 主机的写入单元进行下一次写入操作, 读取单元进行下一 次读取操作。 同理, 在备机的判断单元判断出 WSeq2等于 RSeql , 或者 等于 RSeql+1 时, 备机的写入单元进行下一次写入操作, 读取单元进行 下一次读取操作。那么, 当主机判断单元判断出 WSeql不等于 RSeq2+l , 且不等于 RSeq2 , 则判断磁盘阵列异常。 其原因可能是第三方对磁盘阵 列进行误操作, 或者是磁盘阵列本身的故障导致。 对于此种情况, 主机 将写入单元将 WSeql赋值为 RSeq2 ,重新写入至 VI ,其流程不变。 同理, 当备机判断单元判断出 WSeq2不等于 RSeql+1 , 且不等于 RSeql , 则判 断磁盘阵列异常。备机写入单元将 WSeq2赋值为 RSeql ,重新写入至 V2 , 其流程不变。
对于心跳链路故障时, 其主机或者备机与磁盘阵列的链路是故障的, 即使脑裂情况出现, 故障主机或者备机也无法访问磁阵, 因此, 也就不会 同时对磁盘阵列进行读写, 有效保护数据安全。
本实施例提供的对实现高可用集群的心跳服务的服务器, 服务器的写 入单元对用于存储心跳计数信息的磁盘进行写操作, 服务器的读取单元对 用于存储心跳计数信息的磁盘进行读操作, 解决了脑裂的问题, 提高了数 据保护的安全性。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述 描述的系统, 设备和单元的具体工作过程, 可以参考前述方法实施例中的 对应过程, 在此不再赘述。
本领域普通技术人员可以理解: 附图只是一个实施例的示意图, 附图 中的单元或流程并不一定是实施本发明所必须的。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 设备 和方法, 可以通过其它的方式实现。 例如, 以上所描述的设备实施例仅仅 是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实 现时可以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成 到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论 的相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 设备或单 元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。 上述集成的单元既可以釆用硬件的形式实现, 也可以釆用硬 件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元, 可以存储在一个计算 机可读取存储介质中。 上述软件功能单元存储在一个存储介质中, 包括若 干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络 设备等)执行本发明各个实施例所述方法的部分步骤。 而前述的存储介质 包括: U盘、 移动硬盘、 只读存储器 (Read-Only Memory, 简称 ROM ) 、 随机存取存储器 (Random Access Memory, 简称 RAM ) 、 磁碟或者光盘 等各种可以存储程序代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权利要求
1、 一种实现高可用集群的心跳服务的方法, 其特征在于, 包括: 服务器将心跳计数信息写入磁盘阵列中, 所述心跳计数信息包括所述 服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主备状态信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读取所述磁盘阵 列中的所述服务器的心跳计数信息;
读取所述对应的一台或多台服务器写入至所述磁盘阵列中的所述对 应的一台或多台服务器的心跳计数信息, 重复所述写入和读取操作。
2、 根据权利要求 1所述的方法, 其特征在于,
所述服务器每进行一次写入操作之后, 将所述服务器的写心跳消息序 列号加上一个默认的正整数作为所述服务器的新的写心跳消息序列号; 所述服务器每进行一次读取操作之后, 将所述服务器的读取对端心跳 消息序列号加上所述默认的正整数作为所述服务器的新的读取对端心跳 消息序列号, 并在判断出自身储存的写心跳消息序列号与在所述磁盘阵列 中读取的所述对应一台或多台服务器的读取对端心跳消息序列号相等之 后, 进行下一次写入操作。
3、 根据权利要求 2所述的方法, 其特征在于,
所述对应的一台或多台服务器每进行一次写入操作之后, 将所述对应 的一台或多台服务器的写心跳消息序列号加上所述默认的正整数作为对 应的一台或多台服务器的新的写心跳消息序列号;
所述对应的一台或多台服务器每进行一次读取操作之后, 将所述对应 的一台或多台服务器的读取对端心跳消息序列号加上所述默认的正整数 作为所述对应的一台或多台服务器的新的读取对端心跳消息序列号, 并在 判断出自身储存的写心跳消息序列号与在所述磁盘阵列中读取的所述服 务器的读取对端心跳消息序列号相等之后, 进行下一次写入操作。
4、 根据权利要求 1所述的方法, 其特征在于,
所述对应的一台或多台服务器每进行一次写入操作之后, 将所述对应 的一台或多台服务器的写心跳消息序列号加上一个默认的正整数作为对 应的一台或多台服务器的新的写心跳消息序列号;
所述对应的一台或多台服务器每进行一次读取操作之后, 将所述对应 的一台或多台服务器的读取对端心跳消息序列号加上所述默认的正整数 作为所述对应的一台或多台服务器的新的读取对端心跳消息序列号, 并在 判断出自身储存的写心跳消息序列号与在所述磁盘阵列中读取的所述服 务器的读取对端心跳消息序列号相等之后, 进行下一次写入操作。
5、 根据权利要求 2或 3所述的方法, 其特征在于, 当所述服务器判 断出所述服务器自身存储的写心跳消息序列号不等于在所述磁盘阵列中 读取的所述对应的一台或多台服务器的读取对端心跳消息序列号后, 所述 方法进一步包括:
所述服务器判断所述磁盘阵列状态异常, 将所述服务器自身存储的写 心跳消息序列号赋值为在所述磁盘阵列中读取的所述对应的一台或多台 服务器的读取对端心跳消息序列号;
将所述赋值之后的写心跳消息序列号写入所述磁盘阵列中。
6、 根据权利要求 3— 5任一项所述的方法, 其特征在于, 当所述对应 的一台或多台服务器判断出所述对应的一台或多台服务器自身存储的写 心跳消息序列号不等于在所述磁盘阵列中读取的所述服务器的读取对端 心跳消息序列号后, 所述方法进一步包括:
所述对应的一台或多台服务器判断所述磁盘阵列状态异常, 将所述对 应的一台或多台服务器自身存储的写心跳消息序列号赋值为在所述磁盘 阵列中读取的所述服务器的读取对端心跳消息序列号;
将所述赋值之后的写心跳消息序列号写入所述磁盘阵列中。
7、 根据权利要求 1所述的方法, 其特征在于,
所述服务器每进行一次写入操作之前, 判断自身储存的写心跳消息序 列号与在所述磁盘阵列中读取的所述对应一台或多台服务器的读取对端 心跳消息序列号相等;
所述服务器每进行一次写入操作之后, 将所述服务器的写心跳消息序 列号加上一个默认的正整数作为所述服务器的新的写心跳消息序列号; 所述服务器每进行一次读取操作之前, 判断自身储存的写心跳消息序 列号等于在所述磁盘阵列中读取的所述对应一台或多台服务器的读取对 端心跳消息序列号与所述默认的正整数之和;
所述服务器每进行一次读取操作之后, 将所述服务器的读取对端心跳 消息序列号加上所述默认的正整数作为所述服务器的新的读取对端心跳 消息序列号。
8、 根据权利要求 7所述的方法, 其特征在于,
所述对应的一台或多台服务器每进行一次写入操作之前, 判断自身储 存的写心跳消息序列号与在所述磁盘阵列中读取的所述服务器的读取对 端心跳消息序列号相等;
所述对应的一台或多台服务器每进行一次写入操作之后, 将所述对应 的一台或多台服务器的写心跳消息序列号加上所述默认的正整数作为对 应的一台或多台服务器的新的写心跳消息序列号;
所述对应的一台或多台服务器每进行一次读取操作之前, 判断自身储 存的写心跳消息序列号等于在所述磁盘阵列中读取的所述服务器的读取 对端心跳消息序列号与所述默认的正整数之和;
所述对应的一台或多台服务器每进行一次读取操作之后, 将所述对应 的一台或多台服务器的读取对端心跳消息序列号加上所述默认的正整数 作为所述对应的一台或多台服务器的新的读取对端心跳消息序列号。
9、 根据权利要求 1所述的方法, 其特征在于,
所述对应的一台或多台服务器每进行一次写入操作之前, 判断自身储 存的写心跳消息序列号与在所述磁盘阵列中读取的所述服务器的读取对 端心跳消息序列号相等;
所述对应的一台或多台服务器每进行一次写入操作之后, 将所述对应 的一台或多台服务器的写心跳消息序列号加上一个默认的正整数作为对 应的一台或多台服务器的新的写心跳消息序列号;
所述对应的一台或多台服务器每进行一次读取操作之前, 判断自身储 存的写心跳消息序列号等于在所述磁盘阵列中读取的所述服务器的读取 对端心跳消息序列号与所述默认的正整数之和;
所述对应的一台或多台服务器每进行一次读取操作之后, 将所述对应 的一台或多台服务器的读取对端心跳消息序列号加上所述默认的正整数 作为所述对应的一台或多台服务器的新的读取对端心跳消息序列号。
10、 根据权利要求 7或 8所述的方法, 其特征在于, 当所述服务器判 断出所述服务器自身存储的写心跳消息序列号不等于在所述磁盘阵列中 读取的所述对应的一台或多台服务器的读取对端心跳消息序列号, 且所述 服务器自身存储的写心跳消息序列号不等于在所述磁盘阵列中读取的所 述对应的一台或多台服务器的读取对端心跳消息序列号与所述默认的正 整数的和之后, 所述方法进一步包括:
所述服务器判断所述磁盘阵列状态异常, 将所述服务器自身存储的写 心跳消息序列号赋值为在所述磁盘阵列中读取的所述对应的一台或多台 服务器的读取对端心跳消息序列号;
将所述赋值之后的写心跳消息序列号写入所述磁盘阵列中。
11、 根据权利要求 8— 10任一项所述的方法, 其特征在于, 当所述对 应的一台或多台服务器判断出所述对应的一台或多台服务器自身存储的 写心跳消息序列号不等于在所述磁盘阵列中读取的所述服务器的读取对 端心跳消息序列号, 且所述对应的一台或多台服务器自身存储的写心跳消 息序列号不等于在所述磁盘阵列中读取的所述服务器的读取对端心跳消 息序列号与所述默认的正整数的和之后, 所述方法进一步包括:
所述对应的一台或多台服务器判断所述磁盘阵列状态异常, 将所述对 应的一台或多台服务器自身存储的写心跳消息序列号赋值为在所述磁盘 阵列中读取的所述服务器的读取对端心跳消息序列号;
将所述赋值之后的写心跳消息序列号写入所述磁盘阵列中。
12、 根据权利要求 1 11任一项所述的方法, 其特征在于, 所述写入 和读取操作, 包括:
所述服务器通过物理的输入 /输出方式对所述磁盘阵列进行所述写入 和读取操作。
13、 根据权利要求 1 1 1任一项所述的方法, 其特征在于, 所述写入 和读取操作, 包括:
所述服务器通过基于操作系统的文件输入 /输出方式对所述磁盘阵列 进行所述写入和读取操作。
14、 一种实现高可用集群的心跳服务的服务器, 其特征在于, 包括: 写入单元, 用于将心跳计数信息写入磁盘阵列中, 所述心跳计数信息 包括所述服务器的写心跳消息序列号、 读取对端心跳消息序列号、 主备状 态信息、 心跳消息和心跳消息长度, 以便对应的一台或多台服务器读取所 述磁盘阵列中的所述服务器的心跳计数信息; 读取单元, 用于读取所述对 应的一台或多台服务器写入至所述磁盘阵列中的所述对应的一台或多台 服务器的心跳计数信息,
所述写入单元和所述读取单元, 还分别用于重复所述写入和读取操 作。
15、 根据权利要求 14 所述的服务器, 其特征在于, 所述服务器还包 括:
累加单元, 用于所述服务器每进行一次写入操作之后, 将所述服务器 的写心跳消息序列号加上一个默认的正整数作为所述服务器的新的写心 跳消息序列号;
所述累加单元还用于所述服务器每进行一次读取操作之后, 将所述服 务器的读取对端心跳消息序列号加上所述默认的正整数作为所述服务器 的新的读取对端心跳消息序列号;
判断单元, 用于判断自身储存的写心跳消息序列号与在所述磁盘阵列 中读取的所述对应一台或多台服务器的读取对端心跳消息序列号相等; 所述写入单元还用于在所述判断单元判断自身储存的写心跳消息序 列号与在所述磁盘阵列中读取的所述对应一台或多台服务器的读取对端 心跳消息序列号相等后, 进行下一次写入操作。
16、 根据权利要求 15 所述的服务器, 其特征在于, 所述对应的一台 或多台服务器还包括:
累加单元, 用于所述对应的一台或多台服务器每进行一次写入操作之 后, 将所述对应的一台或多台服务器的写心跳消息序列号加上所述默认的 正整数作为对应的一台或多台服务器的新的写心跳消息序列号;
所述累加单元还用于所述对应的一台或多台服务器每进行一次读取 操作之后, 将所述对应的一台或多台服务器的读取对端心跳消息序列号加 上所述默认的正整数作为所述对应的一台或多台服务器的新的读取对端 心跳消息序列号;
判断单元, 用于判断自身储存的写心跳消息序列号与在所述磁盘阵列 中读取的所述服务器的读取对端心跳消息序列号相等;
所述写入单元还用于在所述判断单元判断自身储存的写心跳消息序 列号与在所述磁盘阵列中读取的所述服务器的读取对端心跳消息序列号 相等后, 进行下一次写入操作。
17、 根据权利要求 15或 16所述的服务器, 其特征在于, 当所述服务 器判断出所述服务器自身存储的写心跳消息序列号不等于在所述磁盘阵 列中读取的所述对应的一台或多台服务器的读取对端心跳消息序列号后, 所述服务器的写入单元进行写入操作, 进一步包括:
所述判断单元判断所述磁盘阵列状态异常, 将所述服务器自身存储的 写心跳消息序列号赋值为在所述磁盘阵列中读取的所述对应的一台或多 台服务器的读取对端心跳消息序列号, 将所述赋值之后的写心跳消息序列 号写入所述磁盘阵列中。
18、 根据权利要求 15— 17 任一项所述的服务器, 其特征在于, 当所 述对应的一台或多台服务器判断出所述对应的一台或多台服务器自身存 储的写心跳消息序列号不等于在所述磁盘阵列中读取的所述服务器的读 取对端心跳消息序列号后, 所述对应的一台或多台服务器的写入单元进行 写入操作, 进一步包括:
所述对应的一台或多台服务器判断所述磁盘阵列状态异常, 将所述对 应的一台或多台服务器自身存储的写心跳消息序列号赋值为在所述磁盘 阵列中读取的所述服务器的读取对端心跳消息序列号;
将所述赋值之后的写心跳消息序列号写入所述磁盘阵列中。
19、 根据权利要求 14 所述的服务器, 其特征在于, 所述服务器还包 括:
判断单元, 用于在所述写入单元每进行一次写入操作之前, 判断自身 储存的写心跳消息序列号与在所述磁盘阵列中读取的所述对应一台或多 台服务器的读取对端心跳消息序列号相等;
累加单元, 用于在所述写入单元每进行一次写入操作之后, 将所述服 务器的写心跳消息序列号加上一个默认的正整数作为所述服务器的新的 写心跳消息序列号;
所述判断单元还用于在所述读取单元每进行一次读取操作之前, 判断 自身储存的写心跳消息序列号等于在所述磁盘阵列中读取的所述对应一 台或多台服务器的读取对端心跳消息序列号与所述默认的正整数之和; 所述累加单元还用于在所述读取单元每进行一次读取操作之后, 将所 述服务器的读取对端心跳消息序列号加上所述默认的正整数作为所述服 务器的新的读取对端心跳消息序列号。
20、 根据权利要求 19 所述的服务器, 其特征在于, 所述对应的一台 或多台服务器还包括:
判断单元, 用于在所述写入单元每进行一次写入操作之前, 判断自身 储存的写心跳消息序列号与在所述磁盘阵列中读取的所述服务器的读取 对端心跳消息序列号相等;
累加单元, 用于在所述写入单元每进行一次写入操作之后, 将所述对 应的一台或多台服务器的写心跳消息序列号加上所述默认的正整数作为 对应的一台或多台服务器的新的写心跳消息序列号;
所述判断单元还用于在所述读取单元每进行一次读取操作之前, 判断 自身储存的写心跳消息序列号等于在所述磁盘阵列中读取的所述服务器 的读取对端心跳消息序列号与所述默认的正整数之和;
所述累加单元还用于在所述读取单元每进行一次读取操作之后, 将所 述对应的一台或多台服务器的读取对端心跳消息序列号加上所述默认的 正整数作为所述对应的一台或多台服务器的新的读取对端心跳消息序列 号。
21、 根据权利要求 19或 20所述的服务器, 其特征在于, 当所述服务 器的判断单元判断出所述服务器自身存储的写心跳消息序列号不等于在 所述磁盘阵列中读取的所述对应的一台或多台服务器的读取对端心跳消 息序列号, 且所述服务器自身存储的写心跳消息序列号不等于在所述磁盘 阵列中读取的所述对应的一台或多台服务器的读取对端心跳消息序列号 与所述默认的正整数的和之后, 所述服务器还包括:
所述判断单元判断所述磁盘阵列状态异常, 所述写入单元将所述服务 器自身存储的写心跳消息序列号赋值为在所述磁盘阵列中读取的所述对 应的一台或多台服务器的读取对端心跳消息序列号, 将所述赋值之后的写 心跳消息序列号写入所述磁盘阵列中。
22、 根据权利要求 20或 21所述的服务器, 其特征在于, 当所述对应 的一台或多台服务器的判断单元判断出所述对应的一台或多台服务器自 身存储的写心跳消息序列号不等于在所述磁盘阵列中读取的所述服务器 的读取对端心跳消息序列号, 且所述对应的一台或多台服务器自身存储的 写心跳消息序列号不等于在所述磁盘阵列中读取的所述服务器的读取对 端心跳消息序列号与所述默认的正整数的和之后, 所述服务器还包括: 所述对应的一台或多台服务器的判断单元判断所述磁盘阵列状态异 常, 所述对应的一台或多台服务器的写入单元将所述对应的一台或多台服 务器自身存储的写心跳消息序列号赋值为在所述磁盘阵列中读取的所述 服务器的读取对端心跳消息序列号, 将所述赋值之后的写心跳消息序列号 写入所述磁盘阵列中。
23、 根据权利要求 14 22任一项所述的服务器, 其特征在于, 所述写入单元和所述读取单元通过物理的输入 /输出方式对所述磁盘 阵列进行所述写入和读取操作。
24、 根据权利要求 14 22任一项所述的服务器, 其特征在于, 所述写入单元和所述读取单元通过基于操作系统的文件输入 /输出方 式对所述磁盘阵列进行所述写入和读取操作。
PCT/CN2013/070155 2012-06-29 2013-01-07 一种实现高可用集群的心跳服务的方法及装置 WO2014000430A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/584,342 US9658912B2 (en) 2012-06-29 2014-12-29 Method and apparatus for implementing heartbeat service of high availability cluster

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210222114.1 2012-06-29
CN201210222114.1A CN102799394B (zh) 2012-06-29 2012-06-29 一种实现高可用集群的心跳服务的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/584,342 Continuation US9658912B2 (en) 2012-06-29 2014-12-29 Method and apparatus for implementing heartbeat service of high availability cluster

Publications (1)

Publication Number Publication Date
WO2014000430A1 true WO2014000430A1 (zh) 2014-01-03

Family

ID=47198511

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/070155 WO2014000430A1 (zh) 2012-06-29 2013-01-07 一种实现高可用集群的心跳服务的方法及装置

Country Status (3)

Country Link
US (1) US9658912B2 (zh)
CN (1) CN102799394B (zh)
WO (1) WO2014000430A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308239A (zh) * 2018-09-26 2019-02-05 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN114844809A (zh) * 2022-04-18 2022-08-02 北京凝思软件股份有限公司 基于网络心跳和内核磁盘心跳的多因子仲裁方法、装置

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5687173B2 (ja) * 2011-11-15 2015-03-18 株式会社日立製作所 通信システム及び方法、ハートビート代行サーバ
CN102799394B (zh) 2012-06-29 2015-02-25 华为技术有限公司 一种实现高可用集群的心跳服务的方法及装置
CN103051470B (zh) * 2012-11-29 2015-10-07 中标软件有限公司 一种集群及其磁盘心跳的控制方法
CN103209095B (zh) * 2013-03-13 2017-05-17 广东中兴新支点技术有限公司 一种基于磁盘服务锁的裂脑预防的方法和装置
CN103684941B (zh) * 2013-11-23 2018-01-16 广东中兴新支点技术有限公司 基于仲裁服务器的集群裂脑预防方法和装置
US10102088B2 (en) * 2013-12-25 2018-10-16 Nec Solution Innovators, Ltd. Cluster system, server device, cluster system management method, and computer-readable recording medium
US9450852B1 (en) * 2014-01-03 2016-09-20 Juniper Networks, Inc. Systems and methods for preventing split-brain scenarios in high-availability clusters
CN103905247B (zh) * 2014-03-10 2017-02-01 北京交通大学 一种基于多客户裁决的双机备份方法及系统
TWI560558B (en) * 2015-06-08 2016-12-01 Synology Inc Method for managing a storage system, and associated apparatus
JP6409812B2 (ja) * 2016-04-01 2018-10-24 横河電機株式会社 冗長化装置、冗長化システム、及び冗長化方法
JP6662185B2 (ja) 2016-04-28 2020-03-11 横河電機株式会社 処理装置、代替処理装置、中継装置、処理システム及び処理方法
CN106452696A (zh) * 2016-10-28 2017-02-22 郑州云海信息技术有限公司 一种服务器集群的控制系统
CN108243031B (zh) * 2016-12-23 2021-05-25 大唐移动通信设备有限公司 一种双机热备的实现方法及装置
US10764118B1 (en) 2018-01-05 2020-09-01 Open Invention Network Llc EMS resolution of split-brain virtual network function components
CN108897645B (zh) * 2018-06-12 2021-07-27 郑州云海信息技术有限公司 一种基于备用心跳磁盘的数据库集群容灾方法和系统
US11558454B2 (en) 2018-07-31 2023-01-17 Hewlett Packard Enterprise Development Lp Group leader role queries
CN109286525B (zh) * 2018-09-28 2022-02-25 昆明能讯科技有限责任公司 一种基于mqtt通讯和主备之间心跳的双机备份方法
US11003369B1 (en) 2019-01-14 2021-05-11 Pure Storage, Inc. Performing a tune-up procedure on a storage device during a boot process
CN115599316B (zh) * 2022-12-15 2023-03-21 南京鹏云网络科技有限公司 分布式数据处理方法、装置、设备、介质和计算机程序产品

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050392A1 (en) * 2003-08-26 2005-03-03 Tsunehiko Baba Failover method in a redundant computer system with storage devices
CN101465769A (zh) * 2009-01-16 2009-06-24 华中科技大学 双控制器磁盘阵列的动态故障检测系统
CN101916217A (zh) * 2010-08-04 2010-12-15 中兴通讯股份有限公司 多控制器切换的方法、控制装置及系统
CN102799394A (zh) * 2012-06-29 2012-11-28 华为技术有限公司 一种实现高可用集群的心跳服务的方法及装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7421478B1 (en) * 2002-03-07 2008-09-02 Cisco Technology, Inc. Method and apparatus for exchanging heartbeat messages and configuration information between nodes operating in a master-slave configuration
US7587465B1 (en) * 2002-04-22 2009-09-08 Cisco Technology, Inc. Method and apparatus for configuring nodes as masters or slaves
US6721907B2 (en) * 2002-06-12 2004-04-13 Zambeel, Inc. System and method for monitoring the state and operability of components in distributed computing systems
US7420952B2 (en) * 2002-10-28 2008-09-02 Mesh Dynamics, Inc. High performance wireless networks using distributed control
US9026575B2 (en) * 2006-09-28 2015-05-05 Alcatel Lucent Technique for automatically configuring a communication network element
CN101234018B (zh) * 2008-02-26 2010-07-14 中兴通讯股份有限公司 心跳检测方法、系统和中央处理单元
US8098572B2 (en) * 2009-02-03 2012-01-17 Google Inc. Interface monitoring for link aggregation
CN102036349B (zh) * 2009-09-29 2015-03-25 联想(北京)有限公司 维持终端和网络服务器连接的方法、终端及网络服务器
CN102014416B (zh) * 2010-12-03 2014-07-16 中兴通讯股份有限公司 一种对连接进行双向检测的方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050392A1 (en) * 2003-08-26 2005-03-03 Tsunehiko Baba Failover method in a redundant computer system with storage devices
CN101465769A (zh) * 2009-01-16 2009-06-24 华中科技大学 双控制器磁盘阵列的动态故障检测系统
CN101916217A (zh) * 2010-08-04 2010-12-15 中兴通讯股份有限公司 多控制器切换的方法、控制装置及系统
CN102799394A (zh) * 2012-06-29 2012-11-28 华为技术有限公司 一种实现高可用集群的心跳服务的方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308239A (zh) * 2018-09-26 2019-02-05 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN114844809A (zh) * 2022-04-18 2022-08-02 北京凝思软件股份有限公司 基于网络心跳和内核磁盘心跳的多因子仲裁方法、装置
CN114844809B (zh) * 2022-04-18 2024-05-07 北京凝思软件股份有限公司 基于网络心跳和内核磁盘心跳的多因子仲裁方法、装置

Also Published As

Publication number Publication date
US9658912B2 (en) 2017-05-23
CN102799394B (zh) 2015-02-25
CN102799394A (zh) 2012-11-28
US20150113340A1 (en) 2015-04-23

Similar Documents

Publication Publication Date Title
WO2014000430A1 (zh) 一种实现高可用集群的心跳服务的方法及装置
US11645173B2 (en) Resilient mediation between storage systems replicating a dataset
US9916113B2 (en) System and method for mirroring data
WO2018121456A1 (zh) 一种数据存储方法、服务器以及存储系统
US8713127B2 (en) Techniques for distributed storage aggregation
US10146632B2 (en) Efficient mechanism to replicate data for multiple controllers
CN102867035B (zh) 一种分布式文件系统集群高可用方法和装置
US11347603B2 (en) Service takeover method, storage device, and service takeover apparatus
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
US11379127B2 (en) Method and system for enhancing a distributed storage system by decoupling computation and network tasks
KR101983208B1 (ko) 데이터 관리 방법, 노드, 그리고 데이터베이스 클러스터를 위한 시스템
CN107463342B (zh) 一种cdn边缘节点文件的存储方法及装置
CN103942112A (zh) 磁盘容错方法、装置及系统
CN104750428A (zh) 块储存存取和网关模块、储存系统和方法与内容递送装置
US11409471B2 (en) Method and apparatus for performing data access management of all flash array server
US10067841B2 (en) Facilitating n-way high availability storage services
CN117061535A (zh) 多活构架数据同步方法、装置、计算机设备和存储介质
CN106020975B (zh) 数据操作方法、装置和系统
US20190028542A1 (en) Method and device for transmitting data
CN110413686A (zh) 一种数据写入方法、装置、设备及存储介质
CN117555493B (zh) 数据处理方法、系统、装置、存储介质及电子设备
CN102541699B (zh) 失效备援信息管理装置和控制方法以及存储处理装置
CN117827115A (zh) 基于nas的存储系统及管理方法、装置、设备、介质
CN116560905A (zh) 数据备份系统、方法和设备
CN116991812A (zh) 文件压缩方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13809422

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13809422

Country of ref document: EP

Kind code of ref document: A1