CN103152428A - Method for carrying out service communication among nodes on cloud platform - Google Patents
Method for carrying out service communication among nodes on cloud platform Download PDFInfo
- Publication number
- CN103152428A CN103152428A CN2013100905057A CN201310090505A CN103152428A CN 103152428 A CN103152428 A CN 103152428A CN 2013100905057 A CN2013100905057 A CN 2013100905057A CN 201310090505 A CN201310090505 A CN 201310090505A CN 103152428 A CN103152428 A CN 103152428A
- Authority
- CN
- China
- Prior art keywords
- task
- znode
- described task
- message
- path
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention relates to the technical field of distributed service, and particularly discloses a method for carrying out service communication among nodes on a cloud platform. The method comprises the following steps: (S1) a znode path is established between a task initiating end and each task receiving end by utilizing zookeeper, wherein multiple task receiving ends are arranged; (S2) the task initiating end writes task messages into the znode paths; and (S3) the task receiving ends read the task information from the znode paths. The method has the advantages that by adoption of the technical scheme, the service communication among different nodes in a cluster can be finished, so that different services on more nodes can finish a same task cooperatively.
Description
Technical field
The present invention relates to the Distributed Services technical field, particularly carry out the method for communication for service on a kind of cloud platform between node.
Background technology
Be accompanied by the development of cloud platform, distributed system or Distributed Services more and more become the emphasis of industry research.At present, communicate by letter between the service in the cloud platform on different nodes, normally service end is waited for the connection of client by the mode of intercepting the TCP/UDP port, in case begin to send message after connecting.But this communication mode is unfavorable for realizing that a message is received simultaneously by the service on a plurality of nodes.Such as, a node a on the cloud platform, operation service A; Another one node b, operation service B; Also has a node c, operation service C.Node a will accomplish a task now, and this task needs the A of operation service simultaneously, B and C.So, how to allow the service on each node work in coordination with this task of completing?
Zookeeper is the sub-project of Hadoop, it be one for the reliable coherent system of large-scale distributed system, also can regard a kind of distributed service framework as.It is mainly used to solve some data management problems that often run in Distributed Application, as: the management of unified naming service, state synchronized service, cluster management, Distributed Application configuration item etc.The target of zookeeper is exactly the key service that packaged complexity is easily made mistakes, and the interface of use and performance are efficient with being simple and easy to, the system of function-stable offers the user.
If can utilize zookeeper to complete different internodal communication for services in cluster, come the collaborative problem that accomplishes a task just can effectively solve above-mentioned different service.
Summary of the invention
(1) technical problem to be solved
The object of the present invention is to provide a kind of based on carrying out the method for communication for service between node on the cloud platform of zookeeper, thereby make in cluster the difference service on a plurality of nodes can work in coordination with same the task of completing.
(2) technical scheme
In order to solve the problems of the technologies described above, the present invention proposes a kind of method of carrying out communication for service on cloud platform between node, said method comprising the steps of:
S1, utilize zookeeper to set up the znode path between task originating end and task receiving terminal, wherein, described task receiving terminal has a plurality of;
S2, described task originating end write described znode path with task message;
S3, described task receiving terminal read described task message from described znode path.
Optionally, also comprise before step S3: described task receiving terminal monitors described znode path always.
Optionally, step S2 specifically comprises:
S2-1, the task of setting up in described znode path send directory node, and described task sends directory node and is used for preserving the task message that described task originating end sends,
S2-2, described task originating end write described task with task message and send directory node;
Step S3 specifically comprises: described task receiving terminal sends directory node from described task and reads described task message.
Optionally, also comprise step after step S3:
S4, described task receiving terminal write described znode path with the task feedback message after executing corresponding task according to described task message;
S5, described task originating end read described task feedback message from described znode path.
Optionally, also comprise before step S5: described task originating end monitors described znode path always.
Optionally, also comprise before step S4: set up task feedback directory node in described znode path, described task feedback directory node is used for preserving the task feedback message that described task receiving terminal sends;
Step S4 specifically comprises: after described task receiving terminal executes corresponding task according to described task message, the task feedback message is write described task feedback directory node;
Step S5 specifically comprises: described task originating end reads described task feedback message from described task feedback directory node.
(3) beneficial effect
Compared with prior art, the technical scheme of the present invention's proposition has following advantage:
1, a large distribution of computation tasks can be calculated on a plurality of physical machine (node) in cluster, thereby saved computing time;
2, something is completed in a plurality of services that can work in coordination with in cluster on a plurality of physical machine jointly;
3, can realize the concurrent of message in cluster.
Description of drawings
Fig. 1 is the basic flow sheet of a kind of embodiment of the method for the invention.
Fig. 2 is the schematic diagram of realizing in one embodiment of the invention that message is concurrent.
Fig. 3 is the schematic diagram of realizing message feedback in one embodiment of the invention.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.
As shown in Figure 1, carry out the method for communication for service on the cloud platform that the present invention proposes between node, comprise the following steps:
S1, utilize zookeeper to set up the znode path between task originating end and task receiving terminal, wherein, described task receiving terminal has a plurality of;
S2, described task originating end write described znode path with task message;
S3, described task receiving terminal read described task message from described znode path.
Also comprise before step S3: described task receiving terminal monitors described znode path always.
Also comprise step after step S3:
S4, described task receiving terminal write described znode path with the task feedback message after executing corresponding task according to described task message;
S5, described task originating end read described task feedback message from described znode path.
Also comprise before step S5: described task originating end monitors described znode path always.
Be elaborated below by the implementation procedure of giving an example to said method.
As shown in Figure 2, node a, b, c, d are arranged in cluster, respectively operation service A, B, C, D.Node a will accomplish a task, and needs service A, B, C, D to work in coordination with and complete.At this, node a is the task originating end, and node b, c, d are the task receiving terminal.At first, as shown in Figure 2, the znode path of a zookeeper of definition, and set up a task transmission directory node/msg.Each receiving terminal monitor should/value of msg, originating end toward should/write task message in msg, in case be somebody's turn to do/data in msg change, all receiving terminals receive/data of msg immediately.By said process, realized that just the message in the cluster is concurrent.
As shown in Figure 3, after node b, c, d finish the work separately, separately feedback result (being the task feedback message) is write under task feedback directory node/result of zookeeper:
/ result/b # is write by service B
/ result/c # is write by service C
/ result/d # is write by service D
The service A of node a monitors always/znode number under result, in case contain b, c, these 3 sub-directory node of d under discovery/result catalogue, represent that node b, c, d upper corresponding service B, C, D have completed task separately, namely complete the desired task of service A of node a, and obtained feedback.
To sum up, the technical scheme that proposes of the present invention has completed by zookeeper the communication mechanism that different service collaborations on different physical machine are completed something.
The above is only the preferred embodiment of the present invention; should be pointed out that for the person of ordinary skill of the art, under the prerequisite that does not break away from the technology of the present invention principle; can also make some improvement and replacement, these improvement and replacement also should be considered as protection scope of the present invention.
Claims (6)
1. carry out the method for communication for service on a cloud platform between node, it is characterized in that, said method comprising the steps of:
S1, utilize zookeeper to set up the znode path between task originating end and task receiving terminal, wherein, described task receiving terminal has a plurality of;
S2, described task originating end write described znode path with task message;
S3, described task receiving terminal read described task message from described znode path.
2. method according to claim 1, is characterized in that, also comprise before step S3: described task receiving terminal monitors described znode path always.
3. method according to claim 1 and 2, is characterized in that, step S2 specifically comprises:
S2-1, the task of setting up in described znode path send directory node, and described task sends directory node and is used for preserving the task message that described task originating end sends,
S2-2, described task originating end write described task with task message and send directory node;
Step S3 specifically comprises: described task receiving terminal sends directory node from described task and reads described task message.
4. method according to claim 1 and 2, is characterized in that, also comprises step after step S3:
S4, described task receiving terminal write described znode path with the task feedback message after executing corresponding task according to described task message;
S5, described task originating end read described task feedback message from described znode path.
5. method according to claim 4, is characterized in that, also comprise before step S5: described task originating end monitors described znode path always.
6. method according to claim 4, is characterized in that, also comprises before step S4: set up task feedback directory node in described znode path, described task feedback directory node is used for preserving the task feedback message that described task receiving terminal sends;
Step S4 specifically comprises: after described task receiving terminal executes corresponding task according to described task message, the task feedback message is write described task feedback directory node;
Step S5 specifically comprises: described task originating end reads described task feedback message from described task feedback directory node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100905057A CN103152428A (en) | 2013-03-19 | 2013-03-19 | Method for carrying out service communication among nodes on cloud platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100905057A CN103152428A (en) | 2013-03-19 | 2013-03-19 | Method for carrying out service communication among nodes on cloud platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103152428A true CN103152428A (en) | 2013-06-12 |
Family
ID=48550287
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013100905057A Pending CN103152428A (en) | 2013-03-19 | 2013-03-19 | Method for carrying out service communication among nodes on cloud platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103152428A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577255A (en) * | 2013-10-29 | 2014-02-12 | 汉柏科技有限公司 | Method and system for controlling asynchronous progresses among plurality of services based on Zookeeper |
CN104301447A (en) * | 2014-09-10 | 2015-01-21 | 深圳市高视数字技术有限公司 | Software module communication method |
CN104408552A (en) * | 2014-11-13 | 2015-03-11 | 华为技术有限公司 | Method, device and system for cooperatively processing task |
CN106161643A (en) * | 2016-07-25 | 2016-11-23 | 镇江惠通电子有限公司 | Task distribution formula processing method, device and Cloud Server |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1861985A1 (en) * | 2005-03-22 | 2007-12-05 | Telefonaktiebolaget LM Ericsson (publ) | Method and arrangement for services running on service execution platform |
CN101977124A (en) * | 2010-11-05 | 2011-02-16 | 山东中创软件工程股份有限公司 | Service clustering method and system based on ZooKeeper technology |
CN102739775A (en) * | 2012-05-29 | 2012-10-17 | 宁波东冠科技有限公司 | Method for monitoring and managing Internet of Things data acquisition server cluster |
-
2013
- 2013-03-19 CN CN2013100905057A patent/CN103152428A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1861985A1 (en) * | 2005-03-22 | 2007-12-05 | Telefonaktiebolaget LM Ericsson (publ) | Method and arrangement for services running on service execution platform |
CN101977124A (en) * | 2010-11-05 | 2011-02-16 | 山东中创软件工程股份有限公司 | Service clustering method and system based on ZooKeeper technology |
CN102739775A (en) * | 2012-05-29 | 2012-10-17 | 宁波东冠科技有限公司 | Method for monitoring and managing Internet of Things data acquisition server cluster |
Non-Patent Citations (1)
Title |
---|
HUNT P等: "ZooKeeper: Wait-free coordination for Internet-scale systems", 《PROC. USENIX ANNUAL TECHNICAL CONFERENCE》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577255A (en) * | 2013-10-29 | 2014-02-12 | 汉柏科技有限公司 | Method and system for controlling asynchronous progresses among plurality of services based on Zookeeper |
CN104301447A (en) * | 2014-09-10 | 2015-01-21 | 深圳市高视数字技术有限公司 | Software module communication method |
CN104301447B (en) * | 2014-09-10 | 2018-04-27 | 深圳市高视数字技术有限公司 | A kind of software module communication means |
CN104408552A (en) * | 2014-11-13 | 2015-03-11 | 华为技术有限公司 | Method, device and system for cooperatively processing task |
CN106161643A (en) * | 2016-07-25 | 2016-11-23 | 镇江惠通电子有限公司 | Task distribution formula processing method, device and Cloud Server |
CN106161643B (en) * | 2016-07-25 | 2019-09-06 | 镇江惠通电子有限公司 | Task distribution formula processing method, device and Cloud Server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3534320A1 (en) | Block chain-based multi-chain management method and system, electronic device, and storage medium | |
Verma et al. | A survey on network methodologies for real-time analytics of massive IoT data and open research issues | |
CN106850788B (en) | Integrated framework and integrated approach towards multi-source heterogeneous geographic information resources | |
CN107172187A (en) | A kind of SiteServer LBS and method | |
CN103986786A (en) | Remote cloud desktop operation system | |
CN107273228B (en) | Message transmission method based on star topology architecture | |
CN108304473A (en) | Data transmission method between data source and system | |
CN110113406B (en) | Distributed computing service cluster system | |
CN105721582A (en) | Multi-node file backup system | |
CN103152428A (en) | Method for carrying out service communication among nodes on cloud platform | |
CN104967732A (en) | Information processing method and electronic device | |
CN109600240A (en) | Group Communications method and device | |
CN105516250A (en) | Internet-of-things service invoking platform and system | |
CN102831038B (en) | The disaster recovery method and ENUM-DNS of ENUM-DNS | |
CN102209051B (en) | Instant messaging system and method for realizing user information sharing | |
CN108259605B (en) | Data calling system and method based on multiple data centers | |
CN102209048B (en) | Instant messaging system and method for realizing information sharing for users | |
CN115334025B (en) | Decentralized instant messaging method, decentralized instant messaging device, decentralized instant messaging equipment and storage medium | |
CN105847428A (en) | Mobile cloud platform | |
CN102970375A (en) | Cluster configuration method and device | |
US20230266994A1 (en) | Migration of computational units in distributed networks | |
CN108600347A (en) | A kind of distributed computational data synchronous method and device | |
CN103200225A (en) | Method and system of centralized management of services in server cluster | |
CN106102056A (en) | High in the clouds WiFi communication system and message identifying thereof and roaming messages recognition methods | |
CN103546513B (en) | The method and device of communication between a kind of customer terminal webpage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20130612 |