A kind of method of optimum management cluster state
technical field
the present invention relates to computer realm, relate in particular to high availability cluster management, a kind of specifically method of optimum management cluster state.
Background technology
In high availability cluster management, condition managing is very important, because it is trigger condition and final processing of activities, whether cluster can keep high availability, depends on to a great extent correctness and the promptness of condition managing.And in normal cluster activity, be no matter start and stop cluster or, start and stop group and resource, a lot of resources is triggered in capital, and the state of group and cluster upgrades, and the people who often contacts high availability cluster can find, now state upgrades most of bandwidth that accounted for, and even can delay normal cluster activity.When cluster has abnormal generation, the state of cluster upgrades can have influence on cluster equally for abnormal processing speed.
Therefore, how can effectively reduce cluster state renewal and just seem especially important for high availability cluster management.In addition generally all can be for mark host node in original cluster management, and set up separately a cluster IP, this is for some condition managings obstacle to some extent, also can cause certain puzzlement for user, because in major applications scene, due in Intranet environment, therefore IP is very valuable resource, if can remove the requirement of cluster IP, just saved IP resource.
Summary of the invention
The present invention uses a kind of cluster resource management method of optimization, improves cluster management efficiency, has reduced bandwidth consumption, and clear condition managing logic.The method mainly comprises the following aspects:
(1) cluster state structure
Cluster state structure is identical with existing high availability cluster condition managing logic, has a cluster state value and two status lists, is respectively group status list and resource status list.
(2) more new logic of state
For simplification state upgrades, a more new logic of reservation of resource state, cancellation group state upgrades and cluster state renewal function, and group state and cluster state setting are completely contained in resource status more in new logic.Although increased the logic of wall scroll resource status processing herein, owing to having reduced the more sum of newer command of state, so many resources have been saved in state renewal generally.
A) single resource state upgrades
When start and stop resource or single resource report are abnormal, directly trigger node and send the more newer command of this resource status, after host node is received, upgrade local resource status list, and upgrade this resource place group status list and cluster state.
B) group state upgrades
After the operation of start and stop group, XM returns to host node resource startup situation, and host node upgrades resource status list and cluster state successively according to returning.
(3) synchronous regime
Equally, in order to ensure the high availability of cluster, in cluster, all nodes must be shared each resource, the group state of cluster.Therefore host node is being handled after resource status renewal, need to be synchronized to every other node in cluster, now synchronous state also just has resource status, in cluster, each node is collected more new state of resource status, in like manner upgrade local resource state, and in internal logic renewal group state and cluster state.
(4) state obtains
Outside obtains state and connects host node access cluster state by control desk, according to concrete visiting demand, directly returns according to local cluster status list.
(5) cancel cluster IP
Cluster IP is for mark host node, but due to when all cluster resources are during in halted state, cluster IP still exists, and this has conflict with this method according to resource status mark cluster state, and often, has taken a valuable Intranet IP,
If therefore want to utilize the method for optimization cluster state management in this paper, just need to cancel the setting of cluster IP.Here be only the setting that need to cancel cluster IP, the setting of host node still exists, and knows host node and exists, and after decision-making egress, notify control desk to know between node, connects host node obtain cluster information so that outside.
Compared with prior art, the beneficial effect producing is in the present invention:
The method of an optimum management cluster state is provided, had so both saved bandwidth, ensured the communication efficiency of cluster, simplified again processing logic, reduced the probability that program is made mistakes, but also cancelled the setting of cluster IP, saved IP resource.Improve cluster management efficiency, reduced bandwidth consumption, and clear condition managing logic, the condition managing logic of optimization and provide path easily for cluster management without the management method of cluster IP.Optimize the condition managing of high availability cluster management software, improve the efficiency of management and reduce bandwidth occupancy.
Brief description of the drawings
Accompanying drawing 1 is that state of the present invention upgrades/obtain flow chart.
Embodiment
the present invention uses a kind of cluster resource management method of optimization, improves cluster management efficiency, has reduced bandwidth consumption, and clear condition managing logic.The method mainly comprises several aspects:
(1) cluster state structure
Cluster state structure is identical with existing high availability cluster condition managing logic, has a cluster state value and two status lists, is respectively group status list and resource status list.
(2) more new logic of state
For simplification state upgrades, a more new logic of reservation of resource state, cancellation group state upgrades and cluster state renewal function, and group state and cluster state setting are completely contained in resource status more in new logic.Although increased the logic of wall scroll resource status processing herein, owing to having reduced the more sum of newer command of state, so many resources have been saved in state renewal generally.
A) single resource state upgrades
When start and stop resource or single resource report are abnormal, directly trigger node and send the more newer command of this resource status, after host node is received, upgrade local resource status list, and upgrade this resource place group status list and cluster state.
B) group state upgrades
After the operation of start and stop group, XM returns to host node resource startup situation, and host node upgrades resource status list and cluster state successively according to returning.
(3) synchronous regime
Equally, in order to ensure the high availability of cluster, in cluster, all nodes must be shared each resource, the group state of cluster.Therefore host node is being handled after resource status renewal, need to be synchronized to every other node in cluster, now synchronous state also just has resource status, in cluster, each node is collected more new state of resource status, in like manner upgrade local resource state, and in internal logic renewal group state and cluster state.
(4) state obtains
Outside obtains state and connects host node access cluster state by control desk, according to concrete visiting demand, directly returns according to local cluster status list.
(5) cancel cluster IP
Cluster IP is for mark host node, but due to when all cluster resources are during in halted state, cluster IP still exists, and this has conflict with this method according to resource status mark cluster state, and often, has taken a valuable Intranet IP,
If therefore want to utilize the method for optimization cluster state management in this paper, just need to cancel the setting of cluster IP.Here be only the setting that need to cancel cluster IP, the setting of host node still exists, and knows host node and exists, and after decision-making egress, notify control desk to know between node, connects host node obtain cluster information so that outside.