CN105656653B - Increase method of network entry, the device and system of node in distributed coordination system newly - Google Patents
Increase method of network entry, the device and system of node in distributed coordination system newly Download PDFInfo
- Publication number
- CN105656653B CN105656653B CN201410649690.3A CN201410649690A CN105656653B CN 105656653 B CN105656653 B CN 105656653B CN 201410649690 A CN201410649690 A CN 201410649690A CN 105656653 B CN105656653 B CN 105656653B
- Authority
- CN
- China
- Prior art keywords
- node
- network access
- new network
- access node
- information set
- 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.)
- Active
Links
Abstract
The embodiment of the present invention provides method of network entry, the device and system for increasing node in a kind of distributed coordination system newly.Increase the method for network entry of node in distributed coordination system of the present invention newly, comprising: host node receives the networking request message that new network access node is sent, the IP address including new network access node;It is that new network access node distributes first node mark, and increases by the first corresponding relationship in the configuration file of host node according to networking request message, the first corresponding relationship includes the IP address of first node mark and the new network access node;Host node increases by the first corresponding relationship in nodal information set, obtains updated nodal information set;Host node identifies first node and updated nodal information set is sent to new network access node, so that new network access node is identified according to first node and updated nodal information set generates the configuration file of new network access node, so that the distributed coordination system be added.Efficiency of the embodiment of the present invention is higher, easy to operate.
Description
Technical field
The present embodiments relate to the networkings for increasing node in computer technology more particularly to a kind of distributed coordination system newly
Methods, devices and systems.
Background technique
ZooKeeper can provide decentralized configuration service, synchronous service and the name of open source for large-scale distributed calculating
Registration etc., is supplied to user for the system of interface and performance efficiency easy to use, function-stable.ZooKeeper can be used for counting
(Leader election), load balancing, naming service (Naming are elected according to publication and subscription (configuration center), clustered node
Service), distributed notice/coordination, distributed lock, distributed queue etc..
It is server 1, server 2 and service respectively assuming that there is three ZooKeeper servers in ZooKeeper network
Device 3, when increasing a ZooKeeper server 4 newly, current treatment process is as follows:
1. the node identification that newly-increased server 4 is arranged is server.4, so that other in ZooKeeper cluster network
Server according to this node identification can determine the node identification it is corresponding be server 4.
2. the configuration file (zoo.cfg) of each server is respectively modified, i.e., in the configuration file of each server
Increase a new corresponding relationship, server.4=host4:port1:port2.Wherein, server.4 is the newly-increased service
The node identification of device 4,4 be node ID;Host4 be the newly-increased server 4 Internet protocol (Internet Protocol,
Abbreviation IP) address;Port1 is host node (Leader) server exchange information in the newly-increased server 4 and cluster network
Port;Port2 is the port that server is in communication with each other when executing election.
By taking server 1 as an example, corresponding relationship included in the configuration file of server 1 is as follows:
Server.1=host1:port1:port2;
Server.2=host2:port1:port2;
Server.3=host3:port1:port2;
Server.4=host4:port1:port2;
The configuration file of server 1,2 and 3 is identical as corresponding relationship included in the configuration file of server A.
3. restarting the Servers-all in ZooKeeper cluster network.Because of all clothes in ZooKeeper cluster network
Business device includes the corresponding relationship of newly-increased server 4, so after restart, just increasing the server 4 into ZooKeeper
Cluster network.
Due to needing to configure each server and restarting, for catenet, configures very complicated, inefficiency and be easy
Error.
Summary of the invention
The embodiment of the present invention provides method of network entry, the device and system for increasing node in a kind of distributed coordination system newly, with
It solves the problems, such as to increase newly in the prior art when node networks and configures cumbersome, inefficiency.
In a first aspect, the embodiment of the present invention provides the method for network entry for increasing node in a kind of distributed coordination system newly, comprising:
The host node of the distributed coordination system receives the networking request message that new network access node is sent, and the networking is asked
Seeking message includes the Internet protocol IP address of the new network access node;
The host node is the new network access node distribution first node mark according to the networking request message, and in institute
It states and increases by the first corresponding relationship in the configuration file of host node, first corresponding relationship includes the first node mark and institute
State the IP address of new network access node;
The host node increases by first corresponding relationship in nodal information set, obtains updated nodal information collection
It closes, so that the slave node of the distributed coordination system increases by the described first corresponding pass in the configuration file from node
System;
The host node identifies the first node and updated nodal information set is sent to the new networking
Node, so that the new network access node is identified according to the first node and the updated nodal information set generates
The configuration file of the new network access node, so that the distributed coordination system be added.
With reference to first aspect, in the first implementation of first aspect, the host node of the distributed coordination system
Before the networking request message for receiving new network access node transmission, further includes:
The nodal information set is stored in advance in the host node;The nodal information set includes the section of the host node
The corresponding relationship of the IP address of point identification and the host node and the node identification and the IP from node from node
The corresponding relationship of address.
With reference to first aspect or the first implementation of first aspect, in second of implementation of first aspect,
The host node of the distributed coordination system receives the networking request message that new network access node is sent, comprising:
The host node receives the networking request message that new network access node is sent in fixed port;The port and described new
The port that network access node sends networking request message is consistent.
Second aspect, the embodiment of the present invention provide the method for network entry for increasing node in a kind of distributed coordination system newly, comprising:
New network access node sends networking request message, the networking request report to the host node of the distributed coordination system
It include the Internet protocol IP address of the new network access node in text;
The new network access node receives the first node mark and nodal information set that the host node is sent, and described the
It according to the networking request message is that the new network access node distributes that one node identification, which is the host node,;The nodal information
The corresponding relationship of the IP address of node identification and the host node in set including the host node, the distributed coordination system
The corresponding relationship and first node mark of the node identification of slave node in system and the IP address from node and institute
State the corresponding relationship of the IP address of new network access node;
The new network access node generates the new networking according to first node mark and the nodal information set and saves
The configuration file of point, starting operation, so that the distributed coordination system be added.
In conjunction with second aspect, in the first implementation of second aspect, described point is added in the new network access node
After cloth coordination system, the method also includes:
The new network access node monitors in real time or periodically the nodal information set on the host node, if described
Nodal information set updates, and the corresponding relationship in the updated nodal information set is added to the new networking and is saved
In the configuration file of point
In conjunction with the first of second aspect or second aspect implementation, in second of implementation of second aspect,
The new network access node sends networking request message to the host node of the distributed coordination system, comprising:
The new network access node sends networking request message to the host node of the distributed coordination system in fixed port;
The port is consistent with the port that the host node receives the networking request message.
The third aspect, the embodiment of the present invention provide the host node in a kind of distributed coordination system, comprising:
Receiving module, the networking request message sent for receiving new network access node;The networking request message includes institute
State the Internet protocol IP address of new network access node;
Processing module, for being the new network access node distribution first node mark according to the networking request message, and
Increase by the first corresponding relationship in the configuration file of the host node, first corresponding relationship includes the first node mark
With the IP address of the new network access node;
Increase by first corresponding relationship in nodal information set, obtains updated nodal information set, so that
The slave node of the distributed coordination system increases by first corresponding relationship in the configuration file from node;
Sending module, for identifying the first node and updated nodal information set is sent to and described newly enters
Net node, so that the new network access node is identified according to the first node and the updated nodal information collection symphysis
At the configuration file of the new network access node, so that the distributed coordination system be added.
In conjunction with the third aspect, in the first implementation of the third aspect, further includes:
Memory module, for the nodal information set to be stored in advance;The nodal information set includes the host node
Node identification and the host node IP address corresponding relationship and the node identification from node and described from node
IP address corresponding relationship.
In conjunction with the first implementation of the third aspect, the third aspect, in second of implementation of the third aspect, institute
Receiving module is stated, is specifically used for:
The networking request message that new network access node is sent is received in fixed port;The port and the new network access node are sent out
The port for being sent into net request message is consistent.
Fourth aspect, the embodiment of the present invention provide the new network access node in a kind of distributed coordination system, comprising:
Sending module includes described in the message for sending message to the host node of the distributed coordination system
The Internet protocol IP address of new network access node;
Receiving module, for receiving the first node mark and nodal information set that the host node is sent, described the
It according to the networking request message is that the new network access node distributes that one node identification, which is the host node,;The nodal information
The corresponding relationship of the IP address of node identification and the host node in set including the host node, the distributed coordination system
The corresponding relationship and first node mark of the node identification of slave node in system and the IP address from node and institute
State the corresponding relationship of the IP address of new network access node;
Processing module, for generating the new network access node according to first node mark and the nodal information set
Configuration file, starting operation, so that the distributed coordination system be added.
In conjunction with fourth aspect, in the first implementation of fourth aspect, further includes:
Monitoring module is used for after the distributed coordination system is added in the new network access node, in real time or periodically
Ground monitors the nodal information set on the host node, if the nodal information set updates, by updated institute
The corresponding relationship in nodal information set is stated to be added in the configuration file of the new network access node.
In conjunction with the first of fourth aspect or fourth aspect implementation, in second of implementation of fourth aspect,
The sending module, is specifically used for:
Networking request message is sent to the host node of the distributed coordination system in fixed port;The port with it is described
The port that host node receives the networking request message is consistent.
5th aspect, the embodiment of the present invention provide a kind of distributed coordination system, comprising:
Host node as described in any one of third aspect, at least two are from node and as described in any one of fourth aspect
New network access node.
Method of network entry, the device and system for increasing node in distributed coordination system of the embodiment of the present invention newly, pass through described point
The host node that cloth coordinates system receives the networking request message that new network access node is sent, and the networking request message includes described
The IP address of new network access node;It is the new network access node distribution first node mark according to the networking request message, and
Increase by the first corresponding relationship in the configuration file of the host node, first corresponding relationship include the first node mark and
The IP address of the new network access node;And increase by first corresponding relationship in nodal information set, obtain updated section
Point information aggregate, so that the slave node of the distributed coordination system increases described the in the configuration file from node
One corresponding relationship;The first node is identified and updated nodal information set is sent to the new network access node, with
So that the new network access node is identified according to the first node and the nodal information set of the update generates described newly to enter
The configuration file of net node realizes distributed coordination system ZooKeeper cluster so that the distributed coordination system be added
New network access node automatically configures in network deployment, does not need manual intervention, the automatic networking of new network access node, phase can be realized
It is high-efficient than traditional human configuration and not easy to make mistakes.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with
It obtains other drawings based on these drawings.
Fig. 1 is the method for network entry flow chart one for increasing node in distributed coordination system provided in an embodiment of the present invention newly;
Fig. 2 is the realization principle for increasing the method for network entry of node in distributed coordination system provided in an embodiment of the present invention newly
Figure;
Fig. 3 is the method for network entry flowchart 2 for increasing node in distributed coordination system provided in an embodiment of the present invention newly;
Fig. 4 is the host node structural schematic diagram in distributed coordination system provided in an embodiment of the present invention;
Fig. 5 is the new network access node structural schematic diagram in distributed coordination system provided in an embodiment of the present invention;
Fig. 6 is another structural schematic diagram of host node in distributed coordination system provided in an embodiment of the present invention;
Fig. 7 is another structural schematic diagram of new network access node in distributed coordination system provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of distributed coordination system provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is the method for network entry flow chart one for increasing node in distributed coordination system provided in an embodiment of the present invention newly.Institute
The method of stating may include:
Step 101, distributed coordination system host node receive the networking request message that new network access node is sent, it is described enter
Net request message includes the Internet protocol IP address of the new network access node.
Distributed coordination system in the embodiment of the present invention refers to ZooKeeper cluster network.ZooKeeper cluster net
There are two crucial roles for node tool in network: host node (also referred to as Leader) and from node (also referred to as Follower).?
In entire ZooKeeper cluster network operational process, only one Leader, others are all from node, and ZooKeeper is used
Election algorithm selects a Leader.Leader is usually the smallest node of ZooKeeper cluster interior joint serial number.If
Leader is out of joint in the process of running for ZooKeeper cluster network, and system can select again one using the election algorithm
Leader.How ZooKeeper cluster network specifically elects Leader, can refer to usual implementation, it is not described here in detail.
The host node of the embodiment of the present invention is the host node (Leader) of the ZooKeeper cluster network.
Step 102, the host node are that the new network access node distributes first node mark according to the networking request message
Know, and increase by the first corresponding relationship in the configuration file of the host node, first corresponding relationship includes the first segment
The IP address of point identification and the new network access node.
Step 103, the host node increase by first corresponding relationship in nodal information set, obtain updated section
Point information aggregate, so that the slave node of the distributed coordination system increases described the in the configuration file from node
One corresponding relationship.
Optionally, the host node of the distributed coordination system receive networking request message that new network access node is sent it
Before, further includes:
The nodal information set is stored in advance in the host node;The nodal information set includes the section of the host node
The corresponding relationship of the IP address of point identification and the host node and the node identification and the IP from node from node
The corresponding relationship of address.
All nodes provide service, cluster net as a whole for Distributed Application in ZooKeeper cluster network
It is interconnected between each node in network, so, when configuring ZooKeeper cluster network, each node includes
The corresponding relationship of the node identification of other each nodes and IP address in ZooKeeper cluster network.Such as:
Host1 (192.168.0.179) corresponds to server.1;
Host2 (192.168.0.178) corresponds to server.2;
Host3 (192.168.0.177) corresponds to server.3.
On each node of ZooKeeper cluster network deployment, configuration file (zoo.cfg) is all preserved, if
There is new network access node in ZooKeeper cluster network, then needs to modify the configuration file of each node.
Assuming that the content in configuration file (zoo.cfg) original on node 1 is as follows:
TickTime=2000
DataDir=/var/lib/ZooKeeper
ClientPort=2181
InitLimit=5
SyncLimit=2
Server.1=host1:port1:port2
Server.2=host2:port1:port2
Server.3=host3:port1:port2
Wherein:
TickTime: the time of heartbeat is maintained between expression ZooKeeper cluster network interior joint or between client and node
Interval, unit millisecond.
DataDir: the catalogue that data and log are saved in ZooKeeper cluster network is indicated.
ClientPort: the port of client connection ZooKeeper cluster network interior joint is indicated.
InitLimit: longest heart time when configuration ZooKeeper cluster network receives client initialization connection is indicated
Space-number, more than showing client connection failure;" 5 " indicate 5 tickTime, and total time span is exactly 5*2000=10
Second.
SyncLimit: message, request and response time length are sent between mark Leader and Follower, longest is not
It can exceed that the time span of how many a tickTime, total time span are exactly 2*2000=4 seconds.
Above-mentioned client refers to the application program created on the node of ZooKeeper cluster network or in other equipment,
Each node runtime server end application program of ZooKeeper cluster network, a node at least correspond to a client, are
Client provides service.
Specifically, host node in ZooKeeper cluster network in the present embodiment, opens a process, waits to be received new
The networking request message that network access node is sent, such as can be in the networking request message to be received such as 5050 ports;The new section that networks
Point sends the networking request message by broadcast mode, and new network access node sends port and the host node of the networking request message
Receiving port is consistent, such as equally in 5050 ports;The networking request message can be User Datagram Protocol (User
Datagram Protocol, abbreviation UDP) broadcasting packet, message format is as follows:
The head IP | The head UDP | Data |
Wherein, the destination address on the head IP is the broadcast address of 255.255.255.255, the source port and destination of UDP
Mouth is defined as 5050 fixed ports;Data field are as follows: " ZooKeeper request:IP1 ", wherein IP1 is new network access node
IP address.
After host node receives the networking request message that new network access node is sent, takes out in the networking request message and include
New network access node IP address, to the new network access node distribution first node mark (in the node mark of all nodes before
It is incremented by the basis of knowledge), and the first node of new network access node mark and the first corresponding relationship of IP address are increased
It is added in the configuration file of the host node and nodal information set, so that the slave node of the distributed coordination system
It learns and increases by first corresponding relationship in the configuration file from node after the nodal information set updates.It should be from section
After point increases by first corresponding relationship in the configuration file from node, the server end application from node is restarted
Program is so that first corresponding relationship increased newly in the configuration file from node comes into force.
The initial nodal information set includes the node identification of the host node and the IP address of the host node
Corresponding relationship and described from the node identification of node and the corresponding relationship of the IP address from node;It is updated described
Nodal information set further includes first corresponding relationship.
It is assumed that the initial nodal information set are as follows:
Server.1=host1:port1:port2;
Server.2=host2:port1:port2;
Server.3=host3:port1:port2.
Newly-increased first corresponding relationship are as follows:
Server.4=host4:port1:port2.
By taking server.4=host4:port1:port2 as an example, wherein server.4 indicates the first segment of new network access node
Point identification, wherein 4 indicate that node ID, host4 indicate the IP address of new network access node, port1 is the new network access node and collection
The port of host node exchange information in group network;Port2 is the port of node intercommunication when executing election.
The nodal information set can store in persistent node (zooData), which can be host node
The child node that corresponding client creates in zookeeper cluster network, the attribute of the persistent node be it is permanent,
It will not be deleted the corresponding client of host node disconnects the persistent node with the persistent node, zookeeper cluster
All nodes in network are all communicated with persistent node holding, and only host node can carry out write operation to the persistent node,
Other can only carry out read operation to the persistent node from node, that is, detect the nodal information set hair stored in the persistent node
After changing, the corresponding relationship increased newly in nodal information set is added in configuration file.
The host node is similar with from node, so that newly-increased first corresponding relationship is come into force, need to restart on host node
Server-side application.
Step 104, the host node identifies the first node and updated nodal information set is sent to institute
New network access node is stated, so that the new network access node is identified according to the first node and the updated nodal information
Set generates the configuration file of the new network access node, so that the distributed coordination system be added.
Specifically, host node will be to the first node mark of the new network access node distribution and updated section
Point information aggregate is sent to new network access node, can be sent in the form of message, such as format can be " ZooKeeper
Reply:nodename:zooData;Server.1=host1:port1:port2;Erver.2=host2:port1:
port2;Server.3=host3:port1:port2;Server.4=host4:port1:port2. ".New network access node is received
To later, the new networking is written into the first node of the updated nodal information set and new network access node mark
In the configuration file of node, and in the dataDir of the configuration catalogue specified in the following, one myid file of creation, the inside content are
First node mark, for identifying the new network access node, and starts the server-side application of the new network access node.
Fig. 2 is the realization principle for increasing the method for network entry of node in distributed coordination system provided in an embodiment of the present invention newly
Figure.
As shown in Fig. 2, new network access node sends udp broadcast message in 5050 ports in the method for the present embodiment,
All nodes in ZooKeeper cluster network can receive the udp broadcast message in 5050 ports, judge whether itself leads
Node is then the new network access node distribution first node mark according to the udp broadcast message if it is host node, and in institute
It states and increases by the first corresponding relationship in the configuration file of host node, first corresponding relationship includes the first node mark and institute
State the IP address of new network access node;Increase described first pair in the nodal information set that the host node stores in persistent node
It should be related to, obtain updated nodal information set;
Other judge it itself is not host node from node, then will not operate, can continue to the message received
The persistent node is monitored, after the data of the nodal information set in persistent node update, the persistent node is read
Operation, increases by first corresponding relationship, and restart the server-side application from node in the configuration file from node
Program, so that newly-increased first corresponding relationship comes into force.
The host node identifies the first node and updated nodal information set is sent in the form of message
The new network access node, so that the new network access node is identified according to the first node and the nodal information of the update
Set generates the configuration file of the new network access node, so that the distributed coordination system be added.
All nodes in ZooKeeper cluster network are by the information of inquiry storage to know itself whether main section
Point.
Optionally, the host node receives the networking request message that new network access node is sent, comprising:
The host node receives the networking request message that new network access node is sent in fixed port;The port and described new
The port that network access node sends networking request message is consistent.
Specifically, message can be sent and received in the embodiment of the present invention by 5050 fixed ports.
The present embodiment receives the networking request report that new network access node is sent by the host node of the distributed coordination system
Text, the networking request message include the IP address of the new network access node;Newly entered according to the networking request message to be described
Net node distributes first node mark, and increases by the first corresponding relationship in the configuration file of the host node, and described first pair
It should be related to the IP address including first node mark and the new network access node;And described in increasing in nodal information set
First corresponding relationship obtains updated nodal information set, so that the slave node of the distributed coordination system is described
Increase by first corresponding relationship from the configuration file of node;The first node is identified and updated nodal information
Set is sent to the new network access node, so that the new network access node is identified according to the first node and the update
Nodal information set generate the configuration file of the new network access node, so that the distributed coordination system be added, realize
New network access node automatically configures in the deployment of distributed coordination system ZooKeeper cluster network, does not need manual intervention
The automatic networking for realizing new network access node, it is high-efficient compared to traditional human configuration and not easy to make mistakes.
Fig. 3 is the method for network entry flowchart 2 for increasing node in distributed coordination system provided in an embodiment of the present invention newly.Such as
Shown in Fig. 3, the method may include:
Step 301, newly networking sends networking request message to the host node of the distributed coordination system, and the networking is asked
Seek the Internet protocol IP address in message including the new network access node.
Specifically, new network access node can send networking request message by fixed port, can pass through broadcast mode
It sends, such as sends the networking request message in 5050 ports, which can be User Datagram Protocol (User
Datagram Protocol, abbreviation UDP) broadcasting packet, message format is as follows:
The head IP | The head UDP | Data |
Wherein, the destination address of network layer is the broadcast address of 255.255.255.255, the source port and destination of UDP
Mouth is defined as 5050 fixed ports;Data field are as follows: " ZooKeeper request:IP ", wherein IP is new network access node
IP address.
After host node receives the networking request message that new network access node is sent, takes out in the networking request message and include
New network access node IP address, to the new network access node distribution first node mark (in the node mark of all nodes before
It is incremented by the basis of knowledge), and the first node of new network access node mark and the first corresponding relationship of IP address are increased
It is added in the configuration file of the host node and nodal information set, so that the slave node of the distributed coordination system
Increase by first corresponding relationship in the configuration file from node after learning the nodal information set variation, and restarts
The server-side application from node, so that newly-increased first corresponding relationship comes into force.
The initial nodal information set includes the node identification of the host node and the IP address of the host node
Corresponding relationship and described from the node identification of node and the corresponding relationship of the IP address from node;It is updated described
Nodal information set further includes first corresponding relationship.
It is assumed that the initial nodal information set are as follows:
Server.1=host1:port1:port2;
Server.2=host2:port1:port2;
Server.3=host3:port1:port2.
Newly-increased first corresponding relationship are as follows:
Server.4=host4:port1:port2.
By taking server.4=host4:port1:port2 as an example, wherein server.4 indicates the first segment of new network access node
Point identification, wherein 4 indicate that node ID, host4 indicate the IP address of new network access node, port1 is the new network access node and collection
The port of host node exchange information in group network;Port2 is the port of node intercommunication when executing election.
The nodal information set can store in persistent node (zooData), which can be host node
The child node that corresponding client creates in zookeeper cluster network, the attribute of the persistent node be it is permanent,
It will not be deleted the corresponding client of host node disconnects the persistent node with the persistent node, zookeeper cluster
All nodes in network are all communicated with persistent node holding, and only host node can carry out write operation to the persistent node,
Other can only carry out read operation to the persistent node from node, that is, detect the nodal information set hair stored in the persistent node
After changing, the corresponding relationship increased newly in nodal information set is added in configuration file.
The host node is similar with from node, and the host node need to be restarted by so that newly-increased first corresponding relationship is come into force
Server-side application program.
Step 302, the new network access node receive the first node mark and nodal information collection that the host node is sent
It closes, it is the new network access node distribution that the first node, which is identified as the host node according to the networking request message,;Institute
State in nodal information set including the host node node identification and the host node IP address corresponding relationship, described point
The corresponding relationship and the first segment of the node identification of slave node in cloth coordination system and the IP address from node
The corresponding relationship of the IP address of point identification and the new network access node.
Step 303, the new network access node are according to identifying the first node and the nodal information set generates
The configuration file of new network access node, starting operation, so that the distributed coordination system be added.
Specifically, host node will be to the first node mark of the new network access node distribution and updated section
Point information aggregate is sent to new network access node, can be sent in the form of message, such as format can be " ZooKeeper
Reply:nodename:zooData;Server.1=host1:port1:port2;Erver.2=host2:port1:
port2;Server.3=host3:port1:port2;Server.4=host4:port1:port2. ".New network access node is received
To later, the new networking is written into the first node of the updated nodal information set and new network access node mark
In the configuration file (zoo.cfg) of node, and in the dataDir of the configuration catalogue specified in the following, one myid file of creation, inner
Face content is first node mark, for identifying new network access node, and starts the server-side application of new network access node, from
And the distributed coordination system is added.
Optionally, after the distributed coordination system is added in the new network access node, the method also includes:
The new network access node monitors in real time or periodically the nodal information set on the host node, if described
Nodal information set updates, and the corresponding relationship in the updated nodal information set is added to the new networking and is saved
In the configuration file of point.
Optionally, the new network access node sends networking request message, packet to the host node of the distributed coordination system
It includes:
The new network access node sends networking request message to the host node of the distributed coordination system in fixed port;
The port is consistent with the port that the host node receives the networking request message.
The present embodiment realizes the automatic of new network access node in the deployment of distributed coordination system ZooKeeper cluster network
Configuration, does not need manual intervention, the automatic networking of new network access node can be realized, high-efficient compared to traditional human configuration, and
And it is not easy to make mistakes.
Fig. 4 is the host node structural schematic diagram in distributed coordination system provided in an embodiment of the present invention, as shown in figure 4,
The host node of the present embodiment may include: receiving module 401, processing module 402, sending module 403;Wherein, receiving module
401, the networking request message for being sent for receiving new network access node;The networking request message includes the new networking section
The Internet protocol IP address of point;Processing module 402, for being the new network access node distribution the according to the networking request message
One node identification, and increase by the first corresponding relationship in the configuration file of the host node, first corresponding relationship includes institute
State the IP address of first node mark and the new network access node;Increase by first corresponding relationship in nodal information set,
Updated nodal information set is obtained, so that the slave node of the distributed coordination system is in the configuration text from node
Increase by first corresponding relationship in part;Sending module 403, for by the first node identify and updated node believe
Breath set is sent to the new network access node so that the new network access node identified according to the first node and it is described more
Nodal information set after new generates the configuration file of the new network access node, so that the distributed coordination system be added.
Optionally, further includes:
Memory module 404, for the nodal information set to be stored in advance;The nodal information set includes the main section
The corresponding relationship of the IP address of the node identification and host node of point and the node identification from node and described from section
The corresponding relationship of the IP address of point.
Optionally, the receiving module 401, is specifically used for:
The networking request message that new network access node is sent is received in fixed port;The port and the new network access node are sent out
The port for being sent into net request message is consistent.
The host node of the present embodiment can be used for executing the technical solution of embodiment of the method as shown in Figure 1, realization principle
Similar with technical effect, details are not described herein again.
Fig. 5 is the new network access node structural schematic diagram in distributed coordination system provided in an embodiment of the present invention, such as Fig. 5 institute
Show, the new network access node of the present embodiment may include: sending module 501, receiving module 502 and processing module 503;Wherein, it sends out
Module 501 is sent, includes the new networking section in the message for sending message to the host node of the distributed coordination system
The Internet protocol IP address of point;Receiving module 502, for receiving the first node mark and node letter that the host node is sent
Breath set, it is that the new network access node distributes that the first node, which is identified as the host node according to the networking request message,
's;The corresponding relationship of the IP address of node identification and the host node in the nodal information set including the host node,
The corresponding relationship of the node identification of slave node in the distributed coordination system and the IP address from node and described
The corresponding relationship of first node mark and the IP address of the new network access node;Processing module 503, for according to the first segment
Point identification and the nodal information set generate the configuration file of the new network access node, starting operation, to be added described point
Cloth coordinates system.
Optionally, further includes:
Monitoring module 504 is used for after the distributed coordination system is added in the new network access node, the real-time or period
The nodal information set monitored on the host node to property will be updated if the nodal information set updates
Corresponding relationship in the nodal information set is added in the configuration file of the new network access node.
Optionally, the sending module 501, is specifically used for:
Networking request message is sent to the host node of the distributed coordination system in fixed port;The port with it is described
The port that host node receives the networking request message is consistent.
The new network access node of the present embodiment can be used for executing the technical solution of embodiment of the method as shown in Figure 3, realize
Principle is similar with technical effect, and details are not described herein again.
Fig. 6 is another structural schematic diagram of host node in distributed coordination system provided in an embodiment of the present invention.Such as Fig. 6 institute
Show, host node provided in this embodiment includes processor 601, memory 602 and communication interface 603;The processor 601, institute
Memory 602 and the communication interface 603 is stated to be connected with each other by bus.
The processor 601 runs program in the memory 602, implement for executing method as shown in Figure 1 of the invention
Technical solution provided by example, it is similar that the realization principle and technical effect are similar, can refer to embodiment of the method shown in FIG. 1, herein not
It repeats again.
The memory 602 stores program.Specifically, program may include program code, and said program code includes meter
Calculation machine operational order.Memory 602 may include random access memory (random access memory, abbreviation RAM),
It may further include nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
The memory 602 can also be used to store the nodal information set;It can also be used to store matching for the host node
Set file.
The communication interface 603 includes the fixed port that the host node receives the networking request message.
The processor 601 can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;Can also be digital signal processor (DSP),
Specific integrated circuit (ASIC), field programmable gate array (FPGA) either other programmable logic device, discrete gate or crystalline substance
Body pipe logical device, discrete hardware components.
Fig. 7 is another structural schematic diagram of the new network access node in distributed coordination system provided in an embodiment of the present invention.
As shown in fig. 7, new network access node provided in this embodiment includes processor 701, memory 702 and communication port 703.The place
Device 701, the memory 702 and the communication port 703 is managed to be connected with each other by bus.
The memory 702 stores program.Specifically, program may include program code, and said program code includes meter
Calculation machine operational order.Memory 702 may include RAM, it is also possible to and it further include nonvolatile memory, a for example, at least disk
Memory.
The processor 701 runs program in the memory 702, implements for executing method as shown in Figure 3 of the invention
Technical solution provided by example, it is similar that the realization principle and technical effect are similar, can refer to embodiment of the method shown in Fig. 3, herein not
It repeats again.
The memory 702 can also be used in the configuration file for storing the new network access node.
The communication interface 703 includes the fixed port that the new network access node sends the networking request message.
The processor 701 can be general processor, including central processor CPU, NP etc.;Can also be DSP,
ASIC, FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
Fig. 8 is the structural schematic diagram of distributed coordination system provided in an embodiment of the present invention.As shown in figure 8, the present embodiment
The distributed coordination system of offer includes:
Host node, at least two are from node and new network access node;Wherein, the host node can be any using Fig. 4, Fig. 6
The structure of embodiment accordingly can execute the technical solution of embodiment of the method as shown in Figure 1;The new network access node can
The technical solution of embodiment of the method as shown in Figure 3 accordingly can be executed using the structure of Fig. 5, Fig. 7 any embodiment,
That the realization principle and technical effect are similar is similar for it, and details are not described herein again.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, apparatus embodiments described above are merely indicative, for example, the unit or module
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or module
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of equipment or module
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module
The component shown may or may not be physical module, it can and it is in one place, or may be distributed over multiple
In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (13)
1. increasing the method for network entry of node in a kind of distributed coordination system newly characterized by comprising
The host node of the distributed coordination system receives the networking request message that new network access node is sent, the networking request report
Text includes the Internet protocol IP address of the new network access node;
The host node is the new network access node distribution first node mark according to the networking request message, and in the master
Increase by the first corresponding relationship in the configuration file of node, first corresponding relationship includes the first node mark and described new
The IP address of network access node;
The host node increases by first corresponding relationship in nodal information set, obtains updated nodal information set,
So that the nodal information set on from monitoring nodes to the host node of the distributed coordination system updates
Afterwards, increase by first corresponding relationship in the configuration file from node;
The host node identifies the first node and updated nodal information set is sent to the new network access node,
So that the new network access node is according to identifying the first node and the updated nodal information set generates
The configuration file of new network access node, so that the distributed coordination system be added.
2. the method according to claim 1, wherein the host node of the distributed coordination system receives new network
Before the networking request message that node is sent, further includes:
The nodal information set is stored in advance in the host node;The nodal information set includes the node mark of the host node
Know and the corresponding relationship of the IP address of the host node and the node identification from node and the IP address from node
Corresponding relationship.
3. method according to claim 1 or 2, which is characterized in that the host node of the distributed coordination system receives new
The networking request message that network access node is sent, comprising:
The host node receives the networking request message that new network access node is sent in fixed port;The port and the new networking
The port that node sends networking request message is consistent.
4. increasing the method for network entry of node in a kind of distributed coordination system newly characterized by comprising
New network access node sends networking request message to the host node of the distributed coordination system, in the networking request message
Internet protocol IP address including the new network access node;
The new network access node receives the first node mark and nodal information set that the host node is sent, the first segment
It according to the networking request message is that the new network access node distributes that point identification, which is the host node,;The nodal information set
In include the host node node identification and the host node IP address corresponding relationship, in the distributed coordination system
The node identification of slave node and the corresponding relationship of the IP address from node and first node mark and described new
The corresponding relationship of the IP address of network access node;
The new network access node generates the new network access node according to first node mark and the nodal information set
Configuration file, starting operation, so that the distributed coordination system be added.
5. according to the method described in claim 4, it is characterized in that, the distributed coordination system is added in the new network access node
After system, the method also includes:
The new network access node monitors in real time or periodically the nodal information set on the host node, if the node
Information aggregate updates, and the corresponding relationship in the updated nodal information set is added to the new network access node
In configuration file.
6. method according to claim 4 or 5, which is characterized in that the new network access node is to the distributed coordination system
The host node of system sends networking request message, comprising:
The new network access node sends networking request message to the host node of the distributed coordination system in fixed port;It is described
Port is consistent with the port that the host node receives the networking request message.
7. the host node in a kind of distributed coordination system characterized by comprising
Receiving module, the networking request message sent for receiving new network access node;The networking request message includes described new
The Internet protocol IP address of network access node;
Processing module, for being the new network access node distribution first node mark according to the networking request message, and in institute
It states and increases by the first corresponding relationship in the configuration file of host node, first corresponding relationship includes the first node mark and institute
State the IP address of new network access node;It is also used to increase by first corresponding relationship in nodal information set, obtain updated
Nodal information set, so that the nodal information on from monitoring nodes to the host node of the distributed coordination system
After set updates, increase by first corresponding relationship in the configuration file from node;
Sending module, for identifying the first node and updated nodal information set is sent to the new networking and saves
Point, so that the new network access node is identified according to the first node and the updated nodal information set generates institute
The configuration file of new network access node is stated, so that the distributed coordination system be added.
8. host node according to claim 7, which is characterized in that further include:
Memory module, for the nodal information set to be stored in advance;The nodal information set includes the section of the host node
The corresponding relationship of the IP address of point identification and the host node and the node identification and the IP from node from node
The corresponding relationship of address.
9. host node according to claim 7 or 8, which is characterized in that the receiving module is specifically used for:
The networking request message that new network access node is sent is received in fixed port;The port is transmitted into the new network access node
The port of net request message is consistent.
10. the new network access node in a kind of distributed coordination system characterized by comprising
Sending module newly enters in the message including described for sending message to the host node of the distributed coordination system
The Internet protocol IP address of net node;
Receiving module, for receiving the first node mark and nodal information set that the host node is sent, the first segment
It according to the networking request message is that the new network access node distributes that point identification, which is the host node,;The nodal information set
In include the host node node identification and the host node IP address corresponding relationship, in the distributed coordination system
The node identification of slave node and the corresponding relationship of the IP address from node and first node mark and described new
The corresponding relationship of the IP address of network access node;
Processing module, for generating matching for the new network access node according to first node mark and the nodal information set
Set file, starting operation, so that the distributed coordination system be added.
11. new network access node according to claim 10, which is characterized in that further include:
Monitoring module, for being supervised after the distributed coordination system is added in the new network access node in real time or periodically
The nodal information set on the host node is controlled, if the nodal information set updates, by the updated section
Corresponding relationship in point information aggregate is added in the configuration file of the new network access node.
12. new network access node described in 0 or 11 according to claim 1, which is characterized in that the sending module is specifically used for:
Networking request message is sent to the host node of the distributed coordination system in fixed port;The port and the main section
The port that point receives the networking request message is consistent.
13. a kind of distributed coordination system characterized by comprising
If the described in any item host nodes of claim 7-9, at least two are from node and as described in claim any one of 10-12
New network access node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410649690.3A CN105656653B (en) | 2014-11-14 | 2014-11-14 | Increase method of network entry, the device and system of node in distributed coordination system newly |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410649690.3A CN105656653B (en) | 2014-11-14 | 2014-11-14 | Increase method of network entry, the device and system of node in distributed coordination system newly |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105656653A CN105656653A (en) | 2016-06-08 |
CN105656653B true CN105656653B (en) | 2019-07-19 |
Family
ID=56478918
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410649690.3A Active CN105656653B (en) | 2014-11-14 | 2014-11-14 | Increase method of network entry, the device and system of node in distributed coordination system newly |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105656653B (en) |
Families Citing this family (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106202490A (en) * | 2016-07-19 | 2016-12-07 | 浪潮电子信息产业股份有限公司 | A kind of SolrCloud configuration file amending method, Apparatus and system |
CN106330923B (en) * | 2016-08-26 | 2019-10-25 | 中国联合网络通信集团有限公司 | Node registering method and system based on Kubernetes system |
CN106648648B (en) * | 2016-12-14 | 2020-09-15 | 深圳中顺易金融服务有限公司 | Zookeeper-based configuration management method and system |
CN106789291A (en) * | 2016-12-29 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of cluster member control method and device |
CN107295063B (en) * | 2017-05-11 | 2018-09-04 | 腾讯科技(深圳)有限公司 | Increase the method for node and reciprocity distributed system newly in reciprocity distributed system |
CN107220897B (en) * | 2017-05-24 | 2023-04-07 | 腾讯科技(深圳)有限公司 | Income posting processing method and device and processing system |
CN107332936A (en) * | 2017-08-25 | 2017-11-07 | 长沙曙通信息科技有限公司 | A kind of distributed storage distribution and installation network system realization |
CN108804119A (en) * | 2018-04-28 | 2018-11-13 | 北京金山云网络技术有限公司 | Configure update method, device, system, configuration center, application node and medium |
CN108958885A (en) * | 2018-06-27 | 2018-12-07 | 郑州云海信息技术有限公司 | A kind of management method and device of configuration information |
CN110661637A (en) | 2018-06-30 | 2020-01-07 | 华为技术有限公司 | Distributed system member changing method and distributed system |
CN109040290B (en) * | 2018-08-27 | 2021-03-09 | 成都安恒信息技术有限公司 | Method for electing main node based on node characteristics |
CN109309583B (en) * | 2018-08-30 | 2021-11-23 | 百度在线网络技术(北京)有限公司 | Information acquisition method and device based on distributed system, electronic equipment and medium |
CN109376111A (en) * | 2018-09-26 | 2019-02-22 | 郑州云海信息技术有限公司 | A kind of server cluster and its rear end management method |
CN109614164B (en) * | 2018-11-29 | 2021-09-28 | 深圳前海微众银行股份有限公司 | Method, device and equipment for realizing configurable plug-in and readable storage medium |
CN109936642A (en) * | 2019-01-28 | 2019-06-25 | 中国银行股份有限公司 | The method, apparatus and system of machine ID are generated in a kind of distributed system |
CN110209480B (en) * | 2019-05-17 | 2024-01-30 | 腾讯科技(深圳)有限公司 | Data packet operation method, device and system |
CN110381125A (en) * | 2019-06-29 | 2019-10-25 | 苏州浪潮智能科技有限公司 | A kind of information acquisition method and device |
CN110401651A (en) * | 2019-07-19 | 2019-11-01 | 苏州浪潮智能科技有限公司 | A kind of distributed type assemblies node monitoring method, apparatus and system |
CN111478953B (en) * | 2020-03-27 | 2022-09-06 | 北京金山云网络技术有限公司 | Self-construction method, device, system, equipment and storage medium of server cluster |
CN111918305B (en) * | 2020-07-24 | 2023-10-03 | 湖南遥昇通信技术有限公司 | Same-frequency self-organizing self-healing network method and device |
CN112199167A (en) * | 2020-11-05 | 2021-01-08 | 成都精灵云科技有限公司 | High-availability method for multi-machine rapid one-key deployment based on battlefield environment |
CN112559087A (en) * | 2020-12-28 | 2021-03-26 | 北京五八信息技术有限公司 | Information generation method and device, electronic equipment and computer readable medium |
CN113395198B (en) * | 2021-06-16 | 2022-12-27 | 广州极飞科技股份有限公司 | Networking method and device of equipment and data transmission system |
CN116112354A (en) * | 2022-12-07 | 2023-05-12 | 广州芯德通信科技股份有限公司 | Distributed network fusion management method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102545961A (en) * | 2010-12-31 | 2012-07-04 | 弥亚微电子(上海)有限公司 | Active reporting and automatic networking method and system for non-networked node |
CN102591934A (en) * | 2011-12-23 | 2012-07-18 | 国网电力科学研究院 | Zookeeper-based method for realizing automatic expansion and switching of multiple Solr Shards |
CN102932210A (en) * | 2012-11-23 | 2013-02-13 | 北京搜狐新媒体信息技术有限公司 | Method and system for monitoring node in PaaS cloud platform |
CN103092698A (en) * | 2012-12-24 | 2013-05-08 | 中国科学院深圳先进技术研究院 | System and method of cloud computing application automatic deployment |
CN103294701A (en) * | 2012-02-24 | 2013-09-11 | 联想(北京)有限公司 | Distributed file system and data processing method |
CN103634375A (en) * | 2013-11-07 | 2014-03-12 | 华为技术有限公司 | Method, device and equipment for cluster node expansion |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9063939B2 (en) * | 2011-11-03 | 2015-06-23 | Zettaset, Inc. | Distributed storage medium management for heterogeneous storage media in high availability clusters |
US9268808B2 (en) * | 2012-12-31 | 2016-02-23 | Facebook, Inc. | Placement policy |
US9342369B2 (en) * | 2013-01-07 | 2016-05-17 | Wal-Mart Stores, Inc. | System and method for increasing throughput of a PaaS system |
-
2014
- 2014-11-14 CN CN201410649690.3A patent/CN105656653B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102545961A (en) * | 2010-12-31 | 2012-07-04 | 弥亚微电子(上海)有限公司 | Active reporting and automatic networking method and system for non-networked node |
CN102591934A (en) * | 2011-12-23 | 2012-07-18 | 国网电力科学研究院 | Zookeeper-based method for realizing automatic expansion and switching of multiple Solr Shards |
CN103294701A (en) * | 2012-02-24 | 2013-09-11 | 联想(北京)有限公司 | Distributed file system and data processing method |
CN102932210A (en) * | 2012-11-23 | 2013-02-13 | 北京搜狐新媒体信息技术有限公司 | Method and system for monitoring node in PaaS cloud platform |
CN103092698A (en) * | 2012-12-24 | 2013-05-08 | 中国科学院深圳先进技术研究院 | System and method of cloud computing application automatic deployment |
CN103634375A (en) * | 2013-11-07 | 2014-03-12 | 华为技术有限公司 | Method, device and equipment for cluster node expansion |
Also Published As
Publication number | Publication date |
---|---|
CN105656653A (en) | 2016-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105656653B (en) | Increase method of network entry, the device and system of node in distributed coordination system newly | |
US20210160157A1 (en) | Technologies for annotating process and user information for network flows | |
US9781037B2 (en) | Method and apparatus for advanced statistics collection | |
CN112702214B (en) | Method and system for configuring a network | |
CN105024855B (en) | Distributed type assemblies manage system and method | |
CN104025508B (en) | For finding the method, equipment and device of multiple spot end points in a network environment | |
EP2843906B1 (en) | Method, apparatus, and system for data transmission | |
US9742639B1 (en) | Intelligent network resource discovery and monitoring | |
US20150003296A1 (en) | System and method for providing p2p based reconfigurable computing and structured data distribution | |
US20180041396A1 (en) | System and method for topology discovery in data center networks | |
US9088477B2 (en) | Distributed fabric management protocol | |
US20170317899A1 (en) | Using traffic data to determine network topology | |
CN103997414A (en) | Configuration information generation method and network control unit | |
JP2013539877A5 (en) | ||
US9692819B2 (en) | Detect process health remotely in a realtime fashion | |
CN108259215B (en) | Equipment management method and device | |
Chen et al. | DAC: Generic and automatic address configuration for data center networks | |
US10206092B1 (en) | Automatic discovery | |
US10404544B2 (en) | Network topology determining method and apparatus, and centralized network status information storage device | |
CN106533712B (en) | Realize method, system and the equipment of NFV resource pool Topology Discovery | |
CN103825759A (en) | Method and system for acquiring network topological information | |
WO2016081261A1 (en) | Inline packet tracing in data center fabric networks | |
Porter et al. | DeSARM: A Decentralized Mechanism for Discovering Software Architecture Models at Runtime in Distributed Systems. | |
CN108924011A (en) | Monitoring system, relevant device, method and medium for OSPF+ Routing Protocol | |
US10833918B2 (en) | Automatic rule based grouping of compute nodes for a globally optimal cluster |
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 |