CN103747044A - Service locking method and system - Google Patents

Service locking method and system Download PDF

Info

Publication number
CN103747044A
CN103747044A CN201310722587.2A CN201310722587A CN103747044A CN 103747044 A CN103747044 A CN 103747044A CN 201310722587 A CN201310722587 A CN 201310722587A CN 103747044 A CN103747044 A CN 103747044A
Authority
CN
China
Prior art keywords
service
znode
server
zookeeper
cloud platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310722587.2A
Other languages
Chinese (zh)
Other versions
CN103747044B (en
Inventor
井淑明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Opzoon Technology Co Ltd
Original Assignee
Opzoon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Opzoon Technology Co Ltd filed Critical Opzoon Technology Co Ltd
Priority to CN201310722587.2A priority Critical patent/CN103747044B/en
Publication of CN103747044A publication Critical patent/CN103747044A/en
Application granted granted Critical
Publication of CN103747044B publication Critical patent/CN103747044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a service locking method and a system, and relates to the field of cloud platform service technology. the method comprises the following steps: S1: each server of a cloud platform is connected with a zookeeper service, and establishment of a temporary object znode in the zookeeper service is tried, wherein the value of znode is ip address of a corresponding server; S2: externally-supplied service is started on the server with successfully-established znode, and a mapping between the value of the successfully-established znode and a domain name corresponding to the service is established; and S3: when the service stops, the znode corresponding to the service dies out, and the step S1 is returned. With cooperation of each step, all servers in the cloud platform can be locked, and robustness of the cloud platform is raised effectively.

Description

A kind of service lock method and system
Technical field
The present invention relates to cloud platform service technical field, particularly a kind of service lock method and system.
Background technology
Cloud computing has been considered to continue since PC and the Internet, and IT tide for the third time, will change people and obtain, process and protect stored mode.Cloud computing utilizes the transmittability of high speed internet, the processing procedure of data is transferred to large-scale cloud computing center from personal computer or server, and computing capability, storage capacity be take to the mode of service provide as user, user can use computing capability as using the public utilities such as electric power, running water, and carries out charging by use amount.
Owing to can only the service on this station server being locked in cloud platform of the prior art, can not limit the startup of serving on other servers like this, when certain server that service is being provided breaks down, other servers cannot be taken over this server and continue to provide service, cause access services inconvenient, and the robustness of cloud platform is inadequate.
Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is: the robustness that how significantly to improve cloud platform.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides a kind of service lock method, said method comprising the steps of:
S1: every station server of cloud platform all goes to connect zookeeper service, and attempt creating a temporary object znode, the ip address that the value of described znode is corresponding server in described zookeeper service;
S2: start on the server that successfully creates znode service service is externally provided, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping;
S3: after described service service cuts off, the znode corresponding with described service service withers away, and returns to step S1.
Wherein, before step S1, also comprise:
S0: select N platform to start zookeeper service in the M of described cloud platform station server, M is not less than N, and described M and N are the integer that is not less than 1.
Wherein, described N is for approaching most the odd number of M.
The invention also discloses a kind of service lock system, described system comprises:
Temporary object creation module, all goes to connect zookeeper service for every station server of cloud platform, and attempts creating a temporary object znode, the ip address that the value of described znode is corresponding server in described zookeeper service;
Module is set up in mapping, for starting on the server successfully creating znode, externally provides service service, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping;
Object extinction module, after cutting off as described service service, the znode corresponding with described service service withers away.
Wherein, described system also comprises:
Service starts module, for the M station server at described cloud platform, selects N platform to start zookeeper service, and M is not less than N, and described M and N are the integer that is not less than 1.
Wherein, described N is for approaching most the odd number of M.
(3) beneficial effect
The present invention, by the cooperation between each step, makes can the Servers-all in cloud platform be locked, and effectively improves the robustness of cloud platform.
The present invention also utilizes the fault-tolerant ability that zookeeper is good, makes cloud platform also have fault-tolerant ability
The present invention also utilizes the characteristic of zookeeper temporary object, has guaranteed reliability and the promptness of release.
Accompanying drawing explanation
Fig. 1 is the FB(flow block) of the service lock method of one embodiment of the present invention;
Fig. 2 is the structured flowchart of the service lock system of one embodiment of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used for illustrating the present invention, but are not used for limiting the scope of the invention.
Fig. 1 is the FB(flow block) of the service lock method of one embodiment of the present invention; With reference to Fig. 1, said method comprising the steps of:
S1: every station server of cloud platform all goes to connect zookeeper service, and attempt creating a temporary object znode(as/dns/service_A/IN/A/managed in described zookeeper service), the ip address that the value of described znode is corresponding server;
In this step, different services has different znode, the name of service is exactly the domain name of access, and identical service, this znode is identical, only has one can create successfully, be equivalent to lock, owing to all needing to start service, so only have a station server can successfully create the znode of this service, this process is equivalent to the process that server is robbed lock in distributed system.
S2: start on the server that successfully creates znode service service is externally provided, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping (during this domain name of the computer access outside cloud platform, directly resolve to the value of znode, and due to the value of the znode ip address that is corresponding server, so can directly access the server that successfully creates znode, because oneself register when this domain name is service startup, service extinction time together disappears, so guaranteed to resolve the correctness of domain name, there is not the problem of synchronous dns server),
S3: when described service service cut off after (the server problem such as break down can cause serving service and cut off), znode extinction (the function that zookeeper temporary object realize corresponding with described service service, being equivalent to lock has not had, without worrying release problem), return to step S1, continue to realize and rob lock flow process, continue to start service service on other servers.
For guaranteeing that server can connect zookeeper service smoothly, preferably, also comprises before step S1:
S0: select N platform to start zookeeper service in the M of described cloud platform station server, M is not less than N, and described M and N are the integer that is not less than 1.
For guaranteeing fault-tolerant ability, preferably, described N is for approaching most the odd number of M, it is corresponding with the fault tolerant mechanism of zookeeper why selecting like this, be in cloud platform, on server, to have zookeeper service more than half normal, zookeeper just can normally provide service, for example, in cluster, have 3 station servers to start zookeeper service, a service goes wrong, and zookeeper service can normally be used; When having 5 station server, 2 go wrong, and zookeeper service is normal.So such selection, can make when having [(N+1)/2-1] service to go wrong, zookeeper still provides service normally, also just says the fault-tolerant ability of [(N+1)/2-1].
The invention also discloses a kind of service lock system, with reference to Fig. 2, described system comprises:
Temporary object creation module, all goes to connect zookeeper service for every station server of cloud platform, and attempts creating a temporary object znode, the ip address that the value of described znode is corresponding server in described zookeeper service;
Module is set up in mapping, for starting on the server successfully creating znode, externally provides service service, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping;
Object extinction module, after cutting off as described service service, the znode corresponding with described service service withers away.
Preferably, described system also comprises:
Service starts module, for the M station server at described cloud platform, selects N platform to start zookeeper service, and M is not less than N, and described M and N are the integer that is not less than 1.
Preferably, described N is for approaching most the odd number of M.
Above execution mode is only for illustrating the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.

Claims (6)

1. a service lock method, is characterized in that, said method comprising the steps of:
S1: every station server of cloud platform all goes to connect zookeeper service, and attempt creating a temporary object znode, the ip address that the value of described znode is corresponding server in described zookeeper service;
S2: start on the server that successfully creates znode service service is externally provided, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping;
S3: after described service service cuts off, the znode corresponding with described service service withers away, and returns to step S1.
2. the method for claim 1, is characterized in that, before step S1, also comprises:
S0: select N platform to start zookeeper service in the M of described cloud platform station server, M is not less than N, and described M and N are the integer that is not less than 1.
3. method as claimed in claim 2, is characterized in that, described N is for approaching most the odd number of M.
4. a service lock system, is characterized in that, described system comprises:
Temporary object creation module, all goes to connect zookeeper service for every station server of cloud platform, and attempts creating a temporary object znode, the ip address that the value of described znode is corresponding server in described zookeeper service;
Module is set up in mapping, for starting on the server successfully creating znode, externally provides service service, and the described value domain name corresponding with described service service that successfully creates znode set up to mapping;
Object extinction module, after cutting off as described service service, the znode corresponding with described service service withers away.
5. system as claimed in claim 4, is characterized in that, described system also comprises:
Service starts module, for the M station server at described cloud platform, selects N platform to start zookeeper service, and M is not less than N, and described M and N are the integer that is not less than 1.
6. system as claimed in claim 5, is characterized in that, described N is for approaching most the odd number of M.
CN201310722587.2A 2013-12-24 2013-12-24 Service locking method and system Active CN103747044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310722587.2A CN103747044B (en) 2013-12-24 2013-12-24 Service locking method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310722587.2A CN103747044B (en) 2013-12-24 2013-12-24 Service locking method and system

Publications (2)

Publication Number Publication Date
CN103747044A true CN103747044A (en) 2014-04-23
CN103747044B CN103747044B (en) 2017-04-19

Family

ID=50504031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310722587.2A Active CN103747044B (en) 2013-12-24 2013-12-24 Service locking method and system

Country Status (1)

Country Link
CN (1) CN103747044B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103997498A (en) * 2014-05-27 2014-08-20 北京京东尚科信息技术有限公司 Distributed lock service implementation method and component
CN105049549A (en) * 2015-08-07 2015-11-11 北京思特奇信息技术股份有限公司 Method and system for realizing automatic drift of floating IP (Internet Protocol) address
CN106648903A (en) * 2017-01-03 2017-05-10 北京百度网讯科技有限公司 Method and system for calling distributed file system
CN106776156A (en) * 2016-12-13 2017-05-31 东软集团股份有限公司 A kind of service control method and device
CN107086940A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of single service operation method and device
CN109729160A (en) * 2018-12-20 2019-05-07 新华三大数据技术有限公司 Implementation method, Thrift server node and the client of Thrift server service
CN111143318A (en) * 2019-12-24 2020-05-12 北京奇艺世纪科技有限公司 Information processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020143946A1 (en) * 2001-03-28 2002-10-03 Daniel Crosson Software based internet protocol address selection method and system
CN102710554A (en) * 2012-06-25 2012-10-03 深圳中兴网信科技有限公司 Distributed message system and service status detection method thereof
CN103188110A (en) * 2013-03-29 2013-07-03 汉柏科技有限公司 Zookeeper-based cloud platform service hot backup method
CN103259863A (en) * 2013-05-17 2013-08-21 汉柏科技有限公司 System and method for controlling zookeeper services based on clusters

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020143946A1 (en) * 2001-03-28 2002-10-03 Daniel Crosson Software based internet protocol address selection method and system
CN102710554A (en) * 2012-06-25 2012-10-03 深圳中兴网信科技有限公司 Distributed message system and service status detection method thereof
CN103188110A (en) * 2013-03-29 2013-07-03 汉柏科技有限公司 Zookeeper-based cloud platform service hot backup method
CN103259863A (en) * 2013-05-17 2013-08-21 汉柏科技有限公司 System and method for controlling zookeeper services based on clusters

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103997498A (en) * 2014-05-27 2014-08-20 北京京东尚科信息技术有限公司 Distributed lock service implementation method and component
CN103997498B (en) * 2014-05-27 2017-04-26 北京京东尚科信息技术有限公司 Distributed lock service implementation method and component
CN105049549A (en) * 2015-08-07 2015-11-11 北京思特奇信息技术股份有限公司 Method and system for realizing automatic drift of floating IP (Internet Protocol) address
CN105049549B (en) * 2015-08-07 2018-12-28 北京思特奇信息技术股份有限公司 A kind of method and system for realizing floating IP address automatic drift
CN106776156A (en) * 2016-12-13 2017-05-31 东软集团股份有限公司 A kind of service control method and device
CN106648903A (en) * 2017-01-03 2017-05-10 北京百度网讯科技有限公司 Method and system for calling distributed file system
CN106648903B (en) * 2017-01-03 2019-03-26 北京百度网讯科技有限公司 The method and apparatus for calling distributed file system
CN107086940A (en) * 2017-03-31 2017-08-22 北京奇艺世纪科技有限公司 A kind of single service operation method and device
CN107086940B (en) * 2017-03-31 2019-11-15 北京奇艺世纪科技有限公司 A kind of list service operation method and device
CN109729160A (en) * 2018-12-20 2019-05-07 新华三大数据技术有限公司 Implementation method, Thrift server node and the client of Thrift server service
CN111143318A (en) * 2019-12-24 2020-05-12 北京奇艺世纪科技有限公司 Information processing method and device, electronic equipment and storage medium
CN111143318B (en) * 2019-12-24 2023-10-27 北京奇艺世纪科技有限公司 Information processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103747044B (en) 2017-04-19

Similar Documents

Publication Publication Date Title
CN103747044A (en) Service locking method and system
CN102769667B (en) Method, equipment and system for generating ID
CN106850260A (en) A kind of dispositions method and device of virtual resources management platform
CN103744809B (en) Vehicle information management system double hot standby method based on VRRP
CN111935238A (en) Cloud platform load balancing management system, method, equipment and medium
CN105554130A (en) Distributed storage system-based NameNode switching method and switching device
CN108924272A (en) A kind of port resource distribution method and device
CN106034138A (en) Remote service calling method and remote service calling device
EP3211531A1 (en) Virtual machine start method and apparatus
CN104793982A (en) Method and device for establishing virtual machine
CN104283970A (en) Cloud computing service device and system and cloud computing method
CN111858161A (en) Disaster recovery method, device and equipment for cloud host and computer readable storage medium
CN111694845A (en) Redis-based identifier generation method and device
CN1988477A (en) Network managing system with high usability property
CN114448782A (en) Cloud platform based method, device and medium for disaster recovery of cloud host
CN107451254B (en) Method for generating unique identifier of database table data
CN111488247B (en) High availability method and equipment for managing and controlling multiple fault tolerance of nodes
CN104506353A (en) Authentication management method, equipment and system
CN104469420A (en) Service emergency method, device and system for interactive personality TV (IPTV)
CN112241341A (en) Remote disaster recovery method, device and system
CN105227394A (en) A kind of fault detect of the DB2 database based on x86 platform and changing method
CN108600105A (en) Forwarding hardware resource allocation methods, device and communication equipment
CN108418857A (en) A kind of Zookeeper group systems and attaching method thereof and device
CN113821384A (en) Cross-data-center and same-city disaster recovery method, device and equipment based on cloud platform
CN103514198A (en) File management method, cloud storage system and cloud terminal server in cloud storage system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20180528

Granted publication date: 20170419

PP01 Preservation of patent right
PP01 Preservation of patent right

Effective date of registration: 20180823

Granted publication date: 20170419

PP01 Preservation of patent right