CN107465562A - A kind of method, apparatus, the equipment of the self-defined distribution virtual IP addresses of CTDB - Google Patents

A kind of method, apparatus, the equipment of the self-defined distribution virtual IP addresses of CTDB Download PDF

Info

Publication number
CN107465562A
CN107465562A CN201710875739.0A CN201710875739A CN107465562A CN 107465562 A CN107465562 A CN 107465562A CN 201710875739 A CN201710875739 A CN 201710875739A CN 107465562 A CN107465562 A CN 107465562A
Authority
CN
China
Prior art keywords
node
allocation strategy
virtual
address
allocation
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
Application number
CN201710875739.0A
Other languages
Chinese (zh)
Other versions
CN107465562B (en
Inventor
孙业宽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710875739.0A priority Critical patent/CN107465562B/en
Publication of CN107465562A publication Critical patent/CN107465562A/en
Application granted granted Critical
Publication of CN107465562B publication Critical patent/CN107465562B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses method, apparatus, equipment and the computer-readable recording medium of a kind of self-defined distribution virtual IP addresses of CTDB, the virtual IP address allocation strategy file of reading is loaded into internal memory by system;An allocation strategy is obtained from internal memory, whether the node that judging this allocation strategy successively includes is broken down, if in the presence of the node not broken down, the virtual IP address of this allocation strategy is assigned on the node, after the distribution of virtual IP address in all allocation strategies is completed, then end operation.User can arbitrarily set the method for salary distribution of virtual IP address according to the needs of oneself, substantially increase the flexibility of CTDB clusters.When group service goes wrong, user can be according to virtual IP address and the corresponding relation of node, quick positioning question node;When needing to be bound virtual IP address and specific business, user can also be apparent from which business and service bound on which virtual IP address, improve the ease for use of cluster.

Description

A kind of method, apparatus, the equipment of the self-defined distribution virtual IP addresses of CTDB
Technical field
The present invention relates to storage cluster technical field, method more particularly to a kind of self-defined distribution virtual IP addresses of CTDB, Device, equipment and computer-readable recording medium.
Background technology
CTDB is a set of cluster High Availabitity management software, in its start-up course, can be put down the virtual IP address in configuration file Equal is assigned on clustered node, and CTDB can perform recovery during nodes break down in the cluster, by remaining normal node weight A set of CTDB clusters are newly formed, wherein recovery process includes redistributing for virtual IP address, the virtual IP address meeting distributed on malfunctioning node Other normal nodes are floated to, other normal nodes that corresponding read-write business can also float to are a set of so as to which cluster be formed High-availability cluster.
In traditional approach, the distribution of virtual IP address is built in CTDB start-up courses and in clustered node failure process Algorithm is randomly assigned, and user can not intuitively know which node the virtual IP address that client currently connects is located on, it is necessary to pass through Perform it is a series of order carry out inquiry just can know that, when the business of client goes wrong because of a variety of causes, first really Which node determine that client currently connects is, then carries out problem investigation again.In this case have a strong impact on problem investigation and The efficiency solved the problems, such as.
Existing virtual IP address allocation algorithm does not have any relation with business simultaneously, when needs are carried out according to business actual conditions During the distribution of virtual IP address, current allocation algorithm can not meet demand.In addition, when the business in cluster and complicated service, can not Intuitively determine there is which business and service on node corresponding to an IP, it is also necessary to which must pass through a series of operation could really It is fixed, which increases the use complexity of cluster, influence service efficiency.
It can be seen that how to improve case study and solve efficiency, increase virtual IP address and the coupling of business, improve the easy of cluster It is those skilled in the art's urgent problem to be solved with property.
The content of the invention
The purpose of the embodiment of the present invention is to provide method, apparatus, equipment and the meter of a kind of self-defined distribution virtual IP addresses of CTDB Calculation machine readable storage medium storing program for executing, case study can be improved and solve efficiency, increase virtual IP address and the coupling of business, improve cluster Ease for use.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of CTDB methods of self-defined distribution virtual IP address, bag Include:
The virtual IP address allocation strategy file prestored is read, and the virtual IP address allocation strategy file is loaded into internal memory In;Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy include a virtual IP address and Its corresponding node, and all nodes arrange according to priority orders corresponding to the virtual IP address;
An allocation strategy is obtained from the internal memory, whether the node that judging the allocation strategy successively includes occurs Failure, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned on the node;Until complete The distribution of virtual IP address in all allocation strategies, then end operation.
Optionally, it is described that an allocation strategy is obtained from the internal memory, judge what the allocation strategy included successively Whether node is broken down, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned into the section Point on;Until completing the distribution of virtual IP address in all allocation strategies, then end operation includes:S21:Initialize allocation strategy Count value;
S22:An allocation strategy is obtained from the internal memory, and the allocation strategy count value is added 1;
S23:Judge whether the allocation strategy count value is less than or equal to allocation strategy total value;If so, then perform S24; If it is not, then end operation;
S24:Initialize node counts value;
S25:First node information is obtained from the allocation strategy, and the node counts value is added 1;
S26:Judge whether the node counts value is less than or equal to node total number value;If so, then perform S27;If it is not, then tie Beam operates;
S27:Judge whether the first node breaks down;If so, then perform S28;If it is not, then perform S29;
S28:According to the priority orders of the allocation strategy interior joint, will appear from failure the first node it is next Individual node is as new first node and returns to the S25;
S29:The virtual IP address of the allocation strategy is assigned on the first node, and returns to the S22.
Optionally, in addition to:
When all nodes that the allocation strategy includes break down, then alarm prompt is carried out.
The embodiment of the present invention additionally provides a kind of device of the self-defined distribution virtual IP addresses of CTDB, including reading unit and distribution Unit;
The reading unit, for reading the virtual IP address allocation strategy file prestored, and the virtual IP address is distributed Strategy file is loaded into internal memory;Include a plurality of allocation strategy, every allocation strategy in the virtual IP address allocation strategy file Include a virtual IP address and its corresponding node, and all nodes corresponding to the virtual IP address are according to priority orders Arrangement;
The allocation unit, for obtaining an allocation strategy from the internal memory, judge successively in the allocation strategy Including node whether break down, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned to On the node;Until complete the distribution of virtual IP address in all allocation strategies, then end operation.
Optionally, the allocation unit includes allocation strategy initialization subelement, allocation strategy processing subelement, distribution plan Slightly judgment sub-unit, node initializing subelement, node processing subelement, node judgment sub-unit, breakdown judge subelement, choosing Subelement and configuration subelement are taken,
The allocation strategy initializes subelement, for initializing allocation strategy count value;
The allocation strategy handles subelement, for obtaining an allocation strategy from the internal memory, and by the distribution Policy counter value adds 1;
The allocation strategy judgment sub-unit, for judging whether the allocation strategy count value is less than or equal to allocation strategy Total value;If so, then trigger the node initializing subelement;If it is not, then end operation;
The node initializing subelement, for initializing node counts value;
The node processing subelement, for obtaining allocation strategy nodal information from the allocation strategy, and by described in Node counts value adds 1;
The node judgment sub-unit, for judging whether the node counts value is less than or equal to node total number value;If so, Then trigger the breakdown judge subelement;If it is not, then end operation;
The breakdown judge subelement, for judging whether the allocation strategy node breaks down;If so, then trigger institute State selection subelement;If it is not, then trigger the configuration subelement;
The selection subelement, for the priority orders according to the allocation strategy interior joint, it will appear from the institute of failure The next node of allocation strategy node is stated as new allocation strategy node and triggers the node processing subelement;
The configuration subelement, for the virtual IP address of the allocation strategy to be assigned into the allocation strategy node, and Trigger the allocation strategy processing subelement.
Optionally, in addition to Tip element, the Tip element, for all nodes included when the allocation strategy When breaking down, then alarm prompt is carried out.
The embodiment of the present invention additionally provides a kind of self-defined distribution virtual IP devices of CTDB, including:
Memory, for storing computer program;
Processor, for perform the computer program with realize as above-mentioned CTDB it is self-defined distribution virtual IP address method Step.
The embodiment of the present invention additionally provides a kind of computer-readable recording medium, is deposited on the computer-readable recording medium Computer program is contained, is realized when the computer program is executed by processor such as the side of the self-defined distribution virtual IP addresses of above-mentioned CTDB The step of method.
The virtual IP address allocation strategy file of reading is loaded into internal memory by system it can be seen from above-mentioned technical proposal; Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy includes a virtual IP address and its correspondingly Node, and all nodes arrange according to priority orders corresponding to virtual IP address;A distribution plan is obtained from the internal memory Slightly, whether the node that judging the allocation strategy successively includes breaks down, if in the presence of the node not broken down, by institute The virtual IP address for stating allocation strategy is assigned on the node;Until the distribution of virtual IP address in all allocation strategies is completed, then End operation.Allocation strategy in the virtual IP address allocation strategy file prestored in system can be by user according to actual use Scene, or the use habit of user determine, namely user can arbitrarily set the distribution of virtual IP address according to the needs of oneself Mode, rather than the distribution as the limited algorithm progress virtual IP address built in CTDB, substantially increase the flexibility of CTDB clusters. Simultaneously when group service goes wrong, user can solve according to virtual IP address and the corresponding relation of node, fast positioning node Problem;When needing to be bound virtual IP address and specific business when group service complexity, which user can also be apparent from Which business and service have been bound on a little virtual IP addresses, has improved the ease for use of cluster.
Brief description of the drawings
In order to illustrate the embodiments of the present invention more clearly, the required accompanying drawing used in embodiment will be done simply below Introduce, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for ordinary skill people For member, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of flow chart of the method for the self-defined distribution virtual IP addresses of CTDB provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of method that virtual IP address distribution is carried out according to allocation strategy provided in an embodiment of the present invention;
Fig. 3 is a kind of structural representation of the device of the self-defined distribution virtual IP addresses of CTDB provided in an embodiment of the present invention;
Fig. 4 is a kind of hardware architecture diagram of the self-defined distribution virtual IP devices of CTDB provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Based on this Embodiment in invention, for those of ordinary skill in the art under the premise of creative work is not made, what is obtained is every other Embodiment, belong to the scope of the present invention.
In order that those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description The present invention is described in further detail.
Next, a kind of method for the self-defined distribution virtual IP addresses of CTDB that the embodiment of the present invention is provided is discussed in detail.Fig. 1 For a kind of flow chart of the method for the self-defined distribution virtual IP addresses of CTDB provided in an embodiment of the present invention, this method includes:
S101:The virtual IP address allocation strategy file prestored is read, and the virtual IP address allocation strategy file is loaded Into internal memory.
In embodiments of the present invention, user according to actual use scene, can formulate the allocation strategy of corresponding virtual IP address, All allocation strategies can be stored in system with virtual IP address allocation strategy document form.
A plurality of allocation strategy can be included in the virtual IP address allocation strategy file, every allocation strategy includes one Virtual IP address and its corresponding node, and all nodes arrange according to priority orders corresponding to the virtual IP address.
In the specific implementation, the distribution priority of each node can be made for each virtual IP address, with the thing of node Node number arrangement is managed (since 0), the virtual IP address can be first allocated to the node of highest priority;When the node of highest priority When breaking down, the virtual IP address can be assigned to the node of highest priority in remaining node.
Virtual IP address allocation strategy file can use extensible markup language (Extensible Markup Language, XML) file carries out tissue and storage, the distribution priority of each node is made for each virtual IP address, node number is with comma Separate, its concrete form is as follows:
<Virtual_ips nodecount=" 3 " vipcount=" 3 ">
<Vip ip=" 10.0.0.1 ">0,1,2</vip>
<Vip ip=" 10.0.0.2 ">1,2,0</vip>
<Vip ip=" 10.0.0.3 ">2,0,1</vip>
</virtual_ips>
Wherein, nodecount represents the node number of cluster;Vipcount represents the number of virtual IP address, and address is 10.0.0.1 node sequence corresponding to virtual IP address is " 0,1,2 ";Address is node sequence corresponding to 10.0.0.2 virtual IP address For " 1,2,0 ";Address is that node sequence corresponding to 10.0.0.3 virtual IP address is " 2,0,1 ".
S102:An allocation strategy is obtained from the internal memory, the node that judging the allocation strategy successively includes is No failure, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned on the node;Directly To the distribution for completing virtual IP address in all allocation strategies, then end operation.
CTDB softwares can carry out the distribution of virtual IP address according to the allocation strategy of acquisition.It is false by taking an allocation strategy as an example If virtual IP address is corresponding with 5 nodes in this allocation strategy, node 1 is followed successively by node 5 according to priority orders, and system can be with Fault detect first is carried out to the node 1 of highest priority, when node 1 does not break down, then the virtual IP address can be assigned to On node 1, the distribution of the virtual IP address is completed;When 1 failure of node, then the node of highest priority is chosen from remaining node 2 carry out fault detect, when node 2 does not break down, then can be assigned to the virtual IP address on node 2;When the failure of node 2 When, then from remaining node choose highest priority node 3 carry out fault detect, the like complete virtual IP address point Match somebody with somebody.
By taking an allocation strategy as an example, when the node that presence is not broken down, then by the virtual IP address of the allocation strategy point It is fitted on the node, completes the distribution of the virtual IP address;Either when the failure for completing all nodes in this allocation strategy is sentenced Have no progeny, then next allocation strategy is handled, the processing mode of next allocation strategy and the processing of this allocation strategy Mode is similar, will not be repeated here.
A plurality of allocation strategy can be included in view of virtual IP address allocation strategy file, the virtual IP address in every allocation strategy Corresponding node can have it is multiple, in the specific implementation, can be by setting the side of allocation strategy count value and node counts value Formula, complete the distribution of virtual IP address, its detailed process as shown in Fig. 2 including:
S21:Initialize allocation strategy count value.
S22:An allocation strategy is obtained from the internal memory, and the allocation strategy count value is added 1.
Allocation strategy count value can be used to indicate that the bar number for the allocation strategy that system had obtained, can during initialization So that allocation strategy count value is arranged into 0, an allocation strategy is often read from internal memory, can be with corresponding to allocation strategy count value Add 1.
It should be noted that in order to avoid repeating, group system obtains from untreated allocation strategy every time Take an allocation strategy.In the specific implementation, group system can be according to the distribution plan that virtual IP address allocation strategy file includes Order slightly is successively read.
S23:Judge whether the allocation strategy count value is less than or equal to allocation strategy total value.
Allocation strategy total value can be the total number for the allocation strategy that virtual IP address allocation strategy file includes.
When allocation strategy count value is less than or equal to allocation strategy total value, then illustrate the virtual IP address in this allocation strategy It is also unassigned, then it can perform S24;When allocation strategy count value is more than allocation strategy total value, then illustrate virtual IP address point All allocation strategies included with strategy file have been disposed, now then end operation.
S24:Initialize node counts value.
S25:First node information is obtained from the allocation strategy, and the node counts value is added 1.
Node counts value can be used to indicate that the number of the node obtained, can be by node counts during initialization Value is arranged to 0, often obtains a nodal information, can add 1 corresponding to node counts value.
S26:Judge whether the node counts value is less than or equal to node total number value.
Node total number value can be the total number for the node that an allocation strategy includes.
When node counts value is less than or equal to node total number value, then illustrate also not sentence the failure situation of the node It is disconnected, then it can perform S27;When node counts value is more than node total number value, then illustrate to the institute in this allocation strategy There is node to carry out breakdown judge, now then end operation.
S27:Judge whether the first node breaks down.
By taking an allocation strategy as an example, first node can be that all failures that do not carry out included in this allocation strategy are sentenced A node of highest priority in disconnected node.
If first node breaks down, illustrate that the node can not provide business service, now need to next node Judged, that is, perform S28;If first node does not break down, illustrate that the node can provide business service, now can be with Virtual IP address is assigned on the node, that is, performs S29;
S28:According to the priority orders of the allocation strategy interior joint, will appear from failure the first node it is next Individual node is as new first node and returns to the S25.
S29:The virtual IP address of the allocation strategy is assigned on the first node, and returns to the S22.
The configuration of virtual IP address in an allocation strategy can be completed by performing a S24 to S29 operation, by returning to S22 The configuration of all allocation strategies can be sequentially completed.
The virtual IP address allocation strategy file of reading is loaded into internal memory by system it can be seen from above-mentioned technical proposal; Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy includes a virtual IP address and its correspondingly Node, and all nodes arrange according to priority orders corresponding to virtual IP address;A distribution plan is obtained from the internal memory Slightly, whether the node that judging the allocation strategy successively includes breaks down, if in the presence of the node not broken down, by institute The virtual IP address for stating allocation strategy is assigned on the node;Until the distribution of virtual IP address in all allocation strategies is completed, then End operation.Allocation strategy in the virtual IP address allocation strategy file prestored in system can be by user according to actual use Scene, or the use habit of user determine, namely user can arbitrarily set the distribution of virtual IP address according to the needs of oneself Mode, rather than the distribution as the limited algorithm progress virtual IP address built in CTDB, substantially increase the flexibility of CTDB clusters. Simultaneously when group service goes wrong, user can solve according to virtual IP address and the corresponding relation of node, fast positioning node Problem;When needing to be bound virtual IP address and specific business when group service complexity, which user can also be apparent from Which business and service have been bound on a little virtual IP addresses, has improved the ease for use of cluster.
Node number corresponding to each virtual IP address is limited, it is possible that event all occur in all nodes corresponding to the virtual IP address The situation of barrier, now, the distribution of the virtual IP address can not be smoothly completed, for the ease of providing user in time, the distribution can be worked as When all nodes that strategy includes break down, then alarm prompt is carried out.
Fig. 3 is a kind of structural representation of the device of the self-defined distribution virtual IP addresses of CTDB provided in an embodiment of the present invention, is wrapped Include reading unit 31 and allocation unit 32;
The reading unit 31, divide for reading the virtual IP address allocation strategy file prestored, and by the virtual IP address It is loaded into strategy file in internal memory;Include a plurality of allocation strategy, every distribution plan in the virtual IP address allocation strategy file Slightly include a virtual IP address and its corresponding node, and all nodes are suitable according to priority corresponding to the virtual IP address Sequence arranges;
The allocation unit 32, for obtaining an allocation strategy from the internal memory, the allocation strategy is judged successively Whether the node included is broken down, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is distributed Onto the node;Until complete the distribution of virtual IP address in all allocation strategies, then end operation.
Optionally, the allocation unit includes allocation strategy initialization subelement, allocation strategy processing subelement, distribution plan Slightly judgment sub-unit, node initializing subelement, node processing subelement, node judgment sub-unit, breakdown judge subelement, choosing Subelement and configuration subelement are taken,
The allocation strategy initializes subelement, for initializing allocation strategy count value;
The allocation strategy handles subelement, for obtaining an allocation strategy from the internal memory, and by the distribution Policy counter value adds 1;
The allocation strategy judgment sub-unit, for judging whether the allocation strategy count value is less than or equal to allocation strategy Total value;If so, then trigger the node initializing subelement;If it is not, then end operation.
The node initializing subelement, for initializing node counts value;
The node processing subelement, for obtaining allocation strategy nodal information from the allocation strategy, and by described in Node counts value adds 1;
The node judgment sub-unit, for judging whether the node counts value is less than or equal to node total number value;If so, Then trigger the breakdown judge subelement;If it is not, then end operation;
The breakdown judge subelement, for judging whether the allocation strategy node breaks down;If so, then trigger institute State selection subelement;If it is not, then trigger the configuration subelement;
The selection subelement, for the priority orders according to the allocation strategy interior joint, it will appear from the institute of failure The next node of allocation strategy node is stated as new allocation strategy node and triggers the node processing subelement;
The configuration subelement, for the virtual IP address of the allocation strategy to be assigned into the allocation strategy node, and Trigger the allocation strategy processing subelement.
Optionally, in addition to Tip element, the Tip element, for all nodes included when the allocation strategy When breaking down, then alarm prompt is carried out.
The explanation of feature may refer to the related description of embodiment corresponding to Fig. 1 and Fig. 2 in embodiment corresponding to Fig. 3, this In no longer repeat one by one.
The virtual IP address allocation strategy file of reading is loaded into internal memory by system it can be seen from above-mentioned technical proposal; Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy includes a virtual IP address and its correspondingly Node, and all nodes arrange according to priority orders corresponding to virtual IP address;A distribution plan is obtained from the internal memory Slightly, whether the node that judging the allocation strategy successively includes breaks down, if in the presence of the node not broken down, by institute The virtual IP address for stating allocation strategy is assigned on the node;Until the distribution of virtual IP address in all allocation strategies is completed, then End operation.Allocation strategy in the virtual IP address allocation strategy file prestored in system can be by user according to actual use Scene, or the use habit of user determine, namely user can arbitrarily set the distribution of virtual IP address according to the needs of oneself Mode, rather than the distribution as the limited algorithm progress virtual IP address built in CTDB, substantially increase the flexibility of CTDB clusters. Simultaneously when group service goes wrong, user can solve according to virtual IP address and the corresponding relation of node, fast positioning node Problem;When needing to be bound virtual IP address and specific business when group service complexity, which user can also be apparent from Which business and service have been bound on a little virtual IP addresses, has improved the ease for use of cluster.
Fig. 4 is a kind of hardware configuration signal of the self-defined distribution virtual IP devices 40 of CTDB provided in an embodiment of the present invention Figure, including memory 41 and processor 42;
Memory 41, for storing computer program;
Processor 42, for perform the computer program with realize as above-mentioned CTDB it is self-defined distribution virtual IP address method The step of.
The embodiment of the present invention additionally provides a kind of computer-readable recording medium, is deposited on the computer-readable recording medium Computer program is contained, is realized when the computer program is executed by processor such as the side of the self-defined distribution virtual IP addresses of above-mentioned CTDB The step of method.
The method, apparatus of the self-defined distribution virtual IP address of CTDB for being provided above the embodiment of the present invention a kind of, equipment and Computer-readable recording medium is described in detail.Each embodiment is described by the way of progressive in specification, Mei Geshi Apply that example stresses is all the difference with other embodiment, and identical similar portion is mutually referring to i.e. between each embodiment Can.For device disclosed in embodiment, because it is corresponded to the method disclosed in Example, so the comparison of description is simple Single, related part is referring to method part illustration.It should be pointed out that for those skilled in the art, Without departing from the principles of the invention, some improvement and modification can also be carried out to the present invention, these are improved and modification also falls Enter in the protection domain of the claims in the present invention.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and The interchangeability of software, the composition and step of each example are generally described according to function in the above description.These Function is performed with hardware or software mode actually, application-specific and design constraint depending on technical scheme.Specialty Technical staff can realize described function using distinct methods to each specific application, but this realization should not Think beyond the scope of this invention.
Directly it can be held with reference to the step of method or algorithm that the embodiments described herein describes with hardware, processor Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.

Claims (8)

  1. A kind of 1. method of the self-defined distribution virtual IP addresses of CTDB, it is characterised in that including:
    The virtual IP address allocation strategy file prestored is read, and the virtual IP address allocation strategy file is loaded into internal memory; Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy includes a virtual IP address and its right The node answered, and all nodes arrange according to priority orders corresponding to the virtual IP address;
    An allocation strategy is obtained from the internal memory, whether the node that judging the allocation strategy successively includes event occurs Barrier, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned on the node;Until complete institute There is the distribution of virtual IP address in the allocation strategy, then end operation.
  2. 2. according to the method for claim 1, it is characterised in that it is described that an allocation strategy is obtained from the internal memory, according to Whether the secondary node for judging the allocation strategy and including breaks down, if in the presence of the node not broken down, will be described point Virtual IP address with strategy is assigned on the node;Until completing the distribution of virtual IP address in all allocation strategies, then terminate Operation includes:
    S21:Initialize allocation strategy count value;
    S22:An allocation strategy is obtained from the internal memory, and the allocation strategy count value is added 1;
    S23:Judge whether the allocation strategy count value is less than or equal to allocation strategy total value;If so, then perform S24;If it is not, Then end operation;
    S24:Initialize node counts value;
    S25:First node information is obtained from the allocation strategy, and the node counts value is added 1;
    S26:Judge whether the node counts value is less than or equal to node total number value;If so, then perform S27;If it is not, then terminate to grasp Make;
    S27:Judge whether the first node breaks down;If so, then perform S28;If it is not, then perform S29;
    S28:According to the priority orders of the allocation strategy interior joint, next section of the first node of failure will appear from Point is as new first node and returns to the S25;
    S29:The virtual IP address of the allocation strategy is assigned on the first node, and returns to the S22.
  3. 3. according to the method for claim 1, it is characterised in that also include:
    When all nodes that the allocation strategy includes break down, then alarm prompt is carried out.
  4. 4. a kind of device of the self-defined distribution virtual IP addresses of CTDB, it is characterised in that including reading unit and allocation unit;
    The reading unit, for reading the virtual IP address allocation strategy file that prestores, and by the virtual IP address allocation strategy File is loaded into internal memory;Include a plurality of allocation strategy in the virtual IP address allocation strategy file, every allocation strategy includes There are a virtual IP address and its corresponding node, and all nodes are arranged according to priority orders corresponding to the virtual IP address Row;
    The allocation unit, for obtaining an allocation strategy from the internal memory, judge that the allocation strategy includes successively Node whether break down, if in the presence of the node not broken down, the virtual IP address of the allocation strategy is assigned to described On node;Until complete the distribution of virtual IP address in all allocation strategies, then end operation.
  5. 5. device according to claim 4, it is characterised in that it is single that the allocation unit includes the initial beggar of allocation strategy Member, allocation strategy processing subelement, allocation strategy judgment sub-unit, node initializing subelement, node processing subelement, node Judgment sub-unit, breakdown judge subelement, subelement and configuration subelement are chosen,
    The allocation strategy initializes subelement, for initializing allocation strategy count value;
    The allocation strategy handles subelement, for obtaining an allocation strategy from the internal memory, and by the allocation strategy Count value adds 1;
    The allocation strategy judgment sub-unit, for judging whether the allocation strategy count value is less than or equal to allocation strategy sum Value;If so, then trigger the node initializing subelement;If it is not, then end operation;
    The node initializing subelement, for initializing node counts value;
    The node processing subelement, for obtaining allocation strategy nodal information from the allocation strategy, and by the node Count value adds 1;
    The node judgment sub-unit, for judging whether the node counts value is less than or equal to node total number value;If so, then touch Send out breakdown judge subelement described;If it is not, then end operation;
    The breakdown judge subelement, for judging whether the allocation strategy node breaks down;If so, then trigger the choosing Take subelement;If it is not, then trigger the configuration subelement;
    The selection subelement, for the priority orders according to the allocation strategy interior joint, it will appear from described point of failure Next node with polices node is as new allocation strategy node and triggers the node processing subelement;
    The configuration subelement, for the virtual IP address of the allocation strategy to be assigned into the allocation strategy node, and trigger The allocation strategy handles subelement.
  6. 6. device according to claim 4, it is characterised in that also including Tip element, the Tip element, for working as When all nodes that stating allocation strategy includes break down, then alarm prompt is carried out.
  7. A kind of 7. self-defined distribution virtual IP devices of CTDB, it is characterised in that including:
    Memory, for storing computer program;
    Processor, for performing the computer program to realize self-defined point of the CTDB as described in claims 1 to 3 any one The step of method with virtual IP address.
  8. 8. a kind of computer-readable recording medium, it is characterised in that be stored with computer on the computer-readable recording medium Program, the self-defined distribution of the CTDB as described in claims 1 to 3 any one is realized when the computer program is executed by processor The step of method of virtual IP address.
CN201710875739.0A 2017-09-25 2017-09-25 Method, device and equipment for CTDB custom distribution of virtual IP Active CN107465562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710875739.0A CN107465562B (en) 2017-09-25 2017-09-25 Method, device and equipment for CTDB custom distribution of virtual IP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710875739.0A CN107465562B (en) 2017-09-25 2017-09-25 Method, device and equipment for CTDB custom distribution of virtual IP

Publications (2)

Publication Number Publication Date
CN107465562A true CN107465562A (en) 2017-12-12
CN107465562B CN107465562B (en) 2020-03-06

Family

ID=60553488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710875739.0A Active CN107465562B (en) 2017-09-25 2017-09-25 Method, device and equipment for CTDB custom distribution of virtual IP

Country Status (1)

Country Link
CN (1) CN107465562B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810143A (en) * 2018-06-13 2018-11-13 郑州云海信息技术有限公司 A kind of method, system and device of client load equilibrium mount virtual IP
CN108881411A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of method that CTDB cluster is grouped under extensive node
CN108989476A (en) * 2018-06-12 2018-12-11 新华三技术有限公司 A kind of address distribution method and device
CN110519406A (en) * 2019-08-16 2019-11-29 济南浪潮数据技术有限公司 A kind of virtual address distribution method, device and CTDB cluster and storage medium
CN111416884A (en) * 2020-03-12 2020-07-14 苏州浪潮智能科技有限公司 CTDB virtual IP allocation method and device and distributed storage equipment
CN111901448A (en) * 2020-06-29 2020-11-06 苏州浪潮智能科技有限公司 CTDB virtual IP balance distribution method for cluster node fault scene

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1554055A (en) * 2001-07-23 2004-12-08 �Ƚ�΢װ�ù�˾ High-availability cluster virtual server system
CN102821044A (en) * 2012-07-27 2012-12-12 北京奇虎科技有限公司 Method and device for configuring server cluster
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1554055A (en) * 2001-07-23 2004-12-08 �Ƚ�΢װ�ù�˾ High-availability cluster virtual server system
CN102821044A (en) * 2012-07-27 2012-12-12 北京奇虎科技有限公司 Method and device for configuring server cluster
CN106982259A (en) * 2017-04-19 2017-07-25 聚好看科技股份有限公司 The failure solution of server cluster

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108881411A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of method that CTDB cluster is grouped under extensive node
CN108989476A (en) * 2018-06-12 2018-12-11 新华三技术有限公司 A kind of address distribution method and device
CN108989476B (en) * 2018-06-12 2021-09-07 新华三技术有限公司 Address allocation method and device
CN108810143A (en) * 2018-06-13 2018-11-13 郑州云海信息技术有限公司 A kind of method, system and device of client load equilibrium mount virtual IP
CN110519406A (en) * 2019-08-16 2019-11-29 济南浪潮数据技术有限公司 A kind of virtual address distribution method, device and CTDB cluster and storage medium
CN111416884A (en) * 2020-03-12 2020-07-14 苏州浪潮智能科技有限公司 CTDB virtual IP allocation method and device and distributed storage equipment
CN111416884B (en) * 2020-03-12 2021-08-31 苏州浪潮智能科技有限公司 CTDB virtual IP allocation method and device and distributed storage equipment
WO2021179476A1 (en) * 2020-03-12 2021-09-16 苏州浪潮智能科技有限公司 Ctdb virtual ip distribution method and apparatus, and distributed storage device
US11757830B2 (en) 2020-03-12 2023-09-12 Inspur Suzhou Intelligent Technology Co., Ltd. Method and apparatus for allocating CTDB-based virtual IP address, and distributed storage device
CN111901448A (en) * 2020-06-29 2020-11-06 苏州浪潮智能科技有限公司 CTDB virtual IP balance distribution method for cluster node fault scene
CN111901448B (en) * 2020-06-29 2022-06-14 苏州浪潮智能科技有限公司 CTDB virtual IP balance distribution method for cluster node fault scene

Also Published As

Publication number Publication date
CN107465562B (en) 2020-03-06

Similar Documents

Publication Publication Date Title
CN107465562A (en) A kind of method, apparatus, the equipment of the self-defined distribution virtual IP addresses of CTDB
CN107832355B (en) A kind of method and device that the agency of crawlers obtains
CN106170971B (en) Arbitration process method, arbitration storage device and system after a kind of cluster fissure
CN107608826A (en) A kind of fault recovery method, device and the medium of the node of storage cluster
CN104216759B (en) A kind of method for the logic magnetic disc for generating virtual machine, and device
CN107547252A (en) A kind of network failure processing method and device
CN108920314A (en) A kind of faulty hardware localization method, device, system and readable storage medium storing program for executing
CN105677506B (en) A kind of disk array backup method, electronic equipment and disk array
CN108038005A (en) Shared resource access method, client, server-side, system based on zookeeper
CN109828868A (en) Date storage method, device, management equipment and dual-active data-storage system
CN107257374A (en) Transaction processing method and system on a kind of block chain
CN107171900A (en) The acquisition methods and system of a kind of node running status
CN108243189A (en) A kind of Cyberthreat management method, device, computer equipment and storage medium
CN106301551A (en) A kind of fiber optic network fault location and fault business determine method and system
CN105656684B (en) Failure simulation method and device
CN107885859A (en) A kind of method, apparatus and computer-readable recording medium of file number quota
CN108183838A (en) The method and device of one introduces a collection nat feature test
CN107135234A (en) The method and apparatus that a kind of data traffic monitors control
CN106550208A (en) Video method for splitting, equipment and video analytic system
CN104184603B (en) A kind of User Status statistical method, apparatus and system
CN114281256A (en) Data synchronization method, device, equipment and medium based on distributed storage system
CN107193634A (en) The access method and device of a kind of virtual machine
CN109040344A (en) A kind of NAT penetrating method, device, equipment and storage medium
CN108509296A (en) A kind of method and system of processing equipment failure
CN109005181A (en) A kind of detection method, system and the associated component of DNS amplification attack

Legal Events

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