The content of the invention
The technical assignment of the present invention is that there is provided multi-level configuration in a kind of cluster management system for solution the deficiencies in the prior art
The dynamic management approach of file.
The technical scheme is that realize in the following manner, multi-level configuration file in a kind of cluster management system
Dynamic management approach, its specific 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
Person, by reading cluster configuration file, is that configuration change carries out communication negotiation, cooperation completes the generation and change of configuration.
Cluster starts, and initialization module reading configuration file information simultaneously builds multi-level cluster tree, is done directly collection flock mating
Put the dynamic management configuration of file.
In cluster operation, dynamic management module is used to enter cluster tree Mobile state management:Dynamic modification is needed according to user
Information traversal tree, modifies, and be synchronized to the node of other in cluster from smallest particles degree to configuration file.
When node failure recovers again, fault-tolerant module is used for file-level disaster tolerance:When node failure recovers again, recover
Node sends message to operation node and obtains newest configuration file, it is ensured that the uniformity of each node profile information of cluster,
Complete to carry out fault-tolerance protection to the configuration file of dynamic modification.
Cluster, group, resource and monitoring resource node in high-availability cluster management system are expressed as by the initialization module
" multi-level " tree, the tree is the logic graph structure based on GOM model constructions.
One tree is divided into some levels by Multilevel tree-model, and each layer of subtree depth is not more than 2, and tree interior joint has two
Type, one kind is expanding node, resource and monitoring resource in correspondence cluster;Another is non-expanding node, correspondence collection
Cluster and group in group.
Above-mentioned each node contains one group of operation primitive and attribute configuration:Operation primitive is described for node or subtree
Dynamic change operation, these operation include increase Add, delete Delete, upgrading Upgrade, degradation Degrade, replacement
Replace and duplication Clone;Attribute configuration describes cluster, group, resource and the attribute for monitoring resource node, with current cluster
Profile information correspond, while describe the node whether the health value that can be communicated with other nodes.
Produced beneficial effect is the present invention compared with prior art:
The dynamic management approach of multi-level configuration file can be realized to cluster in a kind of cluster management system of the present invention
The dynamic management of configuration file, and the group and resource node in cluster configuration file are pressed by distinguishing hierarchy by this method, can
To change multiple resources and Resource Properties simultaneously in less granularity, the dynamic and intelligent management of enhancing cluster changes tradition
The modification in units of cluster or group.Cluster is built with multi-level tree construction, the degree of coupling between node is reduced, so that real
Existing multinode multitask is operated simultaneously, improves the performance of system.It is practical, it is easy to promote.
Embodiment
Below in conjunction with the accompanying drawings to the dynamic management approach of multi-level configuration file in a kind of cluster management system of the present invention
It is described in detail below.
The present invention provides a kind of dynamic management approach of multi-level configuration file in cluster management system, it is possible to achieve to collection
The dynamic management of group profile, and the group and resource node in cluster configuration file are pressed by distinguishing hierarchy by this method,
Multiple resources and Resource Properties, the dynamic and intelligent management of enhancing cluster can be changed simultaneously in less granularity.It is specifically moved
State manages process:
The 1st, 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, is that configuration change carries out communication negotiation, cooperation completes the generation and change of configuration.
2nd, cluster starts, and initialization module reading configuration file information simultaneously builds multi-level cluster tree, is done directly cluster
Configuration file dynamic management configuration.
Communicated in the above-mentioned technical solutions between node using the intercommunication primitive based on graph structure, it is to avoid direct generation
Code is called, so as to realize the loose coupling of system.
Content of communciation between node uses JSON forms, using JSON forms can simplify node store information parsing and
The difficulty parsed to returning result;Simultaneously using fixed JSON forms, details, the peace of strengthening system can be realized to external shield
The difficulty that full property and reduction task triggering end is realized.
Configuration function based on graph structure allow user select using configuration file carry out dynamic configuration or
In program directly carry out can prearranged dynamic configuration, add system flexibility.
3rd, in cluster operation, dynamic management module is used to enter cluster tree Mobile state management:Dynamic is needed to repair according to user
Breath traversal tree is converted to, configuration file is modified from smallest particles degree, and be synchronized to the node of other in cluster.
In the technical scheme, without interrupting service run time, dynamic modification group and resource information;Repaiied with smallest particles degree
Change, reduce and interacted with other nodes, improve systematic function;A variety of dynamic modification operations are supported, the flexible of system is improved
Property.
4th, when node failure recovers again, fault-tolerant module is used for file-level disaster tolerance:It is extensive when node failure recovers again
Knot cluster point sends message to operation node and obtains newest configuration file, it is ensured that each node profile information of cluster it is consistent
Property, complete to carry out fault-tolerance protection to the configuration file of dynamic modification.
Further, above-mentioned steps combination accompanying drawing 1~3 is further depicted as:
Initialization module is used for when cluster starts, and reads configuration file and builds multi-level cluster tree, is done directly cluster
Configuration file dynamic management configuration.
Cluster, group, resource and monitoring resource node in high-availability cluster management system are expressed as one by initialization module
The tree of " multi-level ", this tree is to be based on GOM(Graph Oriented Model)The logic graph structure of model construction.This is patrolled
The communication of adjacent layer can not be carried out using the various intercommunication primitives on figure using only family by collecting graph structure, and be carried for dynamic configuration
A clearly framework is supplied.
One tree is divided into many levels by Multilevel tree-model, and each layer of subtree depth is not more than 2, then define one
Subtree need to only determine its root node and child nodes.Tree interior joint has a two types, and one kind is expanding node, another
It is non-expanding node, the node not extended is again in itself one tree.Such as Fig. 1, cluster tree Tree1 is divided into multi-level tree
Tree2, wherein cluster in the resource and monitoring resource in expanding node correspondence cluster, non-expanding node correspondence cluster and
Group.
Each node contains one group of operation primitive and attribute configuration.
Operation primitive describes the dynamic change operation for node or subtree, and these operations include:Increase Add, delete
Delete, upgrading Upgrade, degradation Degrade, replacement Replace and duplication Clone.These configuration letters based on graph structure
Number allows user to select to carry out dynamic configuration using configuration file or directly progress can be prearranged in a program
Dynamic configuration, thus add system flexibility.As it is possible that in some cases, node dynamic configuration in the process of running
Condition is constant, without described in configuration file in case in the future change.In addition, it is allowed in node using the configuration function of system
To indefinitely adding new node also highly significant.New node passes through AddNode after necessary initial work is completed
Function oneself will be articulated under some node of tree structure, can seamlessly embedded system without other work.New node
Addition will not influence the running of its father node, as long as father node uses the intercommunication primitive based on graph structure completely.
Each node is only capable of communicating with its father node, child nodes and the brotgher of node, and can not get over layer communication, so does
Purpose is strengthening system control, and when occurring dynamic configuration, the normal operation of system other parts is influenceed as few as possible.
On the one hand attribute configuration describes cluster, group, resource and the attribute for monitoring resource node, these attributes and current collection
Group profile information is corresponded.On the other hand the communicable state of the node is described, i.e. whether the node can be with other
The health value of node communication.The cluster attribute that its interior joint is included, as shown in table 1.
Dynamic management module is used to enter cluster tree Mobile state management, and the operation primitive of dynamic management process and node is close
Correlation, is the operation to tree, herein without being described in detail.
Fault-tolerant module is used for file-level disaster tolerance.For example, in dual computer group, after opposite end is broken down, cluster configuration file is entered
Go dynamic modification, opposite end is recovered again afterwards, but run thereon is configuration file before breaking down, causes two ends to differ
Cause.Fault-tolerant module can cause reset terminal is sent to the node normally run to recover message, obtain newest profile information.
It is required that modification of each module to configuration file is exclusive mode, to safeguard the uniformity of cluster configuration file.
In a typical environment, the complete cluster of user configuring, synchronization profile and after starting cluster, first by first
Beginningization module is set at many levels according to cluster configuration file information architecture, the root node storage cluster information of tree, below root node
All non-child nodes storage group informations, the dependence between group and group is with layering, and the group node on upper strata depends on it
Child's group node.All child nodes storage resources or monitoring resource information, the Father's Day of all child nodes in multi-level tree
Put necessarily individual group node.Following table shows the cluster configuration file information of different type node storage.
Nodename |
Node attribute information |
Cluster |
Cluster name, cluster IP, subnet mask, network partition parse, use heartbeat, Master Server Info, heartbeat timeout information, alerting service etc. |
Group |
Group name, startup server, failover number of times, mutual exclusion group, group dependence |
Resource |
Resource type, resource name, startup(Stop)Time-out time, startup(Stop)Failure number of retries, startup(Stop)The final action of failure, resource particular attribute |
Monitor resource |
Monitoring resource type, monitoring resource name, interval, time-out time, number of retries, the stand-by period for starting monitoring, target resource |
It is multi-level tree Tree2 by distinguishing hierarchy as shown in figure 1, cluster configuration file is built into cluster tree Tree1,
Each layer of non-expanding node is all a group resource, the dependence between hierarchical relationship expression group between group and group.Group node
Necessarily individual subtree, its child nodes are either dependence group or are group resource or group monitoring resource.Each layer is both extension
Node is the necessarily resource or monitoring resource node of child nodes again.
In cluster operation, if user wants modification cluster configuration file, it is not necessary to first stop cluster and modify again.
Only need to change cluster configuration file, click on " application " button, the information transmission that group system changes user gives cluster root section
Point, reads modification information, and the dynamic management module agency of root node communicates association with each layer of dynamic management module agency
Business, decision is modified in which layer, performs corresponding operation.As Fig. 3 shows dynamic addition group resource fipAdd, traversal tree
A group failover1 nodes are found, fipAdd resources and resource information are increased by Addnode functions, and group resource information is existed
It is synchronous on each node of cluster.
Embodiments of the invention are the foregoing is only, within the spirit and principles of the invention, that is made is any
Modification, equivalent substitution, improvement etc., should be included in the scope of the protection.