CN108600284A - A kind of virtual machine high availability implementation method and system based on Ceph - Google Patents
A kind of virtual machine high availability implementation method and system based on Ceph Download PDFInfo
- Publication number
- CN108600284A CN108600284A CN201711463859.6A CN201711463859A CN108600284A CN 108600284 A CN108600284 A CN 108600284A CN 201711463859 A CN201711463859 A CN 201711463859A CN 108600284 A CN108600284 A CN 108600284A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- mirror image
- exclusive lock
- heartbeat
- server
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
- H04L43/106—Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Cardiology (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Hardware Redundancy (AREA)
Abstract
The invention discloses a kind of virtual machine high availability implementation method and system based on Ceph, are related to field of cloud computer technology.Method includes the following steps:Control node server sends virtual machine High Availabitity configuration information in real time to all calculate node servers;After each calculate node server obtains the exclusive lock of mirror image in real time, record is stabbed using the first heart time of the virtual machine of the mirror image;If the first heartbeat timeout of the exclusive lock of mirror image and the virtual machine using the mirror image cannot be obtained, the virtual machine is closed;Simultaneously or after, the exclusive lock for the mirror image being acquired is broken in control node server timing, and records and stabbed using the second heart time of the virtual machine of the mirror image;When the exclusive lock of mirror image is not acquired and uses the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be restarted to other calculate node servers.The present invention realizes virtual machine High Availabitity by detecting the heartbeat of virtual machine.
Description
Technical field
The present invention relates to field of cloud computer technology, are specifically related to a kind of virtual machine high availability implementation method based on Ceph
And system.
Background technology
In cloud computation data center, virtual machine is normally operated on physical server, when physical server powers off or occurs
When other failures, the virtual machine run on it can be also closed, and the customer service run in virtual machine is caused to be interrupted accidentally.
If ensureing automatically restore after customer service is interrupted accidentally, the state for monitoring virtual machine in real time is needed, in physics
When server fail, virtual machine thereon is transferred on other physical servers and is restarted, this is known as virtual machine height
It can use.
In traditional data center, virtual machine High Availabitity needs to store the disk file of virtual machine using shared storage,
So that the disk file in shared storage can be accessed in all physical servers, to detect physical server power-off
Afterwards, the physical server of other normal operations can read the disk file of virtual machine from shared storage and restart virtual
Machine.
In order to detect the state of virtual machine in real time, need to introduce heartbeat detection mechanism, when the heartbeat that can't detect virtual machine
When, illustrate that the virtual machine has been switched off, to which one physical server being currently running of selection restarts the virtual machine.It is based on
The virtual machine heartbeat detection mechanism of shared storage is generally as follows:
One lock space file of distribution, distribute the lock space file for each physical server one piece in shared storage
Region is locked as the heartbeat of the physical server, and timestamp is written its corresponding heartbeat and locked by each physical server timing.
It is that each magnetic disk of virtual machine distributes a resource file, and gives each physical server pre- in the resource file in shared storage
It stays one piece of region as resource lock, the resource file for first checking the virtual machine is needed before virtual machine starts on physical server
Whether it has been locked and (has checked and whether there is a resource lock in resource file), if unlocked, by this physical server
Resource lock write-in virtual machine resource file in, and start virtual machine;If locked, check the resource lock whether mistake
Phase (checks whether the heartbeat lock for the physical server for holding the resource lock is expired), if resource lock is not out of date, cannot open
Dynamic virtual machine;If resource lock is expired, the resource lock is seized, the resource lock of this physical server is written to the resource of virtual machine
In file, and start virtual machine.
It is that the physical server for running virtual machine is responsible for locking this virtually based on shared storage virtual machine High Availabitity essence
The resource file of machine, and timing updates its heartbeat lock, and virtual machine is closed when updating heartbeat lock failure.Control node server is negative
Whether the resource lock in duty detection resources of virtual machine file is expired, when resource lock is expired by the scheduling virtual machine to other physics
Start on server.
With popularizing for distributed storage, more and more cloud computation data centers substitute shared deposits using distributed storage
Storage.The characteristic of distributed storage is magnetic disk of virtual machine file being divided into many objects, and each object has n copy to disperse to deposit
It stores up on the disk of n physical server (n is usually 3).Lock space file and resource file are created in distributed storage,
Many objects can be divided into, and disperse storage to n physical server disk, and lock space file, resource file and void
The object of quasi- machine disk file is not necessarily mapped on identical physical server disk, when the copy of heartbeat lock may have access to
When, the copy that can not represent magnetic disk of virtual machine file may have access to, therefore can not use the scheme of shared storage, be locked by detecting
Space file and resource file realize virtual machine High Availabitity.
Invention content
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of, and the virtual machine height based on Ceph can
With realization method and system, the exclusive of the mirror image of local each virtual machine is obtained in real time by each calculate node server
Lock, and the first heartbeat is established for each virtual machine, and the exclusive lock for the mirror image being acquired is broken in control node server timing,
And the second heartbeat is established for each virtual machine, to realize virtual machine High Availabitity by the heartbeat for detecting virtual machine.
The present invention provides a kind of virtual machine high availability implementation method based on Ceph, is used for cloud computation data center, cloud meter
It includes a control node server and at least two calculate node servers to calculate data center, and the method includes following steps
Suddenly:
Control node server sends virtual machine High Availabitity configuration information in real time to all calculate node servers;
Each calculate node server reads the exclusive lock status of the mirror image of local each virtual machine in real time, obtains mirror image
Exclusive lock after, record using the mirror image virtual machine the first heart time stab;If the exclusive lock of mirror image cannot be obtained and made
With the first heartbeat timeout of the virtual machine of the mirror image, then the virtual machine is closed;
Simultaneously or after, the exclusive lock status of the mirror image of all virtual machines is read in control node server timing, is broken
The exclusive lock for the mirror image being acquired, and record and stabbed using the second heart time of the virtual machine of the mirror image;When the exclusive lock of mirror image
When not being acquired and use the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be counted to other
Operator node server restarts;
Each calculate node server detection is scheduled for the virtual machine of local boot, and records first heart of the virtual machine
Jump timestamp.
Based on the above technical solution, the method for the exclusive lock of calculate node server acquisition mirror image is:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information,
When exclusive lock information is empty, the exclusive lock acquisition interface provided by Ceph sets the cookie in exclusive lock information to this
The cookie of calculate node server.
Based on the above technical solution, each calculate node server detection is scheduled for the virtual of local boot
Machine, and the first heart time stamp for recording the virtual machine includes:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information,
When it is the cookie of this calculate node server that exclusive lock information, which is not cookie in empty and exclusive lock information, the void is recorded
The first heart time stamp of quasi- machine.
Based on the above technical solution, the method further includes:When in the exclusive lock information of the mirror image of virtual machine
When cookie is different from the cookie of the calculate node server, it is considered as the virtual machine of error running, calculate node server closes
Close the virtual machine.
Based on the above technical solution, control node server breaks the method for the exclusive lock for the mirror image being acquired
For:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information,
Where the cookie in exclusive lock information is the virtual machine using the mirror image when cookie of calculate node server, pass through
The exclusive lock that Ceph is provided breaks interface and empties exclusive lock information.
Based on the above technical solution, the method further includes:When in the exclusive lock information of the mirror image of virtual machine
Where cookie is different from the virtual machine when cookie of calculate node server, it is considered as the virtual machine of error running, control section
Point server notifies the calculate node server closing virtual machine.
Based on the above technical solution, the interval time of the interval time of first heartbeat and second heartbeat
It is identical or different.
Based on the above technical solution, the virtual machine High Availabitity configuration information includes virtual machine ID, virtual machine
Mirror image name and Ceph storage pool informations.
The present invention also provides a kind of system is realized using the virtual machine High Availabitity based on Ceph of the above method:
Control node server includes virtual machine High Availabitity serve end program, and each calculate node server includes virtual
Machine High Availabitity client-side program, virtual machine High Availabitity serve end program include server synchronization module, the monitoring of server-side exclusive lock
Module and server-side virtual machine heartbeat management module, each virtual machine High Availabitity client-side program include client synchronization mould
Block, client exclusive lock monitoring modular and client virtual machine heartbeat management module;
Server synchronization module is used to send virtual machine High Availabitity configuration information in real time to all clients synchronization module;
The exclusive lock shape of mirror image of each client exclusive lock monitoring modular for reading local each virtual machine in real time
After the exclusive lock for obtaining mirror image, the first heartbeat message is sent to local client virtual machine heartbeat management module for state;If cannot
The first heartbeat timeout for obtaining the exclusive lock of mirror image and the virtual machine using the mirror image, then close the virtual machine;It is additionally operable to detect
It is scheduled for the virtual machine of local boot;
Each client virtual machine heartbeat management module is used to update the of virtual machine according to the first heartbeat message of reception
One heartbeat timestamp is additionally operable to the first heart time stamp that update is scheduled for the virtual machine of local boot;
Server-side exclusive lock monitoring modular be used for periodically read all virtual machines mirror image exclusive lock status, break by
The exclusive lock of the mirror image of acquisition sends the second heartbeat message to server-side virtual machine heartbeat management module;When the exclusive lock of mirror image
When not being acquired and use the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be counted to other
Operator node server restarts;Server-side virtual machine heartbeat management module is used to update this according to the heartbeat message of reception virtual
Second heart time of machine stabs.
Compared with prior art, the present invention utilizes the exclusive lock mechanism that distributed storage itself provides, and passes through each calculating
Node server obtains the exclusive lock of the mirror image of local each virtual machine in real time, and establishes the first heartbeat for each virtual machine,
And the exclusive lock for the mirror image being acquired is broken in control node server timing, and the second heartbeat is established for each virtual machine, when
When the abnormal conditions such as some calculate node server fail or power-off, the calculate node server is in the first heartbeat timeout
The exclusive lock that the mirror image of virtual machine cannot be obtained in time, then close virtual machine.Control node server is by detecting second heart
The exclusive lock for jumping mirror image in time-out time is not acquired, is determined that virtual machine is closed, then will be used the scheduling virtual machine of the mirror image
It is restarted to other calculate node servers, to which each calculate node server and control node server pass through inspection respectively
Virtual machine High Availabitity is realized in the heartbeat for surveying virtual machine.
Description of the drawings
Fig. 1 is the virtual machine high availability implementation method flow chart of calculate node server of the embodiment of the present invention;
Fig. 2 is the virtual machine high availability implementation method flow chart of control node server of the embodiment of the present invention;
Fig. 3 is that virtual machine High Availabitity of the embodiment of the present invention based on Ceph realizes system schematic.
Reference numeral:
Virtual machine High Availabitity serve end program 1, server synchronization module 11, server-side exclusive lock monitoring modular 12, service
Hold virtual machine heartbeat management module 13, virtual machine High Availabitity client-side program 2, client synchronization module 21, client exclusive lock
Monitoring modular 22, client virtual machine heartbeat management module 23.
Specific implementation mode
The principle of the present invention is:Characteristic based on distributed storage and the exclusive lock machine provided using distributed storage itself
System.When a calculate node server obtains the exclusive lock of some mirror image, other calculate node servers will be unable to obtain again
The exclusive lock of the mirror image.Obtain the exclusive lock of the mirror image of local each virtual machine in real time by each calculate node server,
And the first heartbeat is established for each virtual machine, and the exclusive lock for the mirror image being acquired is broken in control node server timing, and
The second heartbeat is established for each virtual machine, it, should when the abnormal conditions such as some calculate node server fail or power-off
Calculate node server cannot obtain the exclusive lock of the mirror image of virtual machine within the first heartbeat timeout time, then close virtual machine.
Control node server is not acquired by detecting the exclusive lock of mirror image in the second heartbeat timeout time, determines that virtual machine is closed
It closes, then the scheduling virtual machine of the mirror image will be used to be restarted to other calculate node servers, to which each calculate node takes
Business device and control node server realize virtual machine High Availabitity by detecting the heartbeat of virtual machine respectively.
Below in conjunction with the accompanying drawings and specific embodiment the present invention is described in further detail.
The embodiment of the present invention provides a kind of virtual machine high availability implementation method based on Ceph, in cloud computing data
The heart, cloud computation data center includes a control node server and at least two calculate node servers, with Ceph distributions
For storage, the hard disk on Servers-all is organized the distributed storage service that provides by Ceph, and by preserve it is all based on
The mirror image of each virtual machine run on operator node server, wherein Servers-all includes control node server and owns
Calculate node server, it is also possible to including storage server.Magnetic disk of virtual machine file is called mirror image, each mirror image point by Ceph
For multiple objects, each object is mapped to one and puts in order group, and it is to belong to his multiple copies of Object Creation each to put in order group meeting,
And disperse on the disk for storing multiple servers, the server can be control node server, calculate node server and/
Or storage server.Each calculate node server distributes a unduplicated unique cookie.Virtual machine based on Ceph
High availability implementation method includes the following steps:
Control node server sends virtual machine High Availabitity configuration information in real time to all calculate node servers.Virtual machine
For High Availabitity configuration information by user configuration to control node server, virtual machine High Availabitity configuration information includes virtual machine ID, void
The mirror image name and Ceph storage pool informations of quasi- machine.
Each calculate node server reads the exclusive lock status of the mirror image of local each virtual machine in real time, obtains mirror image
Exclusive lock after, record using the mirror image virtual machine the first heart time stab;If the exclusive lock of mirror image cannot be obtained and made
With the first heartbeat timeout of the virtual machine of the mirror image, then the virtual machine is closed.When the exclusive lock and use that cannot obtain mirror image should
First heartbeat of the virtual machine of mirror image is not overtime, directly returns to the exclusive lock shape for the mirror image for reading local each virtual machine in real time
State.
Specifically, the method that calculate node server obtains the exclusive lock of mirror image is:The exclusive lock letter provided by Ceph
Breath reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information, and exclusive lock information includes that lock marks, lock holder
The information such as cookie, address and client identification, when exclusive lock information is empty, the exclusive lock acquisition provided by Ceph connects
Mouth sets the cookie in exclusive lock information to the cookie of this calculate node server.Wherein, the exclusive lock that Ceph is provided
It can be list_lockers functions that information, which reads interface, and list_lockers lists the calculate node server for locking the mirror image
(also referred to as client) and exclusive lock information.It can be lock_exclusive letters that the exclusive lock that Ceph is provided, which obtains interface,
Number, lock_exclusive obtain the exclusive lock of mirror image, and obtain return value.
Simultaneously or after, the exclusive lock status of the mirror image of all virtual machines is read in control node server timing, is broken
The exclusive lock for the mirror image being acquired, and record and stabbed using the second heart time of the virtual machine of the mirror image;When the exclusive lock of mirror image
When not being acquired and use the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be counted to other
Operator node server restarts.
Specifically, the method that control node server breaks the exclusive lock for the mirror image being acquired is:It is provided by Ceph
Exclusive lock information read interface read mirror image exclusive lock and parsing obtain exclusive lock information, when in exclusive lock information
When cookie is the cookie of calculate node server where the virtual machine using the mirror image, beaten by the Ceph exclusive locks provided
Broken interface empties exclusive lock information.Wherein, it can be list_lockers functions that the exclusive lock information that Ceph is provided, which reads interface,
Exclusive lock, which breaks interface, to be break_lock functions, and obtains return value.
Each calculate node server detection is scheduled for the virtual machine of local boot, and records first heart of the virtual machine
Jump timestamp.It specifically includes:The exclusive lock information provided from Ceph reads the exclusive lock of interface reading mirror image and parsing is arranged
Its lock information, when exclusive lock information is not the cookie that cookie in empty and exclusive lock information is this calculate node server
When, record the first heart time stamp of the virtual machine.
The interval time of first heartbeat is identical or different with the interval time of the second heartbeat.
In other examples, when the cookie in the exclusive lock information of the mirror image of virtual machine is different from the calculate node
When the cookie of server, it is considered as the virtual machine of error running, the calculate node server closing virtual machine.When the mirror of virtual machine
Where cookie in the exclusive lock information of picture is different from the virtual machine when cookie of calculate node server, it is considered as wrong fortune
Capable virtual machine, control node server notify the calculate node server closing virtual machine.
Wherein, the virtual machine high availability implementation method flow chart of calculate node server is shown in Figure 1, and specific steps are such as
Under:
S101. the exclusive lock status of mirror image is read.
S102 judges to read whether exclusive lock status succeeds, if it succeeds, into S103;Otherwise, into S109.Work as meter
The power-off of operator node server, suspension or when other failures occur, calculate node server is disconnected with Ceph distributed storages,
It is unsuccessful that calculate node server reads exclusive lock status.
S103. exclusive lock information is parsed.
S104. judge whether exclusive lock information is empty, if it is, into S106;Otherwise, into S105.
S105. judge whether the cookie in exclusive lock information is equal to the cookie of this calculate node server, if so,
Then enter S108;Otherwise enter S110.
S106. the cookie for obtaining the exclusive lock of the mirror image, and being arranged in the exclusive lock information of the mirror image is this calculating
The cookie of node server.
S107. judge to obtain whether exclusive lock succeeds, that is, judge whether the return value for obtaining exclusive lock interface succeeds.If
Success then enters S108;Otherwise enter S109.
S108. heartbeat message is sent, update is stabbed using the virtual machine heart time of the mirror image, into S101.
S109. check whether the heartbeat of the virtual machine using the mirror image is overtime, if it times out, into S110;Otherwise, into
Enter S101.
S110 closes the virtual machine using the mirror image.
The virtual machine high availability implementation method flow chart of control node server is shown in Figure 2, is as follows:
S201. the exclusive lock status of mirror image is read.
S202. judge to read whether exclusive lock status succeeds, if it succeeds, into S203;Otherwise enter S201.
S203. exclusive lock information is parsed.
S204. judge whether exclusive lock information is empty, if yes then enter S209;Otherwise enter S205.
S205. judge the calculate node whether cookie in exclusive lock information is equal to operation using the virtual machine of the mirror image
The cookie of server, if yes then enter S206;Otherwise enter S211.
S206. break_lock functions is called to break the exclusive lock of the mirror image.
S207. judge to break whether exclusive lock succeeds, if it succeeds, into S208;Otherwise enter S201.
S208. heartbeat message is sent, update is stabbed using the virtual machine heart time of the mirror image, into S201.
Whether use the virtual machine heartbeat of the mirror image overtime, if it times out, into S210 if S209. checking;Otherwise enter
S201。
S210. the scheduling virtual machine of the mirror image will be used to be restarted to other servers, into S201.
S211. it detects that virtual machine operates on the calculate node server of mistake, the calculate node server is notified to close
Virtual machine is closed, into S201.
It is shown in Figure 3, the embodiment of the present invention also provide it is a kind of can using the virtual machine height based on Ceph of the above method
With the system of realization, it is used for cloud computation data center, cloud computation data center to include a control node server and two calculating
Node server n1 and n2.
Control node server includes virtual machine High Availabitity serve end program 1, and each calculate node server includes void
Quasi- machine High Availabitity client-side program 2, virtual machine High Availabitity serve end program 1 is exclusive including server synchronization module 11, server-side
Monitoring modular 12 and server-side virtual machine heartbeat management module 13 are locked, each virtual machine High Availabitity client-side program 2 includes visitor
Family end synchronization module 21, client exclusive lock monitoring modular 22 and client virtual machine heartbeat management module 23.Server synchronization
Module 11 is separately connected server-side exclusive lock monitoring modular 12 and server-side virtual machine heartbeat management module 13, client synchronization mould
Block 21 is separately connected client exclusive lock monitoring modular 22 and client virtual machine heartbeat management module 23.
Server synchronization module 11, which is used to send virtual machine High Availabitity in real time to all clients synchronization module 21, matches confidence
Breath, virtual machine High Availabitity configuration information includes virtual machine ID, the mirror image name of virtual machine and Ceph storage pool informations.Server-side is exclusive
Lock monitoring modular 12 and server-side virtual machine heartbeat management module 13 obtain virtual machine High Availabitity from server synchronization module 11 and match
Confidence ceases.Client exclusive lock monitoring modular 22 and client virtual machine heartbeat management module 23 are obtained from client synchronization module 21
Take virtual machine High Availabitity configuration information.
The exclusive lock of mirror image of each client exclusive lock monitoring modular 22 for reading local each virtual machine in real time
After the exclusive lock for obtaining mirror image, the first heartbeat message is sent to local client virtual machine heartbeat management module 23 for state;If
The first heartbeat timeout that the exclusive lock of mirror image and the virtual machine using the mirror image cannot be obtained, then close the virtual machine;It is additionally operable to
Detection is scheduled for the virtual machine of local boot.
Each client virtual machine heartbeat management module 23 according to the first heartbeat message of reception for updating virtual machine
First heart time stabs, and is additionally operable to the first heart time stamp that update is scheduled for the virtual machine of local boot.
Server-side exclusive lock monitoring modular 12 is used to periodically read the exclusive lock status of the mirror image of all virtual machines, breaks
The exclusive lock for the mirror image being acquired sends the second heartbeat message to server-side virtual machine heartbeat management module 13;As the row of mirror image
When it locks the second heartbeat timeout of the virtual machine for not being acquired and using the mirror image, the scheduling virtual machine of the mirror image will be used to arrive it
He restarts calculate node server.
Server-side virtual machine heartbeat management module 13 is used to update second heart of the virtual machine according to the heartbeat message of reception
Jump timestamp.
In other examples, the quantity of calculate node server is multiple, such as 20 or 30 etc..
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention
Within the scope of.The content not being described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.
Claims (9)
1. a kind of virtual machine high availability implementation method based on Ceph is used for cloud computation data center, cloud computation data center packet
Include a control node server and at least two calculate node servers, which is characterized in that the described method comprises the following steps:
Control node server sends virtual machine High Availabitity configuration information in real time to all calculate node servers;
Each calculate node server reads the exclusive lock status of the mirror image of local each virtual machine in real time, obtains the row of mirror image
After it is locked, record is stabbed using the first heart time of the virtual machine of the mirror image;It is somebody's turn to do if the exclusive lock of mirror image cannot be obtained and used
First heartbeat timeout of the virtual machine of mirror image, then close the virtual machine;
Simultaneously or after, the exclusive lock status of the mirror image of all virtual machines is read in control node server timing, is broken and is obtained
The exclusive lock of the mirror image taken, and record and stabbed using the second heart time of the virtual machine of the mirror image;When mirror image exclusive lock not by
When obtaining and use the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be saved to other calculating
Point server restarts;
Each calculate node server detection is scheduled for the virtual machine of local boot, and when recording the first heartbeat of the virtual machine
Between stab.
2. the virtual machine high availability implementation method based on Ceph as described in claim 1, which is characterized in that calculate node service
The method of exclusive lock that device obtains mirror image is:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information, works as row
When its lock information is empty, the exclusive lock acquisition interface provided by Ceph sets the cookie in exclusive lock information to this calculating
The cookie of node server.
3. the virtual machine high availability implementation method based on Ceph as claimed in claim 2, which is characterized in that each calculate node
Server detects the virtual machine for being scheduled for local boot, and the first heart time stamp for recording the virtual machine includes:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information, works as row
Its lock information is not the cookie in empty and exclusive lock information when being the cookie of this calculate node server, records the virtual machine
The first heart time stamp.
4. the virtual machine high availability implementation method based on Ceph as claimed in claim 3, which is characterized in that the method is also wrapped
It includes:When the cookie in the exclusive lock information of the mirror image of virtual machine is different from the cookie of the calculate node server, it is considered as
The virtual machine of error running, the calculate node server closing virtual machine.
5. the virtual machine high availability implementation method based on Ceph as described in claim 1, which is characterized in that control node service
The method that device breaks the exclusive lock for the mirror image being acquired is:
The exclusive lock information provided by Ceph reads the exclusive lock of interface reading mirror image and parsing obtains exclusive lock information, works as row
When cookie in its lock information is the cookie of calculate node server where the virtual machine using the mirror image, carried by Ceph
The exclusive lock of confession breaks interface and empties exclusive lock information.
6. the virtual machine high availability implementation method based on Ceph as claimed in claim 5, which is characterized in that the method is also wrapped
It includes:The calculate node server where the cookie in the exclusive lock information of the mirror image of virtual machine is different from the virtual machine
When cookie, it is considered as the virtual machine of error running, control node server notifies the calculate node server closing virtual machine.
7. the virtual machine high availability implementation method based on Ceph as described in claim 1, it is characterised in that:First heartbeat
Interval time it is identical or different with the interval time of second heartbeat.
8. the virtual machine high availability implementation method based on Ceph as described in claim 1, it is characterised in that:The virtual machine is high
Available configuration information includes virtual machine ID, the mirror image name of virtual machine and Ceph storage pool informations.
9. a kind of virtual machine High Availabitity based on Ceph using such as any one of claim 1 to 8 the method realizes system,
It is characterized in that:
Control node server includes virtual machine High Availabitity serve end program, and each calculate node server includes that virtual machine is high
Available client end program, virtual machine High Availabitity serve end program include server synchronization module, server-side exclusive lock monitoring modular
With server-side virtual machine heartbeat management module, each virtual machine High Availabitity client-side program includes client synchronization module, visitor
Family end exclusive lock monitoring modular and client virtual machine heartbeat management module;
Server synchronization module is used to send virtual machine High Availabitity configuration information in real time to all clients synchronization module;
The exclusive lock status of mirror image of each client exclusive lock monitoring modular for reading local each virtual machine in real time, is obtained
After taking the exclusive lock of mirror image, the first heartbeat message is sent to local client virtual machine heartbeat management module;If cannot obtain
First heartbeat timeout of the virtual machine of the exclusive lock and use of the mirror image mirror image, then close the virtual machine;Detection is additionally operable to be adjusted
Spend the virtual machine of local boot;
Each client virtual machine heartbeat management module is used to update first heart of virtual machine according to the first heartbeat message of reception
Timestamp is jumped, the first heart time stamp that update is scheduled for the virtual machine of local boot is additionally operable to;
Server-side exclusive lock monitoring modular is used to periodically read the exclusive lock status of the mirror image of all virtual machines, breaks and has been acquired
Mirror image exclusive lock, to server-side virtual machine heartbeat management module send the second heartbeat message;When mirror image exclusive lock not by
When obtaining and use the second heartbeat timeout of the virtual machine of the mirror image, the scheduling virtual machine of the mirror image will be used to be saved to other calculating
Point server restarts;Server-side virtual machine heartbeat management module is used to update the virtual machine according to the heartbeat message of reception
Second heart time stabs.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711463859.6A CN108600284B (en) | 2017-12-28 | 2017-12-28 | Ceph-based virtual machine high-availability implementation method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711463859.6A CN108600284B (en) | 2017-12-28 | 2017-12-28 | Ceph-based virtual machine high-availability implementation method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108600284A true CN108600284A (en) | 2018-09-28 |
CN108600284B CN108600284B (en) | 2021-05-14 |
Family
ID=63633641
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711463859.6A Active CN108600284B (en) | 2017-12-28 | 2017-12-28 | Ceph-based virtual machine high-availability implementation method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108600284B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684032A (en) * | 2018-12-04 | 2019-04-26 | 武汉烽火信息集成技术有限公司 | The OpenStack virtual machine High Availabitity calculate node device and management method of anti-fissure |
CN111355775A (en) * | 2019-12-30 | 2020-06-30 | 深圳创新科技术有限公司 | Method, device, equipment and storage medium for judging state of CloudStack cluster sub-server |
CN112416518A (en) * | 2020-11-21 | 2021-02-26 | 广州西麦科技股份有限公司 | Method and system for intelligently preventing virtual resource waste |
GB2605268A (en) * | 2020-03-31 | 2022-09-28 | Imagination Tech Ltd | Hypervisor Removal |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070171921A1 (en) * | 2006-01-24 | 2007-07-26 | Citrix Systems, Inc. | Methods and systems for interacting, via a hypermedium page, with a virtual machine executing in a terminal services session |
CN103201724A (en) * | 2010-07-30 | 2013-07-10 | 赛门铁克公司 | Providing application high availability in highly-available virtual machine environments |
CN103684941A (en) * | 2013-11-23 | 2014-03-26 | 广东新支点技术服务有限公司 | Arbitration server based cluster split-brain prevent method and device |
CN104052799A (en) * | 2014-05-23 | 2014-09-17 | 上海爱数软件有限公司 | Method for achieving high availability storage through resource rings |
US9558070B2 (en) * | 2011-04-28 | 2017-01-31 | Vmware, Inc. | Maintaining high availability of a group of virtual machines using heartbeat messages |
CN106575238A (en) * | 2014-09-26 | 2017-04-19 | 华为技术有限公司 | Concurrency control in shared storage architecture supporting on-page implicit locks |
CN106850354A (en) * | 2017-02-22 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of processing method and processing device of Single Point of Faliure |
CN107153569A (en) * | 2017-03-23 | 2017-09-12 | 深信服科技股份有限公司 | The processing method and processing device of virtual machine read-write failure |
-
2017
- 2017-12-28 CN CN201711463859.6A patent/CN108600284B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070171921A1 (en) * | 2006-01-24 | 2007-07-26 | Citrix Systems, Inc. | Methods and systems for interacting, via a hypermedium page, with a virtual machine executing in a terminal services session |
CN103201724A (en) * | 2010-07-30 | 2013-07-10 | 赛门铁克公司 | Providing application high availability in highly-available virtual machine environments |
US9558070B2 (en) * | 2011-04-28 | 2017-01-31 | Vmware, Inc. | Maintaining high availability of a group of virtual machines using heartbeat messages |
CN103684941A (en) * | 2013-11-23 | 2014-03-26 | 广东新支点技术服务有限公司 | Arbitration server based cluster split-brain prevent method and device |
CN104052799A (en) * | 2014-05-23 | 2014-09-17 | 上海爱数软件有限公司 | Method for achieving high availability storage through resource rings |
CN106575238A (en) * | 2014-09-26 | 2017-04-19 | 华为技术有限公司 | Concurrency control in shared storage architecture supporting on-page implicit locks |
CN106850354A (en) * | 2017-02-22 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of processing method and processing device of Single Point of Faliure |
CN107153569A (en) * | 2017-03-23 | 2017-09-12 | 深信服科技股份有限公司 | The processing method and processing device of virtual machine read-write failure |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684032A (en) * | 2018-12-04 | 2019-04-26 | 武汉烽火信息集成技术有限公司 | The OpenStack virtual machine High Availabitity calculate node device and management method of anti-fissure |
CN111355775A (en) * | 2019-12-30 | 2020-06-30 | 深圳创新科技术有限公司 | Method, device, equipment and storage medium for judging state of CloudStack cluster sub-server |
CN111355775B (en) * | 2019-12-30 | 2022-11-18 | 深圳创新科技术有限公司 | Method, device, equipment and storage medium for judging state of CloudStack cluster sub-server |
GB2605268A (en) * | 2020-03-31 | 2022-09-28 | Imagination Tech Ltd | Hypervisor Removal |
GB2605268B (en) * | 2020-03-31 | 2023-06-14 | Imagination Tech Ltd | Hypervisor Removal |
CN112416518A (en) * | 2020-11-21 | 2021-02-26 | 广州西麦科技股份有限公司 | Method and system for intelligently preventing virtual resource waste |
Also Published As
Publication number | Publication date |
---|---|
CN108600284B (en) | 2021-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108600284A (en) | A kind of virtual machine high availability implementation method and system based on Ceph | |
US7870226B2 (en) | Method and system for an update synchronization of a domain information file | |
CN107391758B (en) | Database switching method, device and equipment | |
US20190340168A1 (en) | Merging conflict resolution for multi-master distributed databases | |
CN104253860B (en) | A kind of virtual machine high availability implementation method based on shared storage message queue | |
CN106878473A (en) | A kind of message treatment method, server cluster and system | |
US7249281B2 (en) | Method and system for backing up and restoring data of a node in a distributed system | |
CN106484565B (en) | Method of data synchronization and relevant device between multiple data centers | |
US8626765B2 (en) | Processing database operation requests | |
CN112039970B (en) | Distributed business lock service method, server, system and storage medium | |
US7779300B2 (en) | Server outage data management | |
CN101901237A (en) | Type-Index-Value distributed database built based on SQIite | |
CN109308227A (en) | Fault detection control method and relevant device | |
CN107832159A (en) | Manage the method and computer-readable recording medium of distributed lock | |
CN107040576A (en) | Information-pushing method and device, communication system | |
CN115150419B (en) | Configuration and access method and system for hybrid cloud object storage | |
CN108762982A (en) | A kind of database restoring method, apparatus and system | |
CN108647118A (en) | Copy abnormal restoring method, device and computer equipment based on storage cluster | |
CN109947730A (en) | Metadata restoration methods, device, distributed file system and readable storage medium storing program for executing | |
US8266634B2 (en) | Resource assignment system with recovery notification | |
US10970177B2 (en) | Methods and systems of managing consistency and availability tradeoffs in a real-time operational DBMS | |
US20120197994A1 (en) | Transactional cache versioning and storage in a distributed data grid | |
CN109947592A (en) | A kind of method of data synchronization, device and relevant device | |
CN106210038B (en) | The processing method and system of data operation request | |
WO2022267676A1 (en) | Data processing method and apparatus for shared memory, and device and medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |