Summary of the invention
Technical assignment of the present invention is to solve the deficiencies in the prior art, and the dynamic management approach of multi-level configuration file in a kind of cluster management system is provided.
Technical scheme of the present invention realizes in the following manner, the dynamic management approach of multi-level configuration file in this kind of cluster management system, and its concrete dynamic management process is:
The dynamic management module of multi-level configuration file is set: initialization module, dynamic management module and fault-tolerant module, three, by reading cluster configuration file, for configuration change communicates negotiation, has cooperated generation and the change of configuration.
Cluster starts, and initialization module reading configuration file information also builds multi-level cluster tree, directly completes cluster configuration file dynamic management configuration.
Cluster is in service, and dynamic management module is for carrying out dynamic management to cluster tree: according to user, need to on-the-fly modify information traverse tree, from smallest particles degree, configuration file be modified, and be synchronized to other nodes in cluster.
Node breaks down while recovering again; fault-tolerant module is used for file-level disaster tolerance: node breaks down while recovering again; recovery nodes sends message to operation node and obtains up-to-date configuration file; the consistency that guarantees each node profile information of cluster, the configuration file completing on-the-fly modifying carries out fault-tolerance protection.
Described initialization module is by cluster, group, resource in high availability cluster management system and monitor that resource node is expressed as " at many levels " tree, and this tree is the logic diagram structure based on GOM model construction.
Multilevel tree-model is divided into some levels by one tree, and the subtree degree of depth of every one deck is not more than 2, and in tree, node has two types, and a kind of is expanding node, the resource in corresponding cluster and monitor resource; Another kind is expanding node not, the cluster in corresponding cluster and group.
Above-mentioned each node all contains one group of operate original language and attribute configuration: operate original language has been explained the dynamic change operation for node or subtree, and these operations comprise increases Add, delete Delete, the Upgrade that upgrades, the Degrade that demotes, replace Replace and copy Clone; Attribute configuration has been described cluster, group, resource and has been monitored the attribute of resource node, with current cluster configuration file information corresponding one by one, describe simultaneously this node whether can with the health value of other node communications.
The beneficial effect that the present invention compared with prior art produced is:
In a kind of cluster management system of the present invention, the dynamic management approach of multi-level configuration file can be realized the dynamic management to cluster configuration file, and by this method, the group in cluster configuration file and resource node are divided by level, can revise a plurality of resources and Resource Properties in less granularity simultaneously, strengthen the dynamic and intelligent management of cluster, changed traditional modification with cluster Huo Zuwei unit.Cluster is built with multi-level tree structure, reduced the internodal degree of coupling, thereby realize multinode multitask, operate simultaneously, improve the performance of system.Practical, be easy to promote.
Embodiment
Below in conjunction with accompanying drawing, the dynamic management approach of multi-level configuration file in a kind of cluster management system of the present invention is described in detail below.
The invention provides the dynamic management approach of multi-level configuration file in a kind of cluster management system, can realize the dynamic management to cluster configuration file, and by this method, the group in cluster configuration file and resource node are divided by level, can revise a plurality of resources and Resource Properties in less granularity simultaneously, strengthen the dynamic and intelligent management of cluster.Its concrete dynamic management process is:
1, the dynamic management module of multi-level configuration file is set: initialization module, dynamic management module and fault-tolerant module, three, by reading cluster configuration file, for configuration change communicates negotiation, has cooperated generation and the change of configuration.
2, cluster starts, and initialization module reading configuration file information also builds multi-level cluster tree, directly completes cluster configuration file dynamic management configuration.
In technique scheme, between node, adopt the intercommunication primitive based on graph structure to carry out communication, avoid direct code call, thereby realize the loose coupling of system.
Internodal Content of communciation adopts JSON form, adopts JSON form can simplify the parsing of node storing information and to returning results the difficulty of parsing; Adopt fixing JSON form simultaneously, can realize details to external shield, strengthen the fail safe of system and reduce the difficulty that task trigger end is realized.
Configuration function based on graph structure makes user can select to use configuration file to carry out dynamic-configuration can prearranged dynamic-configuration or directly carry out in program, has increased system flexibility.
3, cluster is in service, and dynamic management module is for carrying out dynamic management to cluster tree: according to user, need to on-the-fly modify information traverse tree, from smallest particles degree, configuration file be modified, and be synchronized to other nodes in cluster.
In this technical scheme, without interrupting service running time, on-the-fly modify group and resource information; With smallest particles degree, revise, reduced mutual with other nodes, improve systematic function; Support the multiple operation that on-the-fly modifies, the flexibility that has improved system.
4, node breaks down while recovering again; fault-tolerant module is used for file-level disaster tolerance: node breaks down while recovering again; recovery nodes sends message to operation node and obtains up-to-date configuration file; the consistency that guarantees each node profile information of cluster, the configuration file completing on-the-fly modifying carries out fault-tolerance protection.
Further, above-mentioned steps by reference to the accompanying drawings 1~3 further describe into:
Initialization module, for when cluster starts, reads configuration file and builds multi-level cluster tree, directly completes cluster configuration file dynamic management configuration.
Initialization module is by cluster in high availability cluster management system, group, resource and monitor that resource node is expressed as the tree of " at many levels ", and this tree is based on GOM(Graph Oriented Model) the logic diagram structure of model construction.This logic diagram structure not only makes user can utilize the various intercommunication primitives on figure to carry out the communication of adjacent layer, and provides a framework clearly for dynamic-configuration.
Multilevel tree-model is divided into many levels by one tree, and the subtree degree of depth of every one deck is not more than 2, defines so a stalk tree and only needs to determine its root node and child nodes.In tree, node has two types, and a kind of is expanding node, and another kind is expanding node not, and the node of expansion itself is not again one tree.As Fig. 1, cluster is set to Tree1 and be divided into multi-level tree Tree2, wherein the resource in the corresponding cluster of expanding node and monitor resource, not cluster and the group in the corresponding cluster of expanding node.
Each node contains one group of operate original language and attribute configuration.
Operate original language has been explained the dynamic change operation for node or subtree, and these operations comprise: increase Add, delete Delete, the Upgrade that upgrades, the Degrade that demotes, replace Replace and copy Clone.These configuration functions based on graph structure make user can select to use configuration file to carry out dynamic-configuration can prearranged dynamic-configuration or directly carry out in program, thereby has increased system flexibility.Because likely, in some situation, node condition of dynamic-configuration in running is constant, without describing in configuration file in order to changing in the future.In addition, allow in node, to use the configuration function of system to adding indefinitely new node also highly significant.New node, after completing necessary initial work, will oneself be articulated under certain node of tree structure by AddNode function, without other work embedded system seamlessly just.Adding of new node will not affect the running of its father node, as long as father node adopts the intercommunication primitive based on graph structure completely.
Each node only can be communicated by letter with its father node, child nodes and the brotgher of node, and can not get over layer communication, and the object of doing is like this that strengthening system is controlled, and when there is dynamic-configuration, affects as few as possible the normal operation of other parts of system.
Attribute configuration has been described on the one hand cluster, group, resource and has been monitored the attribute of resource node, and these attributes are corresponding one by one with current cluster configuration file information.The communicable state of this node has been described on the other hand, this node whether can with the health value of other node communications.The cluster attribute that wherein node comprises, as shown in table 1.
Dynamic management module is for carrying out dynamic management to cluster tree, and the operate original language of dynamic management process and node is closely related, is the operation to tree, does not describe in detail herein.
Fault-tolerant module is for file-level disaster tolerance.For example, in dual computer group, after breaking down in opposite end, cluster configuration file on-the-fly modifies, and has recovered again opposite end afterwards, but on it operation be the configuration file before breaking down, cause two ends inconsistent.Fault-tolerant module can make reset terminal send message recovery to the node of normal operation, obtains up-to-date profile information.
Requiring each module is exclusive mode to the modification of configuration file, to safeguard the consistency of cluster configuration file.
In a typical environment, user configures cluster, synchronization profile and start cluster after, first by initialization module, according to cluster configuration file information architecture, set at many levels, the root node storage cluster information of tree, all non-child node stores group information below root node, the dependence between group and group is with layering, and the group node on upper strata depends on its child's group node.All child node stores resources or supervision resource information in multi-level tree, father's node of all child nodes must be a group node.Following table has shown the cluster configuration file information of dissimilar node storage.
Nodename |
Node attribute information |
Cluster |
Heartbeat, Master Server Info, heartbeat timeout information, alerting service etc. are resolved, used in cluster name, cluster IP, subnet mask, network partition |
Group |
Group name claims, starts server, failover number of times, mutual exclusion group, group dependence |
Resource |
Resource type, resource name, startup (stopping) time-out time, the failed number of retries of startup (stopping), startup (stopping) failure be action, resource particular attribute finally |
Monitor resource |
Monitor resource type, the stand-by period, the target resource that monitor resource name, interval, time-out time, number of retries, start supervision |
As shown in Figure 1, cluster configuration file is built into cluster tree Tree1, by level, is divided into multi-level tree Tree2, the not expanding node of every one deck is all group resource, and the hierarchical relationship between group and group represents the dependence between group.Group node must be a subtree, and its child nodes is dependence group or is that group resource or group monitor resource.Every one deck be must being resource or monitoring resource node of expanding node and child nodes.
In service at cluster, if user wants to revise cluster configuration file, do not need first to stop cluster and modify again.Only need to revise cluster configuration file, click " application " button, the information that group system is revised user passes to cluster root node, read modification information, dynamic management module agency and the dynamic management module of every one deck of root node are acted on behalf of mutual communication negotiation, decision is at which layer to modify, and carries out operation accordingly.As Fig. 3 has shown dynamic appending group resource fipAdd, traverse tree finds group failover1 node, by Addnode function, increases fipAdd resource and resource information, and it is synchronous on each node of cluster to organize resource information.
The foregoing is only embodiments of the invention, within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.