CN107528724A - A kind of optimized treatment method and device of node cluster - Google Patents
A kind of optimized treatment method and device of node cluster Download PDFInfo
- Publication number
- CN107528724A CN107528724A CN201710598051.2A CN201710598051A CN107528724A CN 107528724 A CN107528724 A CN 107528724A CN 201710598051 A CN201710598051 A CN 201710598051A CN 107528724 A CN107528724 A CN 107528724A
- Authority
- CN
- China
- Prior art keywords
- node
- cluster
- nodes
- stand
- equipment
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000005457 optimization Methods 0.000 claims abstract description 34
- 238000013467 fragmentation Methods 0.000 claims description 17
- 238000006062 fragmentation reaction Methods 0.000 claims description 17
- 230000001052 transient effect Effects 0.000 claims description 7
- 238000004891 communication Methods 0.000 claims description 5
- 230000005055 memory storage Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 description 7
- 238000013500 data storage Methods 0.000 description 6
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 4
- 210000004556 brain Anatomy 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 210000004209 hair Anatomy 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention provides a kind of optimized treatment method and device of node cluster, and methods described includes:The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment nodes n;The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just allows cluster, m<2n;According to the nodes m and preset rules, corresponding node is restarted.Described device performs the above method.The optimized treatment method and device of node cluster provided in an embodiment of the present invention, on the premise of ensure that host apparatus and stand-by equipment normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
Description
Technical field
The present embodiments relate to data storage processing technical field, and in particular to a kind of optimization processing side of node cluster
Method and device.
Background technology
ElasticSearch is (referred to as " ES ") search for being based on Lucene (a kind of full-text search engine increased income)
Server, ES are mainly used to data directory and lookup, disposed by the way of cluster.One example is referred to as node, and one sets
It is standby to enable multiple nodes.N number of node can form a cluster, and automatic election produces a host node.In one cluster
An only host node, it is responsible for communication with the outside world, receives request etc..In a cluster, when there is two or more masters
Node, i.e., there occurs fissure, it is not allowed to.High availability cluster (High Available, hereinafter referred to as " HA ") and ES
It is independent concept, HA can include a host apparatus, a stand-by equipment, for data storage, when host apparatus breaks down,
Business can be switched on stand-by equipment automatically.Because host apparatus has run ES nodes, ES nodes form a cluster, so generally
Say the ES clusters under HA patterns.
Prior art generally avoids fissure using setting minimum node number n+1, such as:Host apparatus and stand-by equipment
Nodes n values are 3, above-mentioned n+1 by calculating the nodes sum of host apparatus and stand-by equipment again divided by equipment number,
1 is added to be obtained the result of calculation again, i.e. (2n/2)+1=n+1, due to this two parts node of host apparatus and stand-by equipment
The new host node do not known host node survival and elected, just result in the generation of fissure, and every equipment has 3 nodes,
Then under HA patterns, a total of 6 nodes of a cluster, if configuration 6/2+1, i.e. 4 nodes, just permission cluster, then no matter why
Sample, all without more than one host node, i.e., will not produce fissure, once but host apparatus break down, stand-by equipment is up in itself
3 nodes, be unable to reach the condition of minimum node number n+1 (4) all the time, then always can not cluster, cause host apparatus and standby
Can not normal work with equipment.
Therefore, how to solve the problems, such as that above-mentioned host apparatus and stand-by equipment can not normal works, additionally it is possible to avoid fissure
Generation, and then realize that turning into solve the problems, such as to the optimization processing of clustered node.
The content of the invention
The problem of existing for prior art, a kind of optimized treatment method of node cluster provided in an embodiment of the present invention and
Device.
In a first aspect, the embodiment of the present invention provides a kind of optimized treatment method of node cluster, methods described includes:
The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment node
Number n;
The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just to be permitted
Perhaps cluster, m<2n;
According to the nodes m and preset rules, corresponding node is restarted.
Second aspect, the embodiment of the present invention provide a kind of optimization processing device of node cluster, and described device includes:
First acquisition unit, for obtaining the node total number of local device, the node total number includes host apparatus node
Number n and stand-by equipment nodes n;
Second acquisition unit, nodes m in node cluster is added to for obtaining, the node cluster be configured as to
Reaching n node less just allows cluster, m<2n;
Unit is restarted, for according to the nodes m and preset rules, restarting corresponding node.
The third aspect, the embodiment of the present invention provide the optimization processing device of another node cluster, including:Processor, deposit
Reservoir and bus, wherein,
The processor and the memory complete mutual communication by the bus;
The memory storage has and by the programmed instruction of the computing device, the processor described program can be called to refer to
Order is able to carry out following method:
The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment node
Number n;
The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just to be permitted
Perhaps cluster, m<2n;
According to the nodes m and preset rules, corresponding node is restarted.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium storing program for executing, including:
The non-transient computer readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer
Perform following method:
The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment node
Number n;
The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just to be permitted
Perhaps cluster, m<2n;
According to the nodes m and preset rules, corresponding node is restarted.
The optimized treatment method and device of node cluster provided in an embodiment of the present invention, it ensure that host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the optimized treatment method schematic flow sheet of node cluster of the embodiment of the present invention;
Fig. 2 is the structural representation of the optimization processing device of node cluster of the embodiment of the present invention;
Fig. 3 is device entity structural representation provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is the optimized treatment method schematic flow sheet of node cluster of the embodiment of the present invention, as shown in figure 1, the present invention is real
A kind of optimized treatment method of node cluster of example offer is provided, comprised the following steps:
S1:The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment section
Count n.
Specifically, device obtains the node total number of local device, the node total number includes host apparatus nodes n and standby
With device node number n.Device can include host apparatus and stand-by equipment.Unless otherwise noted, the embodiment of the present invention is to be based on
On the premise of high availability cluster (High Available, hereinafter referred to as " HA ") is opened.ElasticSearch (referred to as " ES ")
It is a search server for being based on Lucene (a kind of full-text search engine increased income), ES is mainly used to data directory and looked into
Look for, disposed by the way of cluster.One example is referred to as node, and an equipment can enable multiple nodes.N number of node can be with
A cluster is formed, automatic election produces a host node.There was only a host node in one cluster, be responsible for communication with the outside world,
Receive request etc..In a cluster, when there is two or more host nodes, i.e., there occurs fissure, it is not allowed to.
HA and ES is independent concept, and HA can include a host apparatus, a stand-by equipment, for data storage, be set when primary
Standby to break down, business can be switched on stand-by equipment automatically.Because host apparatus has run ES nodes, ES nodes form a cluster,
So generally say the ES clusters under HA patterns.Local device can be local computer equipment, can include one and primary set
It is standby, and a stand-by equipment, host apparatus is identical with the nodes of stand-by equipment, is all n, and the node total number of local device is
2n。
S2:The nodes m being added in node cluster is obtained, the node cluster is configured as at least up to n node
Just allow cluster, m<2n.
Specifically, device obtains the nodes m being added in node cluster, the node cluster is configured as being at least up to
N node just allows cluster, m<2n.Under HA patterns, host apparatus and each n node of stand-by equipment.Then after HA unlatchings, ES collection
After group's initialization time, (initialization time is that ES starts to the cluster normal time, is given tacit consent to 10 minutes, Parameter adjustable) is preferable
In the case of nodes in cluster be 2n, but different according to the situation of reality, the nodes being added in node cluster lead to
It is not often 2n, or even does not reach n.It is illustrated below:One host apparatus and a stand-by equipment respectively have 3 (n=3) individual
Node, then under HA patterns, a cluster should have 6 nodes altogether.Prior art arrangement 6/2+1 (i.e. 4) individual node, just allow
Cluster, then once an equipment (host apparatus or stand-by equipment) breaks down, another equipment is up to 3 nodes, is unable to reach 4
Individual node, just allow the condition of cluster, cause always can not cluster, and then can not normal work.Set of node of the embodiment of the present invention
Group, which is configured as at least up to 3 (n=3) individual nodes, just allows cluster, even if realizing any device breaks down, if another
Device node number is all added to node cluster, additionally it is possible to ensures normal cluster, so as to normal work.
S3:According to the nodes m and preset rules, corresponding node is restarted.
Specifically, device restarts corresponding node according to the nodes m and preset rules.Due to the embodiment of the present invention
Node cluster is configured as at least up to 3 (n=3) individual nodes and allows for cluster, it may occur that fissure phenomenon, such as:Host apparatus
A, stand-by equipment B respectively run 3 nodes.If network is obstructed, after A equipment is got up, do not find B device, A equipment in itself 3
Individual node meets 3 nodes and allows for the condition of cluster, and has carried out cluster, generates a host node.When B device gets up
Afterwards, because network is not smooth, the cluster of A equipment is not found, 3 nodes of B device in itself also meet 3 nodes and allow for cluster
Condition, also carried out cluster, generated another host node, therefore generated fissure phenomenon.In order to avoid fissure phenomenon, root
According to nodes m difference, using different rules, different nodes is restarted, it is necessary to which explanation is:(1) local device can only weigh
Open the node of local device;(2) existing cluster adds meeting Automatic-searching after node is restarted, because being the section in local
Point, so local cluster can be found and host node be present, so as to be directly added into.It is described as follows:
(1) if n<m<2n, then restart remaining whole nodes in local device, be exemplified below (n=3):That is m=4 or m
=5 situation, by taking m=4 as an example, due to m>3, the node cluster is allowed to cluster, and remaining nodes are not over 3, no
Another cluster is there may be, in order to restart as far as possible few node, two nodes of residue restarted in local device (can be same
, can also be respectively in different equipment in one equipment).
(2) if m=n, according to the distribution of host apparatus or the remaining nodes of the stand-by equipment and the first default rule
Then, remaining whole nodes in the local device are restarted, here it is considered that the distribution situation of remaining nodes, is divided into two kinds of feelings
Condition:
(2-1) if the nodes of one of host apparatus or stand-by equipment are zero, reset node number is not zero
Host apparatus or stand-by equipment, it is exemplified below (n=3):Host apparatus A nodes are zero, then the nodes of stand-by equipment are n
(n=3), in order to restart as far as possible few node, stand-by equipment B node need to only be restarted.
(2-2) restarts the residue of host apparatus all if the nodes of host apparatus or stand-by equipment are all not zero
Remaining whole nodes of node and stand-by equipment, are exemplified below (n=3):No matter the remaining node of host apparatus is 1 or 2
Individual (the corresponding remaining node of stand-by equipment is 2 or 1);All restart remaining whole nodes of host apparatus and standby set
Standby remaining whole nodes.
(3) if m<N, according to the remaining node of host apparatus or stand-by equipment whether cluster in another node cluster
With the second preset rules, the nodes of the remaining whole nodes or node cluster in local device is restarted, here it is considered that remaining section
Whether cluster in the situation of another node cluster, is divided into two kinds of situations to point:
(3-1) restarts primary set if the node of host apparatus or stand-by equipment does not have cluster in another node cluster
Remaining whole nodes of standby remaining whole nodes and stand-by equipment, are exemplified below (n=3), total due to remaining whole nodes
Number meets the condition for adding another node cluster more than 3, but at the time of also there is no cluster in another node cluster, weight
Remaining whole nodes of the remaining whole nodes and stand-by equipment of host apparatus are opened, the node after restarting is rejoined set of node
Group (original).
(3-2) if the node of host apparatus or stand-by equipment cluster in another node cluster, reset node collection
The node of group, is exemplified below (n=3), because the sum of remaining whole nodes is more than 3, and cluster in another set of node
Group, and node cluster (original) not yet forms (nodes do not reach 3), in order to restart as far as possible few node, reset node
Cluster (original), make node in original node cluster again cluster in another node cluster.
The optimized treatment method of node cluster provided in an embodiment of the present invention, it ensure that host apparatus and stand-by equipment are normal
On the premise of work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
It is described according to the nodes m and preset rules on the basis of above-described embodiment, restart corresponding node, wrap
Include:
If n is known in judgement<m<2n, then restart remaining whole nodes in the local device.
Specifically, if device judges to know n<m<2n, then restart remaining whole nodes in the local device.It can refer to
Above-described embodiment, repeat no more.
If m=n is known in judgement, according to the distribution and first of the host apparatus or the remaining nodes of the stand-by equipment
Preset rules, restart remaining whole nodes in the local device.
Specifically, if device judges to know m=n, according to the host apparatus or the remaining nodes of the stand-by equipment
Distribution and the first preset rules, restart remaining whole nodes in the local device.Above-described embodiment is can refer to, it is no longer superfluous
State.
If m is known in judgement<N, according to the remaining node of the host apparatus or the stand-by equipment, whether cluster exists
Another node cluster and the second preset rules, restart the section of the remaining whole nodes or the node cluster in the local device
Point.
Specifically, if device judges to know m<N, according to the remaining node of the host apparatus or the stand-by equipment whether
Cluster restarts remaining whole nodes or the section in the local device in another node cluster and the second preset rules
The node of point cluster.Above-described embodiment is can refer to, is repeated no more.
The optimized treatment method of node cluster provided in an embodiment of the present invention, further ensure host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
It is described according to the remaining nodes of the host apparatus or the stand-by equipment on the basis of above-described embodiment
Distribution and the first preset rules, restart remaining whole nodes in the local device, including:
If the nodes for judging to know one of the host apparatus or the stand-by equipment are zero, reset node number
The host apparatus or stand-by equipment being not zero.
Specifically, if device judges to know that the nodes of one of the host apparatus or the stand-by equipment are zero,
The host apparatus or stand-by equipment that then reset node number is not zero.Above-described embodiment is can refer to, is repeated no more.
Or,
If judging to know that the host apparatus or the nodes of the stand-by equipment are all not zero, described primary set is restarted
Standby remaining whole nodes and remaining whole nodes of the stand-by equipment.
Specifically, if device judges to know that the host apparatus or the nodes of the stand-by equipment are all not zero, weigh
Open remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment.Above-described embodiment is can refer to, no
Repeat again.
The optimized treatment method of node cluster provided in an embodiment of the present invention, better assure that host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, it is described according to the remaining node of the host apparatus or the stand-by equipment whether
Cluster restarts remaining whole nodes or the section in the local device in another node cluster and the second preset rules
The node of point cluster, including:
If judging to know, the node of the host apparatus or the stand-by equipment does not have cluster in another node cluster, weighs
Open remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment.
Specifically, if device judges to know that the node of the host apparatus or the stand-by equipment does not have cluster in another section
Point cluster, then restart remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment.It can refer to
Embodiment is stated, is repeated no more.
Or,
If judging to know, cluster in another node cluster, weighs for the node of the host apparatus or the stand-by equipment
Open the node of the node cluster.
If specifically, device judge to know the node of the host apparatus or the stand-by equipment cluster in another section
Point cluster, then restart the node of the node cluster.Above-described embodiment is can refer to, is repeated no more.
The optimized treatment method of node cluster provided in an embodiment of the present invention, better assure that host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, methods described also includes:
Obtain the on off state of the high availability cluster of the local device.
Specifically, device obtains the on off state of the high availability cluster of the local device.High availability cluster (High
Available, hereinafter referred to as " HA ").On off state opens or closes state including high availability cluster.
If the host apparatus or the stand-by equipment are known in judgement, at least one is not turned on high availability cluster, root
According to the nodes m and n/2 and n numerical relation, and preset rules, corresponding node is restarted.
If specifically, device judge to know the host apparatus or the stand-by equipment at least one be not turned on height can
With property cluster, according to the nodes m and n/2 and n numerical relation, and preset rules, corresponding node is restarted.Similarly,
The explanation of above-mentioned m and n and 2n numerical relation is can refer to, is repeated no more.
The optimized treatment method of node cluster provided in an embodiment of the present invention, it is being not turned on or is fully opening high availability
In the case of cluster, on the premise of ensure that host apparatus and stand-by equipment normal work more fully hereinafter, additionally it is possible to avoid brain
The generation split, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, methods described also includes:
Obtain the status information of the node cluster.
Specifically, device obtains the status information of the node cluster.Status information can (can including first state information
To have loss including host apparatus data;And/or the success of host apparatus data storage, stand-by equipment data division are lost);Also
The second status information (can include host apparatus data has loss) can be included, it is necessary to which explanation is:ES clusters, due to indivedual
Node can not find host node or some bursts can be unallocated, and the state for causing node cluster is yellow even red.(section
The state of point cluster:It is divided into green, yellow, red.Can be by background query " curl localhost:9200/_
Cat/health " realizes, wherein, green represents host apparatus data and stand-by equipment data storage ok;Yellow is represented
Host apparatus data storage ok, stand-by equipment data have partial loss;Red represents that host apparatus data have loss).
According to the on off state and the status information, to can not find host node and/or unappropriated data accordingly
Burst carries out burst again.
Specifically, device is according to the on off state and the status information, to the corresponding host node and/or not of can not find
The data fragmentation of distribution carries out burst again.After HA is opened, data portion falls on host apparatus, and portion falls in stand-by equipment
On.After the HA of host apparatus and stand-by equipment is switched on, the non-green of state (first state information) of node cluster, then lead to
The method for crossing reroute (heavy-route) carries out burst again to unappropriated burst.
After the HA of host apparatus and stand-by equipment only has one to open or do not open, the state of node cluster is red
(the second status information), then burst again is carried out to unappropriated burst by reroute (heavy-route) method.(when primary
Equipment and stand-by equipment HA do not have full open, if yellow states are also normal.Because as long as HA has one not open, then
Only local n node cluster, will not cluster two-by-two).
The optimized treatment method of node cluster provided in an embodiment of the present invention, by not finding host node and/or not dividing
The data fragmentation matched somebody with somebody carries out burst again, solves the abnormal problem in the optimization process of node cluster.
It is described according to the on off state and the status information on the basis of above-described embodiment, to looking for not accordingly
Burst again is carried out to host node and/or unappropriated data fragmentation, including:
According to the on off state and the status information, by the method for heavy-route to can not find host node accordingly
And/or unappropriated data fragmentation carries out burst again.
Specifically, device is according to the on off state and the status information, by the method for heavy-route to looking for accordingly
Burst again is carried out less than host node and/or unappropriated data fragmentation.Above-described embodiment is can refer to repeat no more.
The optimized treatment method of node cluster provided in an embodiment of the present invention, by the method for heavy-route to looking for not accordingly
Burst again is carried out to host node and/or unappropriated data fragmentation, the optimization process for preferably solving node cluster
In abnormal problem.
On the basis of above-described embodiment, methods described also includes:
If judgement is informed in when restarting high availability cluster, the local heartbeat mouth IP of the high availability cluster changes
Become, then restart the node cluster.
Specifically, if device judges to be informed in when restarting high availability cluster, the local heartbeat of the high availability cluster
Mouth IP changes, then restarts the node cluster.It should be noted that:ES clusters are under HA patterns, to reduce ES cluster
Number, when a HA is closed or restarted, it is not necessary to restart ES clusters;Only when restarting HA, HA local heartbeat mouth IP is found
(the respective heartbeat mouth that host apparatus and stand-by equipment cluster are all) changes, and just restarts local ES clusters.
The optimized treatment method of node cluster provided in an embodiment of the present invention, also further optimizes restarting for node cluster
Process.
Fig. 2 is the structural representation of the optimization processing device of node cluster of the embodiment of the present invention, as shown in Fig. 2 of the invention
Embodiment provides a kind of optimization processing device of node cluster, including first acquisition unit 1, second acquisition unit 2 and restarts
Unit 3, wherein:
First acquisition unit 1 is used for the node total number for obtaining local device, and the node total number includes host apparatus node
Number n and stand-by equipment nodes n;Second acquisition unit 2 is used to obtain the nodes m being added in node cluster, the node
Cluster, which is configured as at least up to n node, just allows cluster, m<2n;Restart unit 3 to be used for according to the nodes m and preset
Rule, restart corresponding node.
Specifically, first acquisition unit 1 is used for the node total number for obtaining local device, the node total number includes primary set
Slave node number n and stand-by equipment nodes n;Second acquisition unit 2 is used to obtain the nodes m being added in node cluster, institute
Stating node cluster and being configured as at least up to n node just allows cluster, m<2n;Restart unit 3 to be used for according to the nodes m
And preset rules, restart corresponding node.
The optimization processing device of node cluster provided in an embodiment of the present invention, it ensure that host apparatus and stand-by equipment are normal
On the premise of work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
It is described to restart unit 3 and be specifically used on the basis of above-described embodiment:
If n is known in judgement<m<2n, then restart remaining whole nodes in the local device;If m=n, root are known in judgement
Distribution and the first preset rules according to the host apparatus or the remaining nodes of the stand-by equipment, restart the local device
In remaining whole nodes;If m is known in judgement<N, according to the remaining node of the host apparatus or the stand-by equipment whether
Through cluster in another node cluster and the second preset rules, remaining whole nodes or the node in the local device are restarted
The node of cluster.
Restart unit 3 specifically, described and be specifically used for:
If n is known in judgement<m<2n, then restart remaining whole nodes in the local device;If m=n, root are known in judgement
Distribution and the first preset rules according to the host apparatus or the remaining nodes of the stand-by equipment, restart the local device
In remaining whole nodes;If m is known in judgement<N, according to the remaining node of the host apparatus or the stand-by equipment whether
Through cluster in another node cluster and the second preset rules, remaining whole nodes or the node in the local device are restarted
The node of cluster.
The optimization processing device of node cluster provided in an embodiment of the present invention, further ensure host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, it is described restart unit 3 also particularly useful for:
If the nodes for judging to know one of the host apparatus or the stand-by equipment are zero, reset node number
The host apparatus or stand-by equipment being not zero;If or, judge to know the nodes of the host apparatus or the stand-by equipment all
It is not zero, then restarts remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment.
Specifically, it is described restart unit 3 also particularly useful for:
If the nodes for judging to know one of the host apparatus or the stand-by equipment are zero, reset node number
The host apparatus or stand-by equipment being not zero;If or, judge to know the nodes of the host apparatus or the stand-by equipment all
It is not zero, then restarts remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment.
The optimization processing device of node cluster provided in an embodiment of the present invention, better assure that host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, it is described restart unit 3 also particularly useful for:
If judging to know, the node of the host apparatus or the stand-by equipment does not have cluster in another node cluster, weighs
Open remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment;If or, judge to know the master
With the node of equipment or the stand-by equipment, cluster in another node cluster, then restarts the node of the node cluster.
Specifically, it is described restart unit 3 also particularly useful for:
If judging to know, the node of the host apparatus or the stand-by equipment does not have cluster in another node cluster, weighs
Open remaining whole nodes of the host apparatus and remaining whole nodes of the stand-by equipment;If or, judge to know the master
With the node of equipment or the stand-by equipment, cluster in another node cluster, then restarts the node of the node cluster.
The optimization processing device of node cluster provided in an embodiment of the present invention, better assure that host apparatus and standby set
On the premise of standby normal work, additionally it is possible to avoid the generation of fissure, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, described device is used for:
Obtain the on off state of the high availability cluster of the local device;If the host apparatus or described is known in judgement
At least one is not turned on high availability cluster to stand-by equipment, according to the nodes m and n/2 and n numerical relation, and
Preset rules, restart corresponding node.
Specifically, described device is used for:
Obtain the on off state of the high availability cluster of the local device;If the host apparatus or described is known in judgement
At least one is not turned on high availability cluster to stand-by equipment, according to the nodes m and n/2 and n numerical relation, and
Preset rules, restart corresponding node.
The optimization processing device of node cluster provided in an embodiment of the present invention, it is being not turned on or is fully opening high availability
In the case of cluster, on the premise of ensure that host apparatus and stand-by equipment normal work more fully hereinafter, additionally it is possible to avoid brain
The generation split, and then realize the optimization processing to clustered node.
On the basis of above-described embodiment, described device is additionally operable to:
Obtain the status information of the node cluster;According to the on off state and the status information, to looking for accordingly
Burst again is carried out less than host node and/or unappropriated data fragmentation.
Specifically, described device is additionally operable to:
Obtain the status information of the node cluster;According to the on off state and the status information, to looking for accordingly
Burst again is carried out less than host node and/or unappropriated data fragmentation.
The optimization processing device of node cluster provided in an embodiment of the present invention, by not finding host node and/or not dividing
The data fragmentation matched somebody with somebody carries out burst again, solves the abnormal problem in the optimization process of node cluster.
On the basis of above-described embodiment, described device is additionally operable to:
According to the on off state and the status information, by the method for heavy-route to can not find host node accordingly
And/or unappropriated data fragmentation carries out burst again.
Specifically, described device is additionally operable to:
According to the on off state and the status information, by the method for heavy-route to can not find host node accordingly
And/or unappropriated data fragmentation carries out burst again.
The optimization processing device of node cluster provided in an embodiment of the present invention, by the method for heavy-route to looking for not accordingly
Burst again is carried out to host node and/or unappropriated data fragmentation, the optimization process for preferably solving node cluster
In abnormal problem.
On the basis of above-described embodiment, described device is additionally operable to:
If judgement is informed in when restarting high availability cluster, the local heartbeat mouth IP of the high availability cluster changes
Become, then restart the node cluster.
Specifically, described device is additionally operable to:
If judgement is informed in when restarting high availability cluster, the local heartbeat mouth IP of the high availability cluster changes
Become, then restart the node cluster.
The optimization processing device of node cluster provided in an embodiment of the present invention, also further optimizes restarting for node cluster
Process.
The optimization processing device of node cluster provided in an embodiment of the present invention specifically can be used for performing above-mentioned each method reality
The handling process of example is applied, its function will not be repeated here, and be referred to the detailed description of above method embodiment.
Fig. 3 is device entity structural representation provided in an embodiment of the present invention, as shown in figure 3, described device includes:Processing
Device (processor) 301, memory (memory) 302 and bus 303;
Wherein, the processor 301, memory 302 complete mutual communication by bus 303;
The processor 301 is used to call the programmed instruction in the memory 302, to perform above-mentioned each method embodiment
The method provided, such as including:The node total number of local device is obtained, the node total number includes host apparatus nodes n
With stand-by equipment nodes n;The nodes m being added in node cluster is obtained, the node cluster is configured as at least up to n
Individual node just allows cluster, m<2n;According to the nodes m and preset rules, corresponding node is restarted.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating
Computer program on machine readable storage medium storing program for executing, the computer program include programmed instruction, when described program instruction is calculated
When machine performs, computer is able to carry out the method that above-mentioned each method embodiment is provided, such as including:Obtain the section of local device
Point sum, the node total number include host apparatus nodes n and stand-by equipment nodes n;Acquisition is added in node cluster
Nodes m, the node cluster, which is configured as at least up to n node, just allows cluster, m<2n;According to the nodes m
And preset rules, restart corresponding node.
The present embodiment provides a kind of non-transient computer readable storage medium storing program for executing, the non-transient computer readable storage medium storing program for executing
Computer instruction is stored, the computer instruction makes the computer perform the method that above-mentioned each method embodiment is provided, example
Such as include:The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment nodes
n;The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just to be allowed to collect
Group, m<2n;According to the nodes m and preset rules, corresponding node is restarted.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
Programmed instruction related hardware is completed, and foregoing program can be stored in a computer read/write memory medium, the program
Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light
Disk etc. is various can be with the medium of store program codes.
The embodiments such as device described above are only schematical, wherein the unit illustrated as separating component
It can be or may not be physically separate, can be as the part that unit is shown or may not be physics list
Member, you can with positioned at a place, or can also be distributed on multiple NEs.It can be selected according to the actual needs
In some or all of module realize the purpose of this embodiment scheme.Those of ordinary skill in the art are not paying creativeness
Work in the case of, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
Realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on such understanding, on
The part that technical scheme substantially in other words contributes to prior art is stated to embody in the form of software product, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some fingers
Make to cause a computer equipment (can be personal computer, server, or network equipment etc.) to perform each implementation
Method described in some parts of example or embodiment.
Finally it should be noted that:Various embodiments above is rather than right only illustrating the technical scheme of embodiments of the invention
It is limited;Although embodiments of the invention are described in detail with reference to foregoing embodiments, the ordinary skill of this area
Personnel should be understood:It can still modify to the technical scheme described in foregoing embodiments, or to which part
Or all technical characteristic carries out equivalent substitution;And these modifications or replacement, do not make the essence disengaging of appropriate technical solution
The scope of each embodiment technical scheme of embodiments of the invention.
Claims (18)
- A kind of 1. optimized treatment method of node cluster, it is characterised in that including:The node total number of local device is obtained, the node total number includes host apparatus nodes n and stand-by equipment nodes n;The nodes m being added in node cluster is obtained, the node cluster, which is configured as at least up to n node, just to be allowed to collect Group, m<2n;According to the nodes m and preset rules, corresponding node is restarted.
- 2. according to the method for claim 1, it is characterised in that it is described according to the nodes m and preset rules, restart phase The node answered, including:If n is known in judgement<m<2n, then restart remaining whole nodes in the local device;It is default according to the distribution of the host apparatus or the remaining nodes of the stand-by equipment and first if m=n is known in judgement Rule, restart remaining whole nodes in the local device;If m is known in judgement<N, according to the remaining node of the host apparatus or the stand-by equipment whether cluster another Node cluster and the second preset rules, restart the node of the remaining whole nodes or the node cluster in the local device.
- 3. according to the method for claim 2, it is characterised in that described according to the host apparatus or the stand-by equipment The distribution of remaining nodes and the first preset rules, restart remaining whole nodes in the local device, including:If the nodes for judging to know one of the host apparatus or the stand-by equipment are zero, reset node number is not Zero host apparatus or stand-by equipment;Or,If judgement knows that the host apparatus or the nodes of the stand-by equipment are all not zero, the host apparatus is restarted Remaining whole nodes of remaining whole nodes and the stand-by equipment.
- 4. according to the method for claim 2, it is characterised in that described according to the host apparatus or the stand-by equipment Whether cluster is whole in another node cluster and the second preset rules, the residue restarted in the local device for remaining node The node of node or the node cluster, including:If judging to know, the node of the host apparatus or the stand-by equipment does not have cluster in another node cluster, restarts institute State remaining whole nodes of host apparatus and remaining whole nodes of the stand-by equipment;Or,If judging to know the node of the host apparatus or the stand-by equipment, cluster in another node cluster, restarts institute State the node of node cluster.
- 5. according to any described methods of claim 1-4, it is characterised in that methods described also includes:Obtain the on off state of the high availability cluster of the local device;If the host apparatus or the stand-by equipment are known in judgement, at least one is not turned on high availability cluster, according to institute Nodes m and n/2 and n numerical relation, and preset rules are stated, restart corresponding node.
- 6. according to the method for claim 5, it is characterised in that methods described also includes:Obtain the status information of the node cluster;According to the on off state and the status information, to can not find host node and/or unappropriated data fragmentation accordingly Carry out burst again.
- 7. according to the method for claim 6, it is characterised in that it is described according to the on off state and the status information, Burst again is carried out to can not find host node and/or unappropriated data fragmentation accordingly, including:According to the on off state and the status information, by the method for heavy-route to it is corresponding can not find host node and/or Unappropriated data fragmentation carries out burst again.
- 8. the method according to claim 6 or 7, it is characterised in that methods described also includes:If judgement is informed in when restarting high availability cluster, the local heartbeat mouth IP of the high availability cluster changes, then Restart the node cluster.
- A kind of 9. optimization processing device of node cluster, it is characterised in that including:First acquisition unit, for obtaining the node total number of local device, the node total number include host apparatus nodes n and Stand-by equipment nodes n;Second acquisition unit, for obtaining the nodes m being added in node cluster, the node cluster is configured as being at least up to Just allow cluster, m to n node<2n;Unit is restarted, for according to the nodes m and preset rules, restarting corresponding node.
- 10. device according to claim 9, it is characterised in that described to restart unit and be specifically used for:If n is known in judgement<m<2n, then restart remaining whole nodes in the local device;It is default according to the distribution of the host apparatus or the remaining nodes of the stand-by equipment and first if m=n is known in judgement Rule, restart remaining whole nodes in the local device;If m is known in judgement<N, according to the remaining node of the host apparatus or the stand-by equipment whether cluster another Node cluster and the second preset rules, restart the node of the remaining whole nodes or the node cluster in the local device.
- 11. device according to claim 10, it is characterised in that it is described restart unit also particularly useful for:If the nodes for judging to know one of the host apparatus or the stand-by equipment are zero, reset node number is not Zero host apparatus or stand-by equipment;Or,If judgement knows that the host apparatus or the nodes of the stand-by equipment are all not zero, the host apparatus is restarted Remaining whole nodes of remaining whole nodes and the stand-by equipment.
- 12. device according to claim 10, it is characterised in that it is described restart unit also particularly useful for:If judging to know, the node of the host apparatus or the stand-by equipment does not have cluster in another node cluster, restarts institute State remaining whole nodes of host apparatus and remaining whole nodes of the stand-by equipment;Or,If judging to know the node of the host apparatus or the stand-by equipment, cluster in another node cluster, restarts institute State the node of node cluster.
- 13. according to any described devices of claim 9-12, it is characterised in that described device is used for:Obtain the on off state of the high availability cluster of the local device;If the host apparatus or the stand-by equipment are known in judgement, at least one is not turned on high availability cluster, according to institute Nodes m and n/2 and n numerical relation, and preset rules are stated, restart corresponding node.
- 14. device according to claim 13, it is characterised in that described device is additionally operable to:Obtain the status information of the node cluster;According to the on off state and the status information, to can not find host node and/or unappropriated data fragmentation accordingly Carry out burst again.
- 15. device according to claim 14, it is characterised in that described device is additionally operable to:According to the on off state and the status information, by the method for heavy-route to it is corresponding can not find host node and/or Unappropriated data fragmentation carries out burst again.
- 16. the device according to claims 14 or 15, it is characterised in that described device is additionally operable to:If judgement is informed in when restarting high availability cluster, the local heartbeat mouth IP of the high availability cluster changes, then Restart the node cluster.
- A kind of 17. optimization processing device of node cluster, it is characterised in that including:Processor, memory and bus, wherein,The processor and the memory complete mutual communication by the bus;The memory storage has can be by the programmed instruction of the computing device, and the processor calls described program instruction energy Enough perform the method as described in claim 1 to 8 is any.
- 18. a kind of non-transient computer readable storage medium storing program for executing, it is characterised in that the non-transient computer readable storage medium storing program for executing is deposited Computer instruction is stored up, the computer instruction makes the computer perform the method as described in claim 1 to 8 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710598051.2A CN107528724B (en) | 2017-07-20 | 2017-07-20 | Optimization processing method and device for node cluster |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710598051.2A CN107528724B (en) | 2017-07-20 | 2017-07-20 | Optimization processing method and device for node cluster |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107528724A true CN107528724A (en) | 2017-12-29 |
CN107528724B CN107528724B (en) | 2020-09-29 |
Family
ID=60748353
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710598051.2A Active CN107528724B (en) | 2017-07-20 | 2017-07-20 | Optimization processing method and device for node cluster |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107528724B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109669642A (en) * | 2018-12-24 | 2019-04-23 | 广东浪潮大数据研究有限公司 | Node Adding Way, system, device and the readable storage medium storing program for executing of storage system |
CN110798492A (en) * | 2018-08-02 | 2020-02-14 | 杭州海康威视数字技术股份有限公司 | Data storage method and device and data processing system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102394914A (en) * | 2011-09-22 | 2012-03-28 | 浪潮(北京)电子信息产业有限公司 | Cluster brain-split processing method and device |
CN102510343A (en) * | 2011-11-16 | 2012-06-20 | 广东新支点技术服务有限公司 | Highly available cluster system feign death solution based on both remote detection and power management |
CN103684941A (en) * | 2013-11-23 | 2014-03-26 | 广东新支点技术服务有限公司 | Arbitration server based cluster split-brain prevent method and device |
US20140325256A1 (en) * | 2013-04-25 | 2014-10-30 | Netapp, Inc. | Systems and methods for managing disaster recovery in a storage system |
CN105117300A (en) * | 2015-08-12 | 2015-12-02 | 浪潮(北京)电子信息产业有限公司 | Apparatus for realizing high availability of heartbeat |
CN106330475A (en) * | 2015-06-15 | 2017-01-11 | 中兴通讯股份有限公司 | Method and device for managing main and standby nodes in communication system and high availability cluster |
-
2017
- 2017-07-20 CN CN201710598051.2A patent/CN107528724B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102394914A (en) * | 2011-09-22 | 2012-03-28 | 浪潮(北京)电子信息产业有限公司 | Cluster brain-split processing method and device |
CN102510343A (en) * | 2011-11-16 | 2012-06-20 | 广东新支点技术服务有限公司 | Highly available cluster system feign death solution based on both remote detection and power management |
US20140325256A1 (en) * | 2013-04-25 | 2014-10-30 | Netapp, Inc. | Systems and methods for managing disaster recovery in a storage system |
CN103684941A (en) * | 2013-11-23 | 2014-03-26 | 广东新支点技术服务有限公司 | Arbitration server based cluster split-brain prevent method and device |
CN106330475A (en) * | 2015-06-15 | 2017-01-11 | 中兴通讯股份有限公司 | Method and device for managing main and standby nodes in communication system and high availability cluster |
CN105117300A (en) * | 2015-08-12 | 2015-12-02 | 浪潮(北京)电子信息产业有限公司 | Apparatus for realizing high availability of heartbeat |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110798492A (en) * | 2018-08-02 | 2020-02-14 | 杭州海康威视数字技术股份有限公司 | Data storage method and device and data processing system |
CN109669642A (en) * | 2018-12-24 | 2019-04-23 | 广东浪潮大数据研究有限公司 | Node Adding Way, system, device and the readable storage medium storing program for executing of storage system |
CN109669642B (en) * | 2018-12-24 | 2022-06-10 | 广东浪潮大数据研究有限公司 | Node joining method, system and device of storage system and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107528724B (en) | 2020-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110138837A (en) | Request processing method, device, computer equipment and storage medium | |
US8175987B2 (en) | Method and apparatus for computing a change plan using genetic programming and parse tree | |
CN105260203B (en) | A kind of Hadoop deployment and collocation method based on model | |
CN106302702A (en) | Burst storage method, the Apparatus and system of data | |
CN104461747B (en) | A kind of distributed task dispatching system | |
CN107911470A (en) | Distributed dynamic load-balancing method, computing device and computer-readable storage medium | |
CN109634932A (en) | A kind of intelligence contract storage method and storage system | |
CN106464532A (en) | Network-state management service | |
CN105471662B (en) | Cloud Server, virtual network strategy centralized control system and method | |
CN106101213A (en) | Information-distribution type storage method | |
CN104054076B (en) | Date storage method, database purchase node failure processing method and processing device | |
CN106293934A (en) | A kind of cluster system management optimization method and platform | |
CN109792393A (en) | Virtualize the software upgrading in off-line accounting system | |
CN106909568A (en) | A kind of changing method and device of data-base cluster MDL | |
CN110266679A (en) | Capacitor network partition method and device | |
CN109845192A (en) | Computer system and method for the network that dynamically internet adapter software defines | |
CN114091610A (en) | Intelligent decision method and device | |
CN107528724A (en) | A kind of optimized treatment method and device of node cluster | |
CN110417777B (en) | Optimized method and device for communication between microservices | |
CN109978547A (en) | Risk behavior control method and system, equipment and storage medium | |
CN106254452A (en) | The big data access method of medical treatment under cloud platform | |
US9826043B2 (en) | Method to protect storage systems from discontinuity due to device misconfiguration | |
CN107092528A (en) | A kind of distributed task dispatching method, apparatus and system | |
CN109683989A (en) | The automatic acquiring method and device of incidence relation between a kind of configuration item | |
CN110011971B (en) | Manual configuration method of network security policy |
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 | ||
CB02 | Change of applicant information |
Address after: 100088 Building 3 332, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing Applicant after: QAX Technology Group Inc. Address before: 100015 No. 1701-26, building 3, building 10, Jiuxianqiao Road, Beijing, Chaoyang District, 17 Applicant before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |