CN107087032B - Realize the method and apparatus that cluster is set up - Google Patents

Realize the method and apparatus that cluster is set up Download PDF

Info

Publication number
CN107087032B
CN107087032B CN201710335688.2A CN201710335688A CN107087032B CN 107087032 B CN107087032 B CN 107087032B CN 201710335688 A CN201710335688 A CN 201710335688A CN 107087032 B CN107087032 B CN 107087032B
Authority
CN
China
Prior art keywords
cluster
node
newly
network address
request
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
Application number
CN201710335688.2A
Other languages
Chinese (zh)
Other versions
CN107087032A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710335688.2A priority Critical patent/CN107087032B/en
Publication of CN107087032A publication Critical patent/CN107087032A/en
Application granted granted Critical
Publication of CN107087032B publication Critical patent/CN107087032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/185Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with management of multicast group membership
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing

Abstract

Present invention is disclosed a kind of method and apparatus realized cluster and set up.Cluster internal affixes one's name to node, and the method is applied to the newly-increased node of cluster, the method includes:Newly-increased node initiates network address by multicast and obtains request, and the node disposed in newly-increased node and cluster is in same multicast group;The response for obtaining request to network address by cluster interior nodes, obtains the network address of cluster interior nodes;Cluster is added by network address request;It is performed with increasing node in cluster newly operation being added and newly-increased node is made to obtain cluster interior nodes information, complete cluster adition process.So far, just so that newly-increased addition of the node in cluster is not need to rely on single-point node, such as the control centre of aforementioned meaning, in other words, and individual control centre is not present, adition process can be completed in network address corresponding to acquired any node, is not necessarily to additional operation, the flexibility that newly-increased node is added and cluster is realized is enhanced, it is flexibly quickly automatic to set up cluster.

Description

Realize the method and apparatus that cluster is set up
Technical field
The present invention relates to net application technology field, more particularly to a kind of method and apparatus realized cluster and set up.
Background technology
With the continuous development of network, various network applications emerge one after another, the realization that disparate networks are answered, and all be unable to do without cluster Cooperation, the problems such as to avoid thing followed network delay, loss of data etc..In the topological structure of existing cluster, including one Control centre and all multinodes.Control centre is mainly used to create cluster, also it is believed that control centre is first of cluster Node, the node of follow-up institute's addition cluster in need, is required for realizing by control centre.
In cluster, only control centre knows cluster interior nodes information, and in other words, all nodes all must in cluster The relevant information of cluster must be obtained by control centre.
Specifically, when newly-increased node needs that cluster is added, got first by configuration file or other manner The address of control centre, the thus connection of address creation to control centre are sent to control centre by the connection of establishment and are added Enter cluster request, the cluster adition process for increasing node newly is completed under the action of control centre.
It can be seen that cluster, which is set up, depends on control centre.For increasing the addition of node newly, due to must be known by controlling The address at center processed, flexibility are bad.Once and control centre changes, and will also cause inconvenience accordingly.
Invention content
It is built dependent on this single-point of control centre to solve cluster group present in the relevant technologies, causes newly-increased node Be added and the bad technical problem of flexibilities such as realization of cluster, the present invention provides it is a kind of realizes method that cluster is set up with Device.
A method of realizing that cluster is set up, the cluster internal affixes one's name to node, and the method is applied to the new of the cluster Increase node, the method includes:
The newly-increased node initiates network address by multicast and obtains request, the newly-increased node and portion of institute in the cluster The node of administration is in same multicast group;
The response of request is obtained to the network address by cluster interior nodes, with obtaining the network of the cluster interior nodes Location;
The cluster is added by the network address request;
It is performed with increasing node in cluster newly operation being added and the newly-increased node is made to obtain cluster interior nodes information, it is complete At the cluster adition process of the newly-increased node.
A method of realizing that cluster is set up, the cluster internal affixes one's name to node, and the method is applied to quilt in the cluster The node of deployment, the method includes:
The network address acquisition that the node receives multicast is asked, and the node that network address obtains request described in multicast is institute State the newly-increased node of cluster;
The network address is responded to obtain request and return to itself network address;
As the cluster is added according to the network address request in the newly-increased node, executes and increase node addition behaviour newly Make.
A kind of device realized cluster and set up, the cluster internal affix one's name to node, and described device is applied to the newly-increased section of cluster Point, described device include:
Group broadcasting module obtains request, the newly-increased node and institute in the cluster for initiating network address by multicast The node of deployment is in same multicast group;
Response obtains module, the response for obtaining request to the network address by cluster interior nodes, described in acquisition The network address of cluster interior nodes;
Module is added in request, for the cluster to be added by the network address request;
Nodal information obtains module, for being performed and making the newly-increased node with increasing node in cluster newly operation is added Cluster interior nodes information is obtained, the cluster adition process of the newly-increased node is completed.
A kind of device realized cluster and set up, the cluster internal affix one's name to node, and described device is applied to quilt in the cluster The node of deployment, described device include:
Multicast reception module, the network address for receiving multicast obtain request, and network address obtains request described in multicast Node be the cluster newly-increased node;
Ask respond module returns to itself network address for responding the network address acquisition request;
Operation executing module, for as the newly-increased node is according to the network address request addition cluster, holding Operation is added in the newly-increased node of row.
The technical solution that the embodiment of the present invention provides can include the following benefits:
In the realization of cluster, On-premise node for cluster is added, increases newly for the newly-increased node of cluster Node initiates network address by multicast first and obtains request, and the node disposed in newly-increased node and cluster is in same multicast Group obtains network address by cluster interior nodes the response of request, obtains the network address of cluster interior nodes, by network Cluster is added in location request, is performed with increasing node in cluster newly operation being added and newly-increased node is made to obtain cluster interior nodes letter Breath completes the cluster adition process for increasing node newly, so far, just so that newly-increased addition of the node in cluster is not need to rely on list In other words, and individual control centre is not present, by acquired any section in point node, such as control centre of aforementioned meaning Adition process can be completed in the corresponding network address of point, is not necessarily to additional operation, enhances newly-increased node addition and cluster is real Existing flexibility, it is flexibly quickly automatic to set up cluster.
It should be understood that above general description and following detailed description is merely exemplary, this can not be limited Invention.
Description of the drawings
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the present invention Example, and in specification together principle for explaining the present invention.
Fig. 1 is the schematic diagram according to implementation environment according to the present invention;
Fig. 2 is a kind of block diagram of device shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of method for realizing cluster establishment shown according to an exemplary embodiment;
Fig. 4 is the flow chart that the details to step 310 according to fig. 3 shown in corresponding embodiment is described;
Fig. 5 is the flow chart that the details to step 330 shown in Fig. 3 corresponding embodiments is described;
Fig. 6 is the flow chart that the details to step 350 according to fig. 3 shown in corresponding embodiment is described;
Fig. 7 is the flow chart being described according to the details to step 351 shown in Fig. 6 corresponding embodiments;
Fig. 8 is a kind of flow chart of method for realizing cluster establishment shown according to an exemplary embodiment;
Fig. 9 is the flow chart being described according to the details to step 550 shown in Fig. 8 corresponding embodiments;
Figure 10 is according to the cluster interior nodes topology schematic diagram shown in an exemplary embodiment;
Figure 11 is according to the application schematic diagram for realizing that newly-increased node is added in the cluster shown in Figure 10 corresponding embodiments;
Figure 12 is a kind of block diagram of device for realizing cluster establishment shown according to an exemplary embodiment;
Figure 13 is the block diagram being described according to the details for request being added module shown in Figure 12 corresponding embodiments;
Figure 14 is according to a kind of realization cluster being applied in cluster by deployment node shown in an exemplary embodiment The block diagram of the device of establishment;
Figure 15 is the block diagram being described according to the details to operation executing module shown in Figure 14 corresponding embodiments.
Specific implementation mode
Here will explanation be executed to exemplary embodiment in detail, the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent and the consistent all embodiments of the present invention.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects being described in detail in claims, of the invention.
Fig. 1 is the schematic diagram according to implementation environment according to the present invention.The implementation environment includes several nodes 110, Cluster is realized by the deployment of several nodes 110.
Signified node 110 is that any machine of network application function, such as server are realized in cluster.Implement herein In environment, the method provided through the invention is realized that each of cluster and cluster internal is added in newly-increased node by node 110 Kind control is realized, and then can flexibly cope with cluster interior joint and various variations occur.
Fig. 2 is a kind of block diagram of device shown according to an exemplary embodiment.For example, device 200 can be shown in Fig. 1 In implementation environment, any one machine of cluster.
With reference to Fig. 2, a kind of block diagram of device shown according to an exemplary embodiment.For example, device 200 can be Fig. 1 The machine that cluster includes in shown implementation environment, such as server.
With reference to Fig. 2, which can generate bigger difference because configuration or performance are different, may include one or More than one central processing unit (central processing units, CPU) 222 is (for example, one or more are handled Device) and memory 232, one or more storage application programs 242 or data 244 storage medium 230 (such as one or More than one mass memory unit).Wherein, memory 232 and storage medium 230 can be of short duration storage or persistent storage.It deposits Storage may include one or more modules (diagram is not shown) in the program of storage medium 230, and each module may include To the series of instructions operation in server.Further, central processing unit 222 could be provided as logical with storage medium 230 Letter executes the series of instructions operation in storage medium 230 on the device 200.Device 200 can also include one or one with Upper power supply 226, one or more wired or wireless network interfaces 250, one or more input/output interfaces 258, And/or one or more operating systems 241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..Described in following Fig. 3, Fig. 4, Fig. 5, Fig. 6, Fig. 7, Fig. 8 and embodiment illustrated in fig. 9 by collecting The newly-increased node of group or the step performed by cluster interior nodes can be based on the apparatus structure shown in Fig. 2.
Fig. 3 is a kind of flow chart of method for realizing cluster establishment shown according to an exemplary embodiment.Cluster internal Node is affixed one's name to, the method which sets up is applied to the newly-increased node of cluster.
Referring to Fig. 3, the method that the realization cluster is set up, may comprise steps of.
In the step 310, it increases node newly and network address acquisition request is initiated by multicast, increase node and portion of institute in cluster newly The node of administration is in same multicast group.
Wherein, newly-increased node is to increase node and whole sections in cluster newly for the cluster that itself is not added Point or part of nodes are in same multicast group, therefore, will be asked that cluster is added by means of multicast group, to become in cluster A node.
Newly-increased node can initiate network address to the node in cluster by multicast and obtain request, be in newly-increased node The node of same multicast group will receive this network address and obtain request, so that newly-increased node can be obtained in cluster and be saved The response of point.
The two will be enable to obtain an interaction channel by means of multicast group newly-increased between node and cluster, is as a result, Newly-increased node is added cluster and provides breach, without it is additional be that newly-increased node is based on various configuration files of cluster progress etc. Setting, flexibility enhanced so that any node except cluster can be dynamically added cluster as newly-increased node.
Specifically, Fig. 4 is the flow chart that the details to step 310 according to fig. 3 shown in corresponding embodiment is described. The step 310, as shown in figure 4, may comprise steps of.
In step 311, node is increased newly according to the multicast group where cluster interior nodes, configures corresponding multicast address.
For cluster is added in the newly-increased node realized by multicast group, the realization of multicast group in cluster is simple easy Row, and can realize as needed and rapidly, on the one hand ensure that reliability that newly-increased node can realize that cluster is added and Stability, on the other hand, but also the establishment of cluster being capable of dynamic implement.
In step 313, multicast is being carried out where cluster interior nodes in multicast group according to multicast address, with initiating network Location obtains request.
Wherein, newly-increased node will initiate multicast by multicast address, and all nodes can all receive newly-increased node in cluster The network address of transmission obtains request.
In cluster, the node for being in same multicast group with newly-increased node all obtains after receiving network address and obtaining request It is derived from the network address of body, and encapsulates to network address and obtains in the corresponding response bag of request, and then is returned to newly-increased node Response bag, increasing node newly as a result, just can obtain the network address of cluster interior nodes.
By this exemplary embodiment, just for increase newly node in multicast carry out provide specific implementation, for being unaware of The relevant any information of cluster institute, and independently of the newly-increased node except cluster for, sent out by this exemplary embodiment Interaction between raw and cluster, and then lay the foundation for the follow-up final realization that cluster is added.
In a step 330, the response of request is obtained to network address by cluster interior nodes, obtains the net of cluster interior nodes Network address.
Wherein, the node of same multicast group is in cluster with newly-increased node, the realization mechanism based on multicast all will necessarily Request is obtained to the network address of reception to respond.Corresponding, newly-increased node can obtain at least one section in cluster The response of point, and then the corresponding network address for obtaining at least one node in cluster.
Further, Fig. 5 is the flow chart that the details to step 330 shown in Fig. 3 corresponding embodiments is described.The step Rapid 330, as shown in figure 5, may comprise steps of.
In step 331, receives cluster interior nodes response to network address and obtain request and the response bag of return.
Wherein, as previously described, each node in cluster, receive network address obtain request after all will to this into Row response, to newly-increased node returning response packet.Response bag is the response that node obtains network address request.
Response bag carries the network address of cluster interior nodes.Node is increased newly after initiating network address and obtaining request, The response bag that cluster internal point or all nodes return will be received, any response bag has the network address of respective nodes, So far, newly-increased node is just enable to obtain the network address that can realize interaction in cluster.
In step 333, the extraction of network address in response bag is carried out, obtains the network address of cluster interior nodes.
Wherein, it increases the extraction that node carries out one or more response bags of reception network address respectively newly, obtains cluster The network address of interior multiple nodes, any network address can make newly-increased node be interacted with the node in cluster.
In one exemplary embodiment, before step 330, the method which sets up is further comprising the steps of.
Judge that whether within a specified time response to network address obtains request to cluster interior nodes, if NO, then increases section newly Point creates cluster, and as the control node of cluster, if YES, then executes this step 330.
Wherein, it increases node newly to ask once initiating network address and obtaining, just triggering timing, is within a specified time to confirm It is no obtain cluster interior nodes response then illustrate that cluster is not created if NO, newly-increased node can as control node and Cluster is created, and then waits for other newly-increased nodes that cluster is added.
Control node is used to control the realization of various functions in the adition process and cluster that increase node in cluster newly.It is right In a cluster, there is a control nodes.Each node all stores cluster interior nodes information, cluster interior nodes information in cluster At least have recorded the node of cluster internal administration and the network address of each node.As a result, any node all has in cluster The standby condition for becoming control node, once and then control node break down, can be the new control node of cluster configuration, a side Face ensure that the disaster tolerance in cluster, on the other hand also ensure the robustness of cluster.
If newly-increased node has within a specified time obtained the response of cluster interior nodes, thus respond with obtaining network Location, i.e., as shown in step 331 to step 333.
Further, the signified response for whether within a specified time obtaining cluster interior nodes, as whether when specified The interior response bag for obtaining cluster interior nodes.It initiates after network address acquisition is asked if timing has reached specified time, But it is not responded yet, that is, receives response bag, then illustrate that cluster is not populated, newly-increased node directly carries out the wound of cluster It builds.
In step 350, cluster is added by network address request.
Wherein, after obtaining network address by the response of cluster interior nodes, you can via the network address request of acquisition Cluster is added.As previously described, the network address that cluster interior nodes are responded and obtained may be one or more, in acquisition When network address is multiple, a network address will be chosen and ask that cluster is added.
In step 370, it is performed and newly-increased node is made to obtain cluster internal segment with increasing node in cluster newly operation is added Point information completes the cluster adition process for increasing node newly.
Wherein, all will be that newly-increased node be held after any node receives the addition cluster request of newly-increased node in cluster The corresponding cluster adition process of row.Can be collection herein it should be noted that receiving the node that cluster request is added in cluster The control node of group, can also ordinary node in cluster.
It is control node to receive and the node of cluster request is added, then can directly execute and increase node addition behaviour in cluster newly Make;It is ordinary node in cluster to receive and the node of cluster request is added, then cluster request will be added by, which needing, is forwarded in cluster Control node.
It increases nodal operation in cluster newly, refers to the operation executed for the addition of newly-increased node in cluster.Show at one In example property embodiment, according to the difference that cluster request is added is received, it is different to increase nodal operation newly in performed cluster. It increases and will add specifically, increasing nodal operation newly relative to control node, in the cluster performed by ordinary node in cluster Enter the process that cluster request is forwarded to control node.
In addition to this, no matter which kind of node, in cluster increase newly node be added operation will all execute to newly-increased node return Response bag, and all nodes carry out the notice of newly-increased nodal information into cluster, in this regard, the cluster for just completing to increase newly node adds Enter process.
By exemplary embodiment as described above, the Dynamical Deployment of cluster interior nodes is realized so that any newly-increased section Point can flexibly rapidly join cluster, reduce the complexity of cluster establishment, increase the flexibility of cluster management, Ren Yixin Increasing node can be automatically added in cluster.
Fig. 6 is the flow chart that the details to step 350 according to fig. 3 shown in corresponding embodiment is described.The step 350, as shown in fig. 6, may comprise steps of.
In step 351, the network address of cluster interior nodes is randomly selected.
Wherein, as previously described, the network address that multiple nodes in cluster are obtained by the response of cluster interior nodes, at this In a little network address, randomly selecting for a network address is carried out, the network address for randomly selecting and obtaining is real for increasing node newly Now with the communication of cluster interior nodes.
In step 353, itself connection between cluster interior nodes is created according to the network address randomly selected.
In step 355, initiate that cluster request is added by the connection of establishment.
By exemplary embodiment as described above, newly-increased node is able to establish with a node in cluster and connect, and the section Point can be interconnected as the node in cluster with other meshed networks in cluster, therefore increasing node newly can be via connecting The node that connects and the adition process for initiating to increase newly node rapidly in cluster, having very high cluster is added flexibility, does not need Any operation bidirectional.
Further, Fig. 7 is the flow chart being described according to the details to step 351 shown in Fig. 6 corresponding embodiments. In one exemplary embodiment, step 351, as shown in fig. 7, may comprise steps of.
In step 3511, the network address of static configuration is obtained, network address corresponds to all nodes of cluster internal administration In other nodes of same multicast group are not in newly-increased node.
Wherein, the network address of static configuration refers to the network address of one or more node cluster Nei.It will be in cluster The network address of one or more node is fixedly configured in newly-increased node, initiates to carry out follow-up for newly-increased node Node connection and be added cluster request initiation.
The network address for carrying out static configuration in newly-increased node, also corresponds to the node in cluster, still, corresponding Node and newly-increased node and untreated same multicast group.
In step 3513, the network that the by of asking obtains is obtained in the network address of static configuration and by network address In location, a network address is randomly selected.
Wherein, it increases newly in node, on the one hand by the static configuration of progress, there is some network address, on the other hand, Obtaining request by the network address that multicast is initiated, there is also some other network address.This two classes network address, can So that newly-increased node is communicated with the node in cluster.
Therefore, newly-increased node will randomly select a network address in this two classes network address.That is, showing at one In example property embodiment, the network address carried out randomly selects the network address for being no longer confined to obtain by multicast, even if collection There is no the nodes that same multicast group is in newly-increased node can also realize being automatically added to for cluster in group, eliminates limitation Property, reduce due to being constrained caused by multicast, realizes that cluster is set up under multicast and static network address immixture.
In another exemplary embodiment, for the network address of static configuration and by network address obtains request The network address of acquisition, newly-increased node will use a network address to establish connection, and then create cluster, if a connection failure, Another network address is then used, and so on, if all connection all fails, increase the establishment that node carries out cluster newly, itself will Control node as created cluster.
Which kind of by this exemplary embodiment, for the establishment of cluster and addition, no matter equal in situation ensure that It can realize that cluster, the stability that cluster is set up are enhanced.
Corresponding, as the generation of colonization process is added in newly-increased node, cluster interior nodes will also ring this It answers, i.e., with respect to a kind of method realized cluster and set up is realized, is applied in the node disposed in cluster.
Fig. 8 is a kind of flow chart of method for realizing cluster establishment shown according to an exemplary embodiment.The realization collection The method that group builds, as shown in figure 8, may comprise steps of.
In step 510, node receives the network address acquisition request of multicast, and multicast network address obtains the node of request It is the newly-increased node of cluster.
Wherein, cluster internal administration has node, a node of cluster internal administration to be in multicast group, and newly-increased node is also at the group Broadcast group.The node for being in same multicast group in cluster with newly-increased node all asks acquisition network address acquisition.
In step 530, response to network address obtains request and returns to itself network address.
Wherein, the network address request response that cluster interior nodes are carried out, is to carry own net address by return Response bag is realized.Specifically, cluster interior nodes are after it receives network address acquisition request, response to network address obtains and asks The acquisition for carrying out own net address is asked, and is packaged, the response bag for carrying own net address is returned to newly-increased node.
In step 550, as cluster is added according to network address request in newly-increased node, executes and increase node addition behaviour newly Make.
Wherein, the inevitable one node initiation addition cluster request into cluster with the acquisition of network address of node is increased newly, So that cluster interior nodes are triggered to execute newly-increased node addition operation.Specifically, operation is added by collecting in newly-increased node Control node executes in group, receives the node node in order to control that cluster request is added;It certainly, also can be by cluster one common section Point and control node execute jointly, in the case where it is ordinary node to receive the node that cluster request is added.
It is appreciated that the realization of cluster is added for increasing node newly, any node for receiving its request, all may be used in cluster Operation is added to initiate to increase newly node, need not be initiated by specific node, so that cluster interior nodes ask newly-increased node It asks addition that any constraint is not present, while flexibility is high, ensures the dynamic change of cluster interior nodes.
Fig. 9 is the flow chart being described according to the details to step 550 shown in Fig. 8 corresponding embodiments.The step 550, as shown in figure 9, may comprise steps of.
In step 551, node is linked by increasing the connection that node carries out newly and creating with newly-increased node, increases section newly Connection in point, which creates, to be executed according to the network address randomly selected..
Wherein, as previously described, increase node newly after the network address of several nodes, will carry out net in acquisition cluster Network address randomly selects, and therefrom obtains a network address.By this network address of acquisition, in cluster respective nodes with it is new Increase node and realizes connection between the two.
In step 553, newly-increased node is carried out by connection and initiates the reception that cluster request is added.
In step 555, receive be added cluster request node judge itself whether be cluster control node, if it is It is to then follow the steps 557, if NO, thens follow the steps 559.
Wherein, the node that cluster request is added is received, is needed to newly-increased node response.Specifically, will first determine whether Whether itself is existing as the control node of cluster, if it is, directly respectively to owning in newly-increased node and cluster Node executes corresponding information and issues, and is asked to control node if it is not, then cluster is added in forwarding, by control node come to new Photos and sending messages under all nodes in increasing node and cluster.
In step 557, into newly-increased node and cluster, all nodes, which execute, increases node addition operation newly, makes newly-increased node Cluster interior nodes information is obtained, all nodes obtain newly-increased nodal information in cluster, complete the cluster adition process for increasing node newly.
Wherein, for increasing node newly, the addition cluster initiated it request is needed to return to respective response packet, to increase newly Node can obtain cluster interior nodes information, and cluster is added;
For cluster interior nodes, as previously described, each node is all stored with the cluster interior nodes corresponding to all nodes Information, when the node of cluster internal administration changes, i.e., the addition of newly-increased node, therefore should be by newly-increased nodal information into cluster Each node issues, and then ensures that each node stored information is adapted with the node deployment of cluster, ensure that information storage The promptness of integrality and dynamic change.
In step 559, cluster will be added and ask the control node for being forwarded to cluster.
By exemplary embodiment as described above, under the action of control node, certainly, in the case that a certain, also deposit In the cooperation of an ordinary node, the realization of cluster no longer needs to rely on control node this single-point, any to receive addition The node of cluster request, all executes cluster adition process for that can increase node newly.
In another exemplary embodiment, after step 550, the method which sets up further includes following step Suddenly.
In cluster after control nodes break down, all nodes, which are triggered, in cluster carries out the selection of new control node.
Wherein, as previously described, cluster memory is in a control node, but all nodes all store in cluster in cluster Nodal information, the topological structure of cluster interior nodes message reflection cluster internal administration node, therefore, control node once occur therefore Barrier, the new control node between making triggering carry out all nodes are chosen, and make for example, choosing the longest node of existence time in cluster For new control node, or the selection of new control node is realized using some other given algorithm, herein without limiting.
As a result, just so that control node has disaster tolerance performance in cluster, no longer there is cluster in the generation of control node failure The case where can not operate normally ensure that the reliability and robustness of cluster.
In conjunction with concrete application scene, description increases respective nodes in the method that the realization cluster is set up in node and cluster newly Realization.As previously described, the method which sets up can be applied to the server cluster portion under any network application Administration.
Figure 10 is according to the cluster interior nodes topology schematic diagram shown in an exemplary embodiment.As shown in Figure 10, in cluster Deploy node 1 ..., node N ..., nodes X.
Wherein, in addition to node, other nodes are ordinary node to nodes X in order to control.Increasing node newly, this is to be different from these Node, the node except cluster.
Figure 11 is according to the application schematic diagram for realizing that newly-increased node is added in the cluster shown in Figure 10 corresponding embodiments.It is needing It sets up in the application scenarios of cluster, scheme that can be through the invention flexibly quickly sets up cluster automatically.
Specifically, as shown in figure 11, step 610 will be executed to the process of step 640 by increasing node newly, pass through cluster interior nodes Response and initiate in cluster increase newly node be added operation execution.
Cluster interior nodes, if control node, then follow the steps 680 to step 690 realization process, if simultaneously non-controlling section Point, then need execute step 670 be forwarded to after control node, can execute control node by realization process.
The automatic establishment of cluster is just completed as a result, and can adapt to, in existing various situations, have very high Adaptivity.
Following is apparatus of the present invention embodiment, can be used for executing the method that the above-mentioned realization cluster of the present invention is set up and implements Example.For undisclosed details in apparatus of the present invention embodiment, please refers to the present invention and realize the embodiment of the method that cluster is set up.
Figure 12 is a kind of block diagram of device for realizing cluster establishment shown according to an exemplary embodiment.Cluster internal is affixed one's name to Node, the device which sets up are applied to the newly-increased node of cluster, and as shown in figure 12, which may include but unlimited In:Group broadcasting module 710, response obtain module 730, module 750 is added in request and nodal information obtains module 770.
Group broadcasting module 710 obtains request for initiating network address by multicast, is disposed in newly-increased node and cluster Node is in same multicast group.
Response obtains module 730, and the response for obtaining request to network address by cluster interior nodes obtains in cluster The network address of node.
Module 750 is added in request, and cluster is added for passing through network address request.
Nodal information obtains module 770, for being performed and making newly-increased node with increasing node in cluster newly operation is added Cluster interior nodes information is obtained, the cluster adition process for increasing node newly is completed.
In another exemplary embodiment, the device which sets up, further includes but is not limited to:Cluster creates mould Block.The cluster creation module for judging cluster interior nodes, within a specified time whether ask by the acquisition of response to network address, if It is no, then creates cluster, and control node of the node as cluster is increased newly where making, if YES, then responds and obtain module 730 It is triggered.
Figure 13 is the block diagram being described according to the details for request being added module 750 shown in Figure 12 corresponding embodiments. The network address of acquisition is multiple, and as shown in figure 13, which is added module 750, can include but is not limited to:It selects at random address It takes unit 751, connection creating unit 753 and request initiating cell 755 is added.
Address randomly selects unit 751, the network address for randomly selecting cluster interior nodes.
Creating unit 753 is connected, for creating itself between cluster interior nodes according to the network address randomly selected Connection.
Request initiating cell 755 is added, initiates that cluster request is added for the connection by creating.
Corresponding, as the generation of colonization process is added in newly-increased node, cluster interior nodes will also ring this It answers, i.e., with respect to a kind of device realized cluster and set up is realized, is applied in the node disposed in cluster.
Figure 14 is according to a kind of realization cluster being applied in cluster by deployment node shown in an exemplary embodiment The block diagram of the device of establishment.The device that the realization cluster is set up can include but is not limited to as shown in figure 14:Multicast reception mould Block 810, ask respond module 830 and operation executing module 850.
Multicast reception module 810, the network address for receiving multicast obtain request, and multicast network address obtains request Node is the newly-increased node of cluster.
Ask respond module 830 obtains request for response to network address and returns to itself network address.
Operation executing module 850, for as newly-increased node is according to network address request addition cluster, executing and increasing node newly Operation is added.
Figure 15 is the block diagram being described according to the details to operation executing module shown in Figure 14 corresponding embodiments.The behaviour Make execution module 850, as shown in figure 15, can include but is not limited to:Connection is created unit 851, request reception unit is added 853, control node judging unit 854, adition process execution unit 855 and request retransmission unit 856.
Connection is created unit 851, for being linked with newly-increased node by increasing the connection that node carries out newly and creating, Connection in newly-increased node, which creates, to be executed according to the network address randomly selected.
Request reception unit 853 is added, the reception that cluster request is added is initiated for carrying out newly-increased node by connection.
Control node judging unit 854, for receive be added cluster request node judge itself whether be cluster control Node processed then triggers adition process execution unit 855 if YES, if NO, then trigger request retransmission unit 856.
Adition process execution unit 855 is used for all nodes into newly-increased node and cluster and executes newly-increased node addition behaviour Make, newly-increased node is made to obtain cluster interior nodes information, all nodes obtain newly-increased nodal information in cluster, complete the newly-increased node of institute Cluster adition process.
Retransmission unit 856 is asked, if the node itself for receiving the addition cluster request is not the control of cluster Node will then be added cluster and ask the control node for being forwarded to cluster.
In another exemplary embodiment, it realizes the device that cluster is set up, further includes but be not limited to:Control node is chosen Module.After the control node chooses module for control nodes break down in cluster, in cluster all nodes be triggered into The selection of the new control node of row.
Optionally, the present invention also provides a kind of node, execute Fig. 3, Fig. 4, Fig. 5, Fig. 6 and Fig. 7 it is any shown in realize collection The all or part of step for the method that group builds, cluster internal affix one's name to node, and the method which sets up is applied to cluster Newly-increased node.Described device includes:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as executing:
The newly-increased node initiates network address by multicast and obtains request, the newly-increased node and portion of institute in the cluster The node of administration is in same multicast group;
The response of request is obtained to the network address by cluster interior nodes, with obtaining the network of the cluster interior nodes Location;
The cluster is added by the network address request;
It is performed with increasing node in cluster newly operation being added and the newly-increased node is made to obtain cluster interior nodes information, it is complete At the cluster adition process of the newly-increased node.
The processor of device in the embodiment executes the concrete mode of operation in the establishment of the related realization cluster Detailed description is performed in the embodiment of method, and explanation will be not set forth in detail herein.
Optionally, the present invention also provides a kind of node, execute Fig. 8 and Fig. 9 it is any shown in realize the method that cluster is set up All or part of step, cluster internal affixes one's name to node, and this method is applied to the node disposed in cluster.Described device packet It includes:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as executing:
The network address acquisition that the node receives multicast is asked, and the node that network address obtains request described in multicast is institute State the newly-increased node of cluster;
The network address is responded to obtain request and return to itself network address;
As the cluster is added according to the network address request in the newly-increased node, executes and increase node addition behaviour newly Make.
The processor of device in the embodiment executes the concrete mode of operation in the establishment of the related realization cluster Detailed description is performed in the embodiment of method, and explanation will be not set forth in detail herein.
It should be understood that the invention is not limited in the precision architectures for being described above and being shown in the accompanying drawings, and And various modifications and change can be being executed without departing from the scope.The scope of the present invention is limited only by the attached claims.

Claims (14)

1. a kind of method realized cluster and set up, which is characterized in that the cluster internal affixes one's name to node, and the method is applied to described The newly-increased node of cluster, the method includes:
The newly-increased node initiates network address by multicast and obtains request, is disposed in the newly-increased node and the cluster Node is in same multicast group;
The response for obtaining request to the network address by cluster interior nodes, obtains the network address of the cluster interior nodes;
The cluster is added to cluster interior nodes request by the network address;
It is performed with increasing node in cluster newly operation being added and so that control node is received and cluster request, institute is added It states newly-increased node and obtains the cluster interior nodes information that the control node issues, the cluster for completing the newly-increased node was added Journey.
2. according to the method described in claim 1, it is characterized in that, the method further includes:
Judge whether the cluster interior nodes within a specified time respond the network address and obtain request, if NO, then institute It states newly-increased node and creates cluster, and as the control node of the cluster, if YES, then pass through cluster interior nodes described in execution The step of is obtained by the response asked, obtains the network address of the cluster interior nodes for the network address.
3. according to the method described in claim 1, it is characterized in that, obtain the network address be it is multiple, it is described to pass through institute Network address is stated to ask that cluster is added to the cluster interior nodes, including:
Randomly select the network address of cluster interior nodes;
Itself connection between cluster interior nodes is created according to the network address randomly selected;
It initiates that cluster request is added by the connection of establishment.
4. a kind of method realized cluster and set up, which is characterized in that the cluster internal affixes one's name to node, and the method is applied to described The node disposed in cluster, the method includes:
The network address acquisition that the node receives multicast is asked, and the node that network address obtains request described in multicast is the collection The newly-increased node of group;
The network address is responded to obtain request and return to itself network address;
As the cluster is added to cluster interior nodes request according to the network address in the newly-increased node, execute newly-increased Operation is added in node, and control node in the cluster is made to receive addition cluster request.
5. according to the method described in claim 4, it is characterized in that, described as the newly-increased node is according to the network address The cluster is added to cluster interior nodes request, executes and increases node addition operation newly, control node in the cluster is made to connect It receives and cluster request is added, including:
The node is linked by increasing the connection that node carries out newly and creating with the newly-increased node, in the newly-increased node Connection to create executed according to the network address that randomly selects;
The newly-increased node, which is carried out, by the connection initiates the reception that addition cluster is asked to the node;
Receive it is described addition cluster request the node judge itself whether be the cluster control node, if YES, Then
Into the newly-increased node and cluster, all nodes, which execute, increases node addition operation newly, and newly-increased node is made to obtain cluster internal segment Point information, all nodes, which obtain, in cluster increases nodal informations newly, complete newly-increased node cluster adition process.
6. according to the method described in claim 5, it is characterized in that, described as the newly-increased node is according to the network address The cluster is added to cluster interior nodes request, executes and increases node addition operation newly, control node in the cluster is made to connect It receives and cluster request is added, further include:
If the control node that the node itself that cluster request is added is not the cluster is received, by the addition Cluster asks the control node for being forwarded to the cluster.
7. according to the method described in claim 5, it is characterized in that, described as the newly-increased node is according to the network address The cluster is added to cluster interior nodes request, executes and increases node addition operation newly, control node in the cluster is made to connect It receives and is added after cluster request, the method further includes:
In the cluster after control nodes break down, all nodes, which are triggered, in the cluster carries out the choosing of new control node It takes.
8. a kind of device realized cluster and set up, which is characterized in that the cluster internal affixes one's name to node, and described device is applied to cluster Newly-increased node, described device includes:
Group broadcasting module obtains request for initiating network address by multicast, is disposed in the newly-increased node and the cluster Node be in same multicast group;
Response obtains module, and the response for obtaining request to the network address by cluster interior nodes obtains the cluster The network address of interior nodes;
Module is added in request, for the cluster to be added to cluster interior nodes request by the network address;
Nodal information obtain module, for in cluster increase newly node be added operation be performed and make in the cluster control save Point, which receives, is added cluster request, and the newly-increased node obtains the cluster interior nodes information that the control node issues, described in completion The cluster adition process of newly-increased node.
9. device according to claim 8, which is characterized in that described device further includes:
Cluster creation module is asked for judging whether the cluster interior nodes within a specified time respond the network address acquisition It asks, if NO, then creates cluster, and control node of the node as the cluster is increased newly where making, it is if YES, then described Response obtains module and is triggered.
10. device according to claim 8, which is characterized in that the network address of acquisition is multiple, and the request adds Entering module includes:
Address randomly selects unit, the network address for randomly selecting cluster interior nodes;
Creating unit is connected, for creating itself company between cluster interior nodes according to the network address randomly selected It connects;
Request initiating cell is added, initiates that cluster request is added for the connection by creating.
11. a kind of device realized cluster and set up, which is characterized in that the cluster internal affixes one's name to node, and described device is applied to institute The node disposed in cluster is stated, described device includes:
Multicast reception module, the network address for receiving multicast obtain request, and network address obtains the section asked described in multicast Point is the newly-increased node of the cluster;
Ask respond module returns to itself network address for responding the network address acquisition request;
Operation executing module is used to ask to be added to the cluster interior nodes according to the network address with the newly-increased node The cluster executes and increases node addition operation newly, makes control node reception in the cluster that cluster request be added.
12. according to the devices described in claim 11, which is characterized in that the operation executing module includes:
Connection is created unit, for being linked with the newly-increased node by increasing the connection that node carries out newly and creating, institute Stating the connection in newly-increased node and creating is executed according to the network address randomly selected;
Request reception unit is added, addition cluster is initiated to the node for carrying out the newly-increased node by the connection The reception of request;
Control node judging unit, the node for receiving the addition cluster request judge whether itself is the cluster Control node then trigger adition process execution unit if YES;
The adition process execution unit is used for all nodes into the newly-increased node and cluster and executes newly-increased node addition behaviour Make, newly-increased node is made to obtain cluster interior nodes information, all nodes obtain newly-increased nodal information in cluster, complete the newly-increased node of institute Cluster adition process.
13. device according to claim 12, which is characterized in that described device further includes:
Retransmission unit is asked, if the node itself for receiving the addition cluster request is not the control of the cluster The addition cluster request is then forwarded to the control node of the cluster by node.
14. device according to claim 12, which is characterized in that described device includes:
Control node chooses module, after control nodes break down in the cluster, all node quilts in the cluster Triggering carries out the selection of new control node.
CN201710335688.2A 2017-05-11 2017-05-11 Realize the method and apparatus that cluster is set up Active CN107087032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710335688.2A CN107087032B (en) 2017-05-11 2017-05-11 Realize the method and apparatus that cluster is set up

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710335688.2A CN107087032B (en) 2017-05-11 2017-05-11 Realize the method and apparatus that cluster is set up

Publications (2)

Publication Number Publication Date
CN107087032A CN107087032A (en) 2017-08-22
CN107087032B true CN107087032B (en) 2018-09-11

Family

ID=59607376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710335688.2A Active CN107087032B (en) 2017-05-11 2017-05-11 Realize the method and apparatus that cluster is set up

Country Status (1)

Country Link
CN (1) CN107087032B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833169A (en) * 2018-06-21 2018-11-16 郑州云海信息技术有限公司 A kind of online management method of node and node
CN109194513A (en) * 2018-09-10 2019-01-11 四川长虹电器股份有限公司 A kind of method of API gateway Intellisense cluster
CN110234154B (en) * 2019-06-17 2021-11-30 广东工业大学 Outdoor team communication system supporting ad hoc network
CN111478953B (en) * 2020-03-27 2022-09-06 北京金山云网络技术有限公司 Self-construction method, device, system, equipment and storage medium of server cluster
CN113660339B (en) * 2021-08-18 2023-08-04 北京百度网讯科技有限公司 Method and apparatus for decentralizing clusters

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468070A (en) * 2013-09-17 2015-03-25 鸿富锦精密工业(深圳)有限公司 Network cluster establishment system and network cluster establishment method
CN104506330A (en) * 2014-11-28 2015-04-08 北京奇艺世纪科技有限公司 Message synchronizing method and system
CN105450686A (en) * 2014-08-19 2016-03-30 Tcl集团股份有限公司 Method and device for establishing server cluster
CN105897827A (en) * 2015-11-27 2016-08-24 乐视云计算有限公司 Server node, local area network server cluster and realizing method thereof
CN106227490A (en) * 2016-07-29 2016-12-14 中兴通讯股份有限公司 The method that cloud desktop system, cloud terminal and application add multicast group

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468070A (en) * 2013-09-17 2015-03-25 鸿富锦精密工业(深圳)有限公司 Network cluster establishment system and network cluster establishment method
CN105450686A (en) * 2014-08-19 2016-03-30 Tcl集团股份有限公司 Method and device for establishing server cluster
CN104506330A (en) * 2014-11-28 2015-04-08 北京奇艺世纪科技有限公司 Message synchronizing method and system
CN105897827A (en) * 2015-11-27 2016-08-24 乐视云计算有限公司 Server node, local area network server cluster and realizing method thereof
CN106227490A (en) * 2016-07-29 2016-12-14 中兴通讯股份有限公司 The method that cloud desktop system, cloud terminal and application add multicast group

Also Published As

Publication number Publication date
CN107087032A (en) 2017-08-22

Similar Documents

Publication Publication Date Title
CN107087032B (en) Realize the method and apparatus that cluster is set up
CN102395144B (en) Wireless access point upgrade method, system thereof and device thereof
CN105392181B (en) A kind of networking method of smart machine, apparatus and system
WO2020107691A1 (en) Bluetooth connection method and device
CN107682857B (en) Data sharing method of Zigbee network, gateway equipment and Zigbee network system
CN111200622B (en) Resource transmission method and device and storage medium
CN104184756A (en) Data synchronization method, device and system
CN104503801B (en) Software upgrade instruction distribution method, the communication server and terminal device
EP3213441B1 (en) Redundancy for port extender chains
CN104980355A (en) Source controllable multicast data transmission method and system thereof under SDN Environment
CN101483571B (en) RRPP configuring method, system and device
CN106254242A (en) A kind of data transmission method, Centralized Controller, forwarding face equipment and local terminal communicator
CN105471613A (en) Temporary channel establishing method, device and system
CN107360012B (en) Link state processing method and network node equipment
CN105827570A (en) Method, device and system for time synchronization of aggregation network precision time protocol (PTP)
CN104767664A (en) Ring communication network slave node increasing and decreasing method, device and system
CN104079663A (en) Distributed type real-time synchronizing network system and data annunciating method thereof
US20200213878A1 (en) Method and apparatus for controlling network sensors
US20140143589A1 (en) Method for managing path of osek networks
US20160080161A1 (en) Device and method for managing multicast group in wireless network
CN103503358B (en) The method of a kind of group resource interaction message and device thereof
CN111385324A (en) Data communication method, device, equipment and storage medium
CN105634765A (en) Controller replacement method and controller replacement device
CN101163106B (en) Method of executing combined service in wireless self-organizing network
CN108512671A (en) A kind of outer layer multicast ip address distribution method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant