CN107070730B - CTDB starting method and device - Google Patents
CTDB starting method and device Download PDFInfo
- Publication number
- CN107070730B CN107070730B CN201710457243.1A CN201710457243A CN107070730B CN 107070730 B CN107070730 B CN 107070730B CN 201710457243 A CN201710457243 A CN 201710457243A CN 107070730 B CN107070730 B CN 107070730B
- Authority
- CN
- China
- Prior art keywords
- ctdb
- node
- current node
- remote node
- starting
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 241001362551 Samba Species 0.000 claims description 18
- RBZXVDSILZXPDM-UHFFFAOYSA-N 1-(2,5-dimethoxy-3,4-dimethylphenyl)propan-2-amine Chemical compound COC1=CC(CC(C)N)=C(OC)C(C)=C1C RBZXVDSILZXPDM-UHFFFAOYSA-N 0.000 claims description 8
- 230000003213 activating effect Effects 0.000 claims 1
- 230000000977 initiatory effect Effects 0.000 claims 1
- 238000012423 maintenance Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 4
- 239000003999 initiator Substances 0.000 description 1
Images
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/084—Configuration by using pre-existing information, e.g. using templates or copying from other elements
- H04L41/0846—Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
-
- 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
- H04L67/1097—Protocols 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]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Stored Programmes (AREA)
- Power Sources (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application discloses a CTDB starting method and a CTDB starting device, wherein the method comprises the steps of powering on and restarting a current node after the current node in a file system cluster is maintained and repaired; selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition; and starting the CTDB of the current node. The CTDB starting method and the CTDB starting device can enable the current node to provide the same service as other nodes of the cluster after the service is started, do not need to manually change a configuration file and restart the service, avoid errors caused by human factors, and improve the maintainability and stability of the cluster.
Description
Technical Field
The invention belongs to the technical field of storage equipment, and particularly relates to a CTDB starting method and a CTDB starting device.
Background
After the file system cluster is successfully deployed, file service is continuously provided, the file service must be provided for a client to use through software such as samba, the samba software is realized through a protocol that the client accesses files in the file system, the client communicates with samba software on a cluster node through the protocol to access the files, and the samba software exists on the cluster node in the form of a service process.
The CTDB is a high-availability cluster management software, and can use the CTDB to manage the starting and stopping of the SAMBA service on the cluster node, the SAMBA service is started when the CTDB is started, and the SAMBA service is stopped when the CTDB is stopped, and the CTDB MANAGES the starting and stopping of the SAMBA through the CTDB _ MANAGES _ SAMBA in the configuration file CTDB.
In the using process of a file system cluster, nodes in the cluster are powered off, maintained and repaired, restarted after the maintenance and repair is completed, and rejoined into the cluster, and during the maintenance, repair and rejoin into the cluster, samba configuration files on other normal nodes in the cluster may be modified, such as: and a new directory is exported, the same samba service as other nodes cannot be provided after the overhaul maintenance node is added into the cluster again, the samba configuration file of the maintenance node needs to be changed manually, then the samba service is restarted, and the error rate is increased by manual modification.
Disclosure of Invention
In order to solve the above problems, the present invention provides a CTDB starting method and apparatus, which enable a current node to provide the same service as other nodes of a cluster after the service is started, and do not need to manually change a configuration file and restart the service, thereby avoiding human errors and improving maintainability and stability of the cluster.
The invention provides a CTDB starting method, which comprises the following steps:
after the current node in the file system cluster is maintained and repaired, powering on and restarting the current node;
selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition;
and starting the CTDB of the current node.
Preferably, in the above CTDB starting method, the preset condition includes:
checking the CTDB identification bit of the remote node, if not 0, selecting another remote node, and if 0, executing the next step;
judging the CTDB state of the remote node, if not OK, selecting another remote node, if OK, executing the next step;
checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
checking whether the profiles of the remote node and the current node are the same, and if not, issuing a synchronization command.
Preferably, in the CTDB starting method, the checking whether the profiles of the remote node and the current node are the same is:
it is checked whether the MD5 values of the profiles of the remote node and the current node are the same.
Preferably, in the CTDB starting method, the profile is a SAMBA profile or a GANESHA profile.
The invention provides a CTDB starting device, which comprises:
the restarting unit is used for powering on and restarting the current node after the current node in the file system cluster is maintained and overhauled;
the synchronization unit is used for selecting a remote node and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition that a preset condition is met;
and the starting unit is used for starting the CTDB of the current node.
Preferably, in the CTDB starting apparatus, the synchronization unit includes:
a first checking part for checking the CTDB flag of the remote node, and if not 0, selecting another remote node, and if 0, performing the next step;
a judging unit configured to judge a CTDB status of the remote node, select another remote node if not OK, and execute the next step if OK;
a second checking part for checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
third checking means for checking whether the profiles of the remote node and the current node are the same and, if not, issuing a synchronization command.
Preferably, in the CTDB starting apparatus, the third checking means is specifically configured to check whether MD5 values of the profiles of the remote node and the current node are the same.
Preferably, in the CTDB initiator, the profile is a SAMBA profile or a GANESHA profile.
As can be seen from the above description, according to the starting method and apparatus of the CTDB provided by the present invention, because the method includes powering up and restarting the current node after the current node in the file system cluster is maintained and repaired; selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition; and starting the CTDB of the current node, so that the current node can provide the same service as other nodes of the cluster after the service is started, manual configuration file change and service restart are not needed, errors caused by human are avoided, and the maintainability and stability of the cluster are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic diagram of a first CTDB starting method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a first CTDB starting apparatus according to an embodiment of the present disclosure.
Detailed Description
The core idea of the invention is to provide a method and a device for starting a CTDB, which can enable a current node to provide the same service as other nodes of a cluster after the service is started, do not need to manually change a configuration file and restart the service, avoid errors caused by human factors, and improve the maintainability and stability of the cluster.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a method for starting a first CTDB provided in an embodiment of the present application, where fig. 1 is a schematic diagram of the method for starting a first CTDB provided in the embodiment of the present application, and the method includes the following steps:
s1: after the current node in the file system cluster is maintained and repaired, powering on and restarting the current node;
s2: selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition;
the selected remote node may be any normal node in the cluster, and the nodes configuration file of the CTDB configures the IP (including the maintenance node) of all the nodes in the cluster, so that the nodes in the nodes are selected in sequence when the remote node is selected. After the two are synchronized, the same file service can be provided without manual setting, and convenience is improved.
S3: and starting the CTDB of the current node.
Through the operation, the configuration files on the maintenance and overhaul node and the configuration files on other nodes can be kept the same, the file service the same as that of other nodes can be provided after the nodes are restarted successfully, manual modification operation is avoided, the maintainability and the stability of the cluster are improved, and the high error rate of manual operation is avoided.
As can be seen from the above description, in the first CTDB starting method provided in this embodiment of the present application, after a current node included in a file system cluster is maintained and repaired, the current node is powered on and restarted; selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition; and starting the CTDB of the current node, so that the current node can provide the same service as other nodes of the cluster after the service is started, manual configuration file change and service restart are not needed, errors caused by human are avoided, and the maintainability and stability of the cluster are improved.
The second CTDB starting method provided in the embodiment of the present application is based on the first CTDB starting method, and further includes the following technical features:
the preset conditions include:
checking the CTDB identification bit of the remote node, if the CTDB identification bit is not 0, the remote node is indicated to be started, selecting another remote node, and if the CTDB identification bit is 0, executing the next step;
judging the CTDB state of the remote node, if not OK, indicating that the CTDB of the remote node is not started, selecting another remote node, if OK, executing the next step;
checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
checking whether the profiles of the remote node and the current node are the same, and if not, issuing a synchronization command, otherwise, if the profiles are the same, no synchronization is required.
By using the mode, the synchronization can be effectively carried out, and the CTDB of the current node is started only after the configuration files of the current node and the remote node are the same.
The third CTDB starting method provided in the embodiment of the present application is based on the second CTDB starting method, and further includes the following technical features:
the checking whether the profiles of the remote node and the current node are the same is:
it is checked whether the MD5 values of the profiles of the remote node and the current node are the same.
It should be noted that, calculation of the MD5 value is the simplest judgment method, however, this is only a preferred method, and other methods may also be adopted, and is not limited herein.
The fourth CTDB starting method provided in the embodiment of the present application is based on any one of the first to third CTDB starting methods, and further includes the following technical features:
the configuration file is SAMBA configuration file or GANESHA configuration file.
It should be noted that not only the SAMBA configuration file may be synchronized, but also when the CTDB is required to manage other software such as the GANESHA configuration file (configuration file in the NFS system), the synchronization may be performed, and the extensibility is high.
Fig. 2 shows an apparatus for starting a first CTDB according to an embodiment of the present application, where fig. 2 is a schematic diagram of the apparatus for starting a first CTDB according to an embodiment of the present application, and the apparatus includes:
the restarting unit 201 is configured to power on and restart a current node in the file system cluster after the current node is maintained and repaired;
a synchronizing unit 202, configured to select a remote node, and synchronize the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node when a preset condition is met, where the selected remote node may be any normal node in a cluster, and the nodes configuration file of the CTDB configures the IPs (including maintenance nodes) of all nodes in the cluster, so that it is only necessary to select nodes in turn when selecting the remote node. After the two are synchronized, the same file service can be provided without manual setting, so that convenience is improved;
the starting unit 203 is configured to start the CTDB of the current node, so that it is ensured that the configuration file on the maintenance and repair node remains the same as the configuration files on other nodes, and the same file service as that of other nodes can be provided after the node is restarted successfully, thereby avoiding manual modification operation, improving maintainability and stability of the cluster, and avoiding high error rate of manual operation.
The second CTDB starting device provided in the embodiment of the present application is based on the first CTDB starting device, and further includes the following technical features:
the synchronization unit includes:
a first checking part for checking the CTDB flag of the remote node, and if not 0, selecting another remote node, and if 0, performing the next step;
a judging unit configured to judge a CTDB status of the remote node, select another remote node if not OK, and execute the next step if OK;
a second checking part for checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
third checking means for checking whether the profiles of the remote node and the current node are the same and, if not, issuing a synchronization command.
The third CTDB starting device provided in the embodiment of the present application is based on the second CTDB starting device, and further includes the following technical features:
the third checking means is specifically configured to check whether MD5 values of the profiles of the remote node and the current node are the same.
It should be noted that, calculation of the MD5 value is the simplest judgment method, however, this is only a preferred method, and other methods may also be adopted, and is not limited herein.
The fourth CTDB starting device according to the embodiment of the present application is based on any one of the first to third CTDB starting devices, and further includes the following technical features:
the configuration file is SAMBA configuration file or GANESHA configuration file.
It should be noted that not only the SAMBA configuration file may be synchronized, but also when the CTDB is required to manage other software such as the GANESHA configuration file (configuration file in the NFS system), the synchronization may be performed, and the extensibility is high.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (6)
1. A CTDB starting method, comprising:
after the current node in the file system cluster is maintained and repaired, powering on and restarting the current node;
selecting a remote node, and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition of meeting a preset condition;
starting the CTDB of the current node;
the preset conditions include:
checking the CTDB identification bit of the remote node, if not 0, selecting another remote node, and if 0, executing the next step;
judging the CTDB state of the remote node, if not OK, selecting another remote node, if OK, executing the next step;
checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
checking whether the profiles of the remote node and the current node are the same, and if not, issuing a synchronization command.
2. The CTDB start-up method according to claim 1, wherein the checking whether the profiles of the remote node and the current node are the same is:
it is checked whether the MD5 values of the profiles of the remote node and the current node are the same.
3. A method of booting a CTDB according to any of the claims 1-2 characterised in that the profile is a SAMBA profile or a GANESHA profile.
4. An apparatus for activating a CTDB, comprising:
the restarting unit is used for powering on and restarting the current node after the current node in the file system cluster is maintained and overhauled;
the synchronization unit is used for selecting a remote node and synchronizing the configuration file of the CTDB of the current node and the configuration file of the CTDB of the remote node under the condition that a preset condition is met;
a starting unit for starting the CTDB of the current node;
the synchronization unit includes:
a first checking part for checking the CTDB flag of the remote node, and if not 0, selecting another remote node, and if 0, performing the next step;
a judging unit configured to judge a CTDB status of the remote node, select another remote node if not OK, and execute the next step if OK;
a second checking part for checking whether the CTDB of the current node manages the configuration file, if so, executing the next step, and if not, starting the CTDB of the current node;
third checking means for checking whether the profiles of the remote node and the current node are the same and, if not, issuing a synchronization command.
5. A CTDB startup device according to claim 4, characterized in that the third checking means are specifically adapted to check whether the MD5 values of the profiles of the remote node and the current node are the same.
6. An apparatus for initiating a CTDB according to any of the claims 4-5, characterized in that said profile is a SAMBA profile or a GANESHA profile.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710457243.1A CN107070730B (en) | 2017-06-16 | 2017-06-16 | CTDB starting method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710457243.1A CN107070730B (en) | 2017-06-16 | 2017-06-16 | CTDB starting method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107070730A CN107070730A (en) | 2017-08-18 |
CN107070730B true CN107070730B (en) | 2020-03-31 |
Family
ID=59594648
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710457243.1A Active CN107070730B (en) | 2017-06-16 | 2017-06-16 | CTDB starting method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107070730B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107547654B (en) * | 2017-09-12 | 2020-10-02 | 郑州云海信息技术有限公司 | Distributed object storage cluster, deployment and service method and system |
CN107766152A (en) * | 2017-10-19 | 2018-03-06 | 郑州云海信息技术有限公司 | Management method, system, device and the readable storage medium storing program for executing of load balancing service |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102916974A (en) * | 2012-11-07 | 2013-02-06 | 曙光信息产业股份有限公司 | Cluster configuration updating method |
CN103607462A (en) * | 2013-11-22 | 2014-02-26 | 曙光信息产业股份有限公司 | Cluster NAS deployment system and deployment method thereof |
CN105262820A (en) * | 2015-10-29 | 2016-01-20 | 浪潮电子信息产业股份有限公司 | Cluster multi-computer mutual backup method based on Linux operating system |
CN106339387A (en) * | 2015-07-08 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Data synchronization method and device of server newly added to database cluster |
CN106528574A (en) * | 2015-09-14 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Data synchronization method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10693955B2 (en) * | 2013-12-14 | 2020-06-23 | Netapp, Inc. | Techniques for SAN storage cluster synchronous disaster recovery |
-
2017
- 2017-06-16 CN CN201710457243.1A patent/CN107070730B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102916974A (en) * | 2012-11-07 | 2013-02-06 | 曙光信息产业股份有限公司 | Cluster configuration updating method |
CN103607462A (en) * | 2013-11-22 | 2014-02-26 | 曙光信息产业股份有限公司 | Cluster NAS deployment system and deployment method thereof |
CN106339387A (en) * | 2015-07-08 | 2017-01-18 | 阿里巴巴集团控股有限公司 | Data synchronization method and device of server newly added to database cluster |
CN106528574A (en) * | 2015-09-14 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Data synchronization method and device |
CN105262820A (en) * | 2015-10-29 | 2016-01-20 | 浪潮电子信息产业股份有限公司 | Cluster multi-computer mutual backup method based on Linux operating system |
Also Published As
Publication number | Publication date |
---|---|
CN107070730A (en) | 2017-08-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI751402B (en) | Data synchronization method, distributed system, computer readable storage and retrieval media, computer equipment and distributed equipment | |
CN105302593B (en) | The remote update system and method for PowerPC motherboard | |
CN104601366B (en) | It is a kind of control, service node configuration service method and device | |
CN109992571B (en) | Online closed-loop checking system and checking method for configuration file of intelligent substation | |
WO2022036901A1 (en) | Implementation method and apparatus for redis replica set | |
CN107070730B (en) | CTDB starting method and device | |
CN106502835B (en) | A kind of disaster-tolerant backup method and device | |
CN105260209A (en) | Hot-update solution of program | |
WO2019062576A1 (en) | Protection method against abnormal power disconnection during system upgrade and terminal device | |
CN102300239B (en) | Base station and self-starting method thereof | |
CN109558209B (en) | Monitoring method for virtual machine | |
CN102355371A (en) | Implementation method for dual hot redundancy of splicing wall control system | |
CN111158952B (en) | Method for automatically backing up configuration files by using external storage device | |
CN111176893A (en) | Computer remote control method, device, system and storage medium | |
CN105323289B (en) | One kind being based on distributed method of data synchronization | |
WO2016045374A1 (en) | Data synchronization method and apparatus | |
CN110007934B (en) | Distributed database deployment method and device | |
WO2016177202A1 (en) | Method and device for patch maintenance | |
CN110825015B (en) | Method and system for recovering data communication between human-computer interface and PLC controller | |
CN108156264B (en) | Data synchronization method oriented to dual-computer redundancy | |
CN111427730A (en) | Method and device for repairing service fault of centralized safety management framework | |
CN102968320B (en) | Based on industrial control equipment automatic recovery system and the operation method thereof of cloud backup | |
CN110597609A (en) | Cluster migration and automatic recovery method and system | |
CN106250256B (en) | Server fault recovery method and device | |
CN105468126B (en) | A kind of apparatus control method, device and electronic equipment |
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 |