Configuration file synchronization method and device, equipment and storage medium
By detecting and comparing summary information of configuration files in high-performance computing clusters and automatically synchronizing inconsistent parts, the problem of time-consuming and labor-intensive configuration file synchronization in the existing technology is solved, efficient and accurate configuration file synchronization is achieved, and costs are saved.
Patent Information
- Application Number
- CN202410939101.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-03
AI Technical Summary
In high-performance computing clusters, the existing technology requires manual synchronization of configuration files, resulting in high time and labor costs, and the synchronization is not timely and unreliable. Especially when the number of nodes increases, manual synchronization of configuration files is required, resulting in additional costs and time. waste.
By detecting changes in the configuration file of the main computing node, calculate its summary information, and compare it with the summary information of other nodes. If it is inconsistent, it will automatically synchronize. Use file monitoring tools and summary algorithms (such as MD5, SHA1, SHA256) to ensure synchronization accuracy. , using the rsync tool for file synchronization to achieve automated configuration file synchronization.
It improves the accuracy and efficiency of configuration file synchronization, saves manpower and time costs, reduces unnecessary file transfers, and realizes automated synchronization of configuration files in high-performance computing clusters.
Smart Images

Figure CN118585503A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a configuration file synchronization method, device, equipment and storage medium. Background Art
[0002] At present, high performance computing (HPC) technology has been widely used in many fields, such as life sciences, manufacturing simulation CAE (Computer Aided Engineering), chemical industry, aerospace, materials, meteorology and other fields. In these fields, a large number of calculations are usually involved, and the computing tasks are required to be completed within a certain period of time. A general server node alone cannot meet the requirements. Generally, multiple high-performance servers are used, interconnected through high-speed networks, to form a high-performance computing cluster, so as to process a large amount of data in parallel at an extremely high speed.
[0003] Currently, in HPC clusters, hundreds or thousands of computing nodes are usually required to meet users' massive computing needs. In addition, new nodes are often added to the HPC cluster, and specific scheduling software and configuration files usually need to be installed on each node. In addition, the configuration files in all computing nodes need to be kept identical and up-to-date at all times.
[0004] In order to ensure the synchronization of configuration files, the operation and maintenance personnel usually edit the configuration file on one machine and then manually synchronize the file to all computing nodes through shell commands. This method not only consumes a lot of human resources and wastes a lot of time, but also cannot guarantee the timeliness and reliability of synchronization. Whenever a new computing node is added, the configuration file needs to be manually synchronized to the new node, which costs a lot of manpower and time. Therefore, a convenient and reliable method is urgently needed to solve this problem. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a configuration file synchronization method, device, equipment and storage medium, which can avoid unnecessary file content transmission, improve the accuracy of file synchronization, and realize automatic configuration file synchronization, thereby saving labor costs and time costs. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a configuration file synchronization method, which is applied to a high performance computing cluster management system, comprising:
[0007] Applied to high-performance computing cluster management systems, including:
[0008] Detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain the file detection result;
[0009] If the file detection result indicates that the original configuration file has changed, then the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information;
[0010] The node information recorded in the preset computing node list is traversed in sequence to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result;
[0011] If the information comparison result indicates that the latest summary information is inconsistent with summary information of configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes.
[0012] Optionally, the detecting whether the original configuration file in the main computing node in the current high-performance computing cluster has changed to obtain the file detection result includes:
[0013] The file monitoring tool is used to monitor the latest file update time of the original configuration file in the main computing node in the current high-performance computing cluster;
[0014] If it is monitored that the latest file update time of the current original configuration file has changed, it is determined that the original configuration file has changed, and a file detection result that the original configuration file has changed is obtained;
[0015] If no change is detected in the latest file update time of the current original configuration file, it is determined that the original configuration file has not changed, and a file detection result indicating that the original configuration file has not changed is obtained.
[0016] Optionally, the calculating summary information of the latest configuration file that has changed to obtain the latest summary information includes:
[0017] The summary information of the latest configuration file that has changed is calculated using a preset information summary algorithm to obtain the latest summary information; the preset information summary algorithm includes an MD5 algorithm, a SHA1 algorithm, and a SHA256 algorithm.
[0018] Optionally, if the information comparison result indicates that the latest summary information is inconsistent with summary information of configuration files in other computing nodes in the high-performance computing cluster except the main computing node, synchronizing the latest configuration file to the other computing nodes includes:
[0019] If the information comparison result indicates that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, a file change prompt information for the main computing node is sent to the master control management component so that the master control management component issues a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool; wherein the master control management component and the file synchronization component are located in the high-performance computing cluster management system.
[0020] Optionally, issuing a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool includes:
[0021] A file synchronization instruction is issued to the file synchronization component to synchronize the latest configuration file to the other computing nodes using the rsync tool.
[0022] Optionally, the detecting whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, before obtaining the file detection result, further includes:
[0023] The node information of each computing node in the high-performance computing cluster is collected, and a computing node list is created based on the collected node information of each computing node to obtain a preset computing node list; the node information includes the IP information, user name, password, online status, latest file summary information, and the most recent file synchronization time of the computing node;
[0024] Accordingly, the configuration file synchronization method further includes:
[0025] Detecting the connectivity status of each computing node in the preset computing node list according to a preset time period to obtain a status detection result;
[0026] If the state detection result is a disconnected state, deleting the node information of the computing node corresponding to the disconnected state from the preset computing node list;
[0027] If it is detected that a new computing node is added to the high-performance computing cluster, the latest configuration file is synchronized to the new computing node, and the node information of the new computing node is obtained, and then the node information of the new computing node is saved in the preset computing node list.
[0028] Optionally, after synchronizing the latest configuration file to the other computing nodes, the method further includes:
[0029] Obtaining the file synchronization time of the other computing nodes performing file synchronization, and counting the number of nodes that have successfully synchronized among the other computing nodes performing file synchronization;
[0030] The file synchronization time, the number of nodes and the corresponding latest summary information are recorded in the synchronization log.
[0031] In a second aspect, the present application discloses a configuration file synchronization device, which is applied to a high-performance computing cluster management system, comprising:
[0032] A detection module is used to detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain a file detection result;
[0033] A calculation module, configured to calculate summary information of the latest configuration file that has changed, if the file detection result indicates that the original configuration file has changed, to obtain the latest summary information;
[0034] A comparison module is used to traverse the node information recorded in the preset computing node list in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result;
[0035] The file synchronization module is used to synchronize the latest configuration file to the other computing nodes in the high-performance computing cluster except the main computing node if the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in the other computing nodes in the high-performance computing cluster.
[0036] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned configuration file synchronization method when executing a computer program stored in the memory.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned configuration file synchronization method is implemented.
[0038] It can be seen that the present application is applied to a high-performance computing cluster management system, which first detects whether the original configuration file in the main computing node in the current high-performance computing cluster has changed to obtain a file detection result. If the file detection result shows that the original configuration file has changed, the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information, and then the node information recorded in the preset computing node list is traversed in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result. If the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes. When detecting that the original configuration file in the main computing node in the high-performance computing cluster has changed, the present application does not directly synchronize the configuration file, but further calculates the summary information of the latest configuration file of the main computing node, and compares the calculated latest summary information with the summary information of other computing nodes recorded in the preset computing node list. If the two are consistent, the configuration file is synchronized. The present application determines whether the content of the configuration file has actually changed by comparing the file summary information, thereby avoiding unnecessary transmission of file content, improving the accuracy of file synchronization, and realizing automated synchronization of all configuration files in the high-performance computing cluster, thereby saving manpower and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flow chart of a configuration file synchronization method disclosed in this application;
[0041] Figure 2 A flowchart of a specific configuration file synchronization method disclosed in this application;
[0042] Figure 3 A schematic diagram of the structure of a configuration file synchronization device disclosed in this application;
[0043] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The present application embodiment discloses a configuration file synchronization method applied to a high performance computing cluster management system, see Figure 1 As shown, the method includes:
[0046] Step S11: Detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain a file detection result.
[0047] It should be pointed out that the configuration file synchronization solution proposed in this application is applied to a high-performance computing cluster management system, which can manage, monitor and schedule jobs for the entire high-performance computing cluster, thereby lowering the threshold for using the high-performance computing cluster.
[0048] In this embodiment, the high-performance computing cluster management system can detect the original configuration files in the main computing node in the high-performance computing cluster in real time, specifically detecting whether the original configuration files pre-installed in the main computing node have changed, and obtaining corresponding file detection results.
[0049] In a specific implementation, the detection of whether the original configuration file in the main computing node in the current high-performance computing cluster has changed to obtain the file detection result may specifically include: monitoring the latest file update time of the original configuration file in the main computing node in the current high-performance computing cluster through a file monitoring tool; if the latest file update time of the current original configuration file is monitored to change, it is determined that the original configuration file has changed, and a file detection result that the original configuration file has changed is obtained; if the latest file update time of the current original configuration file is not monitored to change, it is determined that the original configuration file has not changed, and a file detection result that the original configuration file has not changed is obtained. In this embodiment, the latest file update time of the original configuration file in the main computing node in the current high-performance computing cluster can be monitored in real time through a file monitoring tool (such as inotify-tools). When the latest file update time of the original configuration file in the main computing node in the current cluster is monitored to change, it is determined that the content of the original configuration file has changed, thereby obtaining a file detection result that the original configuration file has changed; if the latest file update time of the original configuration file in the main computing node in the current cluster is not monitored to change, it is determined that the original configuration file has not changed, thereby obtaining a file detection result that the original configuration file has not changed. By monitoring the latest file update time of the original configuration file in the main computing node in the high-performance computing cluster, it is possible to preliminarily determine whether the content of the original configuration file has changed, thereby providing a basis for further determining whether the effective content in the original configuration file has changed.
[0050] Step S12: If the file detection result indicates that the original configuration file has changed, the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information.
[0051] In this embodiment, if the above file detection result indicates that the content of the original configuration file has changed, the summary information of the latest configuration file that has changed is further calculated to obtain the latest summary information corresponding to the main computing node.
[0052] Specifically, the calculation of the summary information of the latest configuration file that has changed to obtain the latest summary information may include: using a preset information digest algorithm to calculate the summary information of the latest configuration file that has changed to obtain the latest summary information; the preset information digest algorithm includes an MD5 algorithm, a SHA1 algorithm, and a SHA256 algorithm. That is, the information digest algorithm may be used to calculate the summary information of the latest configuration file that has changed to obtain a corresponding summary value. The information digest algorithm includes, but is not limited to, the MD5 algorithm (Message-Digest Algorithm 5, a message digest algorithm), the SHA1 (SecureHash Algorithm 1, secure hash algorithm 1) algorithm, and the SHA256 algorithm.
[0053] Step S13: traverse the node information recorded in the preset computing node list in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result.
[0054] In this embodiment, after calculating the summary information of the latest configuration file that has changed to obtain the latest summary information, further, the node information corresponding to each node recorded in the preset computing node list is traversed in turn, so as to compare the above-mentioned latest summary information with the summary information of the configuration files in other computing nodes except the main computing node in the high-performance computing cluster, that is, the summary information corresponding to the main computing node is compared with the summary information corresponding to the other computing nodes in turn, so as to obtain the corresponding information comparison result.
[0055] It should be pointed out that the detection of whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, before obtaining the file detection result, also needs to include: collecting the node information of each computing node in the high-performance computing cluster, and creating a computing node list based on the collected node information of each computing node to obtain a preset computing node list; the node information includes the IP information, user name, password, online status, latest file summary information, and the most recent file synchronization time of the computing node. That is, the node information of each computing node in the high-performance computing cluster is collected, and then the collected node information is saved in a computing node list; wherein the node information specifically includes but is not limited to the IP (Internet Protocol) information, user name, password, online status (such as online or offline), latest file summary information (i.e., summary information corresponding to the latest configuration file in the computing node), the most recent file synchronization time, etc. of each computing node. By creating a list containing the node information of each computing node in the cluster, it is possible to directly determine whether the configuration file has changed according to the content recorded in the list when synchronizing the configuration file, thereby improving the efficiency of configuration file synchronization and saving the time of file synchronization.
[0056] In addition, the configuration file synchronization method may further include: detecting the connectivity status of each computing node in the preset computing node list according to a preset time period to obtain a status detection result; if the status detection result is a disconnected state, deleting the node information of the computing node corresponding to the disconnected state from the preset computing node list; if it is detected that a new computing node is added to the high-performance computing cluster, synchronizing the latest configuration file to the new computing node, obtaining the node information of the new computing node, and then saving the node information of the new computing node to the preset computing node list. In this embodiment, the connectivity status of each computing node recorded in the preset computing node list can be detected according to a preset time period. If the status detection result is a disconnected state, it indicates that the corresponding computing node is not located in the high-performance computing cluster. At this time, the node information of the computing node in the disconnected state can be deleted from the preset computing node list, thereby updating the preset computing node list, so that the number of node information recorded in the preset computing node list is consistent with the number of actual nodes in the actual cluster. Furthermore, when it is detected that a new computing node is added to the high-performance computing cluster, the latest configuration file in the main computing node can be synchronized to the new computing node, and then the node information of the new computing node is obtained, and the obtained node information is saved in the preset computing node list, so that the number of node information recorded in the preset computing node list is consistent with the number of actual nodes in the actual cluster.
[0057] Step S14: If the information comparison result indicates that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes.
[0058] In this embodiment, if the above information comparison result indicates that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, that is, the summary information of the two is inconsistent, then it indicates that there are computing nodes in the entire cluster that are inconsistent with the configuration files in the main computing node. At this time, the above latest configuration file can be transmitted to the corresponding other computing nodes, thereby realizing the synchronization of all configuration files in the cluster.
[0059] In a specific implementation, synchronizing the latest configuration file to the other computing nodes may specifically include: synchronizing the latest configuration file to the other computing nodes by incremental synchronization. In this embodiment, in order to improve the efficiency of data synchronization and save the time of data synchronization, an incremental synchronization method may be adopted to synchronize only the changed data. Specifically, the content of the new configuration file is compared with the content of the configuration files in each other computing node to find inconsistent data, and then the inconsistent data that has changed in the latest configuration file is synchronized to the corresponding other computing nodes, thereby further avoiding the transmission of useless file content and improving the efficiency of file synchronization.
[0060] Specifically, if the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes except the main computing node in the high-performance computing cluster, then the latest configuration file is synchronized to the other computing nodes, which may specifically include: if the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes except the main computing node in the high-performance computing cluster, then file change prompt information for the main computing node is sent to the master control management component, so that the master control management component issues a file synchronization instruction to the file synchronization component, so as to use the preset file synchronization tool to synchronize the latest configuration file to the other computing nodes; wherein, the master control management component and the file synchronization component are located in the high-performance computing cluster management system. It should be pointed out that the present application pre-sets a master management component in the high-performance computing cluster management system for issuing synchronization instructions. Specifically, when the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes, the file change prompt information of the main computing node can be sent to the master management component. When the master management component receives the file change prompt information, it issues a file synchronization instruction to the file synchronization component in the high-performance computing cluster management system, thereby using the preset file synchronization tool to synchronize the latest configuration file to the corresponding other computing nodes.
[0061] In a specific implementation, the issuing of a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool may specifically include: issuing a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using an rsync tool. That is, the latest configuration file may be synchronized to the corresponding other computing nodes using a file synchronization tool (i.e., rsync, remote sync).
[0062] In another specific implementation, the file synchronization tool scp (Secure Copy Protocol, a file transfer tool based on SSH) may be used to synchronize the latest configuration file to the corresponding other computing nodes.
[0063] It can be seen that the embodiment of the present application is applied to a high-performance computing cluster management system. First, it is detected whether the original configuration file in the main computing node in the current high-performance computing cluster has changed to obtain a file detection result. If the file detection result shows that the original configuration file has changed, the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information, and then the node information recorded in the preset computing node list is traversed in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result. If the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes. When detecting that the original configuration file in the main computing node in the high-performance computing cluster has changed, the embodiment of the present application does not directly synchronize the configuration file, but further calculates the summary information of the latest configuration file of the main computing node, and compares the calculated latest summary information with the summary information of other computing nodes recorded in the preset computing node list. If the two are consistent, the configuration file is synchronized. The embodiment of the present application determines whether the content of the configuration file has actually changed by comparing the file summary information, thereby avoiding unnecessary transmission of file content, improving the accuracy of file synchronization, and realizing automated synchronization of all configuration files in the high-performance computing cluster, thereby saving manpower and time costs.
[0064] The present application embodiment discloses a specific configuration file synchronization method applied to a high performance computing cluster management system, see Figure 2 As shown, the method includes:
[0065] Step S21: Detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain a file detection result.
[0066] Step S22: If the file detection result indicates that the original configuration file has changed, the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information.
[0067] Step S23: traverse the node information recorded in the preset computing node list in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result.
[0068] Step S24: If the information comparison result indicates that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes.
[0069] Step S25: Obtain the file synchronization time of the other computing nodes that perform file synchronization, and count the number of nodes that have successfully synchronized among the other computing nodes that perform file synchronization.
[0070] In this embodiment, after synchronizing the latest configuration file to the other computing nodes, further, the file synchronization time of the other computing nodes that have performed file synchronization is obtained, and then the number of nodes that have successfully synchronized among the other computing nodes that have performed file synchronization is counted.
[0071] Step S26: Record the file synchronization time, the number of nodes and the corresponding latest summary information into the synchronization log.
[0072] In this embodiment, after the file synchronization time of the other computing nodes and the number of nodes that have successfully synchronized are collected, the file synchronization time, the number of nodes and the corresponding latest summary information may be saved in the synchronization log.
[0073] For more specific processing procedures of the above steps S21 to S24, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described again here.
[0074] It can be seen that after the embodiment of the present application synchronizes the latest configuration file to other computing nodes, it further obtains the file synchronization time of the other computing nodes performing file synchronization, and counts the number of nodes that have successfully synchronized among the other computing nodes performing file synchronization, and records the file synchronization time, the number of nodes, and the corresponding latest summary information in the synchronization log. By recording synchronization-related log information, it is convenient to uniformly manage and view the configuration file synchronization process, and to quickly analyze the problem after an abnormal problem occurs, so as to quickly locate and solve the abnormal problem.
[0075] Correspondingly, the present application also discloses a configuration file synchronization device, which is applied to a high-performance computing cluster management system, see Figure 3 As shown, the device comprises:
[0076] The detection module 11 is used to detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain a file detection result;
[0077] A calculation module 12 is configured to calculate summary information of the latest configuration file that has changed, if the file detection result indicates that the original configuration file has changed, to obtain the latest summary information;
[0078] A comparison module 13 is used to traverse the node information recorded in the preset computing node list in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result;
[0079] The file synchronization module 14 is configured to synchronize the latest configuration file to the other computing nodes in the high-performance computing cluster, if the information comparison result indicates that the latest summary information is inconsistent with summary information of configuration files in the other computing nodes except the main computing node.
[0080] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0081] It can be seen that the embodiment of the present application is applied to a high-performance computing cluster management system. First, it is detected whether the original configuration file in the main computing node in the current high-performance computing cluster has changed to obtain a file detection result. If the file detection result shows that the original configuration file has changed, the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information, and then the node information recorded in the preset computing node list is traversed in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result. If the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes. When detecting that the original configuration file in the main computing node in the high-performance computing cluster has changed, the embodiment of the present application does not directly synchronize the configuration file, but further calculates the summary information of the latest configuration file of the main computing node, and compares the calculated latest summary information with the summary information of other computing nodes recorded in the preset computing node list. If the two are consistent, the configuration file is synchronized. The embodiment of the present application determines whether the content of the configuration file has actually changed by comparing the file summary information, thereby avoiding unnecessary transmission of file content, improving the accuracy of file synchronization, and realizing automated synchronization of all configuration files in the high-performance computing cluster, thereby saving manpower and time costs.
[0082] In some specific embodiments, the detection module 11 may specifically include:
[0083] A monitoring unit, used to monitor the latest file update time of the original configuration file in the main computing node in the current high-performance computing cluster through a file monitoring tool;
[0084] A first determination unit is configured to determine that the original configuration file has been changed if it is detected that the latest file update time of the current original configuration file has changed, and obtain a file detection result that the original configuration file has been changed;
[0085] The second determination unit is configured to determine that the original configuration file has not changed if no change is detected in the latest file update time of the current original configuration file, and obtain a file detection result indicating that the original configuration file has not changed.
[0086] In some specific embodiments, the calculation module 12 may specifically include:
[0087] The summary calculation unit is used to calculate the summary information of the latest configuration file that has changed by using a preset information summary algorithm to obtain the latest summary information; the preset information summary algorithm includes MD5 algorithm, SHA1 algorithm, and SHA256 algorithm.
[0088] In some specific embodiments, the file synchronization module 14 may specifically include:
[0089] A prompt information sending unit is used to send file change prompt information for the main computing node to the main control management component if the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration file in other computing nodes except the main computing node in the high-performance computing cluster, so that the main control management component can issue a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool; wherein the master control management component and the file synchronization component are located in the high-performance computing cluster management system.
[0090] In some specific embodiments, the prompt information sending unit may specifically include:
[0091] The first file synchronization unit is used to issue a file synchronization instruction to the file synchronization component, so as to synchronize the latest configuration file to the other computing nodes by using the rsync tool.
[0092] In some specific embodiments, before the detection module 11, the following may also be included:
[0093] An information collection unit, used to collect node information of each computing node in the high performance computing cluster;
[0094] A list creation unit, used to create a computing node list based on the collected node information of each computing node, and obtain a preset computing node list; the node information includes the IP information, user name, password, online status, latest file summary information, and the most recent file synchronization time of the computing node;
[0095] Correspondingly, the configuration file synchronization device further includes:
[0096] A state detection unit, used to detect the connectivity state of each computing node in the preset computing node list according to a preset time period to obtain a state detection result;
[0097] a deleting unit, configured to delete the node information of the computing node corresponding to the disconnected state from the preset computing node list if the state detection result is a disconnected state;
[0098] A second file synchronization unit, configured to synchronize the latest configuration file to a new computing node if it is detected that a new computing node is added to the high performance computing cluster;
[0099] The information acquisition and storage unit is used to acquire the node information of the new computing node, and then save the node information of the new computing node into the preset computing node list.
[0100] In some specific embodiments, after the file synchronization module 14, the following may also be included:
[0101] A synchronization time acquisition unit, used to acquire the file synchronization time of the other computing nodes performing file synchronization;
[0102] A counting unit, used for counting the number of nodes that have successfully synchronized among the other computing nodes performing file synchronization;
[0103] The information recording unit is used to record the file synchronization time, the number of nodes and the corresponding latest summary information into a synchronization log.
[0104] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0105] Figure 4The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the configuration file synchronization method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0106] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0107] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0108] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the configuration file synchronization method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0109] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the configuration file synchronization method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0110] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which implements the steps of the configuration file synchronization method disclosed above when executed by a processor.
[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0113] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0115] The above is a detailed introduction to a configuration file synchronization method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A configuration file synchronization method, characterized in that: Applied to high-performance computing cluster management systems, including: Detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain the file detection result; If the file detection result indicates that the original configuration file has changed, then the summary information of the latest configuration file that has changed is calculated to obtain the latest summary information; The node information recorded in the preset computing node list is traversed in sequence to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result; If the information comparison result indicates that the latest summary information is inconsistent with summary information of configuration files in other computing nodes in the high-performance computing cluster except the main computing node, the latest configuration file is synchronized to the other computing nodes.
2. The configuration file synchronization method according to claim 1, characterized in that: The detecting whether the original configuration file in the main computing node in the current high performance computing cluster has changed, and obtaining the file detection result, includes: The file monitoring tool is used to monitor the latest file update time of the original configuration file in the main computing node in the current high-performance computing cluster; If it is monitored that the latest file update time of the current original configuration file has changed, it is determined that the original configuration file has changed, and a file detection result that the original configuration file has changed is obtained; If no change is detected in the latest file update time of the current original configuration file, it is determined that the original configuration file has not changed, and a file detection result indicating that the original configuration file has not changed is obtained.
3. The configuration file synchronization method according to claim 1, characterized in that: The summary information of the latest configuration file that has changed is calculated to obtain the latest summary information, including: The summary information of the latest configuration file that has changed is calculated using a preset information summary algorithm to obtain the latest summary information; the preset information summary algorithm includes an MD5 algorithm, a SHA1 algorithm, and a SHA256 algorithm.
4. The configuration file synchronization method according to claim 1, characterized in that: If the information comparison result shows that the latest summary information is inconsistent with summary information of configuration files in other computing nodes in the high-performance computing cluster except the main computing node, synchronizing the latest configuration file to the other computing nodes includes: If the information comparison result indicates that the latest summary information is inconsistent with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node, a file change prompt information for the main computing node is sent to the master control management component so that the master control management component issues a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool; wherein the master control management component and the file synchronization component are located in the high-performance computing cluster management system.
5. The configuration file synchronization method according to claim 4, characterized in that: The issuing of a file synchronization instruction to the file synchronization component to synchronize the latest configuration file to the other computing nodes using a preset file synchronization tool includes: A file synchronization instruction is issued to the file synchronization component to synchronize the latest configuration file to the other computing nodes using the rsync tool.
6. The configuration file synchronization method according to claim 1, characterized in that: The detecting whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, before obtaining the file detection result, also includes: The node information of each computing node in the high-performance computing cluster is collected, and a computing node list is created based on the collected node information of each computing node to obtain a preset computing node list; the node information includes the IP information, user name, password, online status, latest file summary information, and the most recent file synchronization time of the computing node; Accordingly, the configuration file synchronization method further includes: Detecting the connectivity status of each computing node in the preset computing node list according to a preset time period to obtain a status detection result; If the state detection result is a disconnected state, deleting the node information of the computing node corresponding to the disconnected state from the preset computing node list; If it is detected that a new computing node is added to the high-performance computing cluster, the latest configuration file is synchronized to the new computing node, and the node information of the new computing node is obtained, and then the node information of the new computing node is saved in the preset computing node list.
7. The configuration file synchronization method according to any one of claims 1 to 6, characterized in that: After synchronizing the latest configuration file to the other computing nodes, the method further includes: Obtaining the file synchronization time of the other computing nodes performing file synchronization, and counting the number of nodes that have successfully synchronized among the other computing nodes performing file synchronization; The file synchronization time, the number of nodes and the corresponding latest summary information are recorded in the synchronization log.
8. A configuration file synchronization device, characterized in that: Applied to high-performance computing cluster management systems, including: A detection module is used to detect whether the original configuration file in the main computing node in the current high-performance computing cluster has changed, and obtain a file detection result; A calculation module, configured to calculate summary information of the latest configuration file that has changed, if the file detection result indicates that the original configuration file has changed, to obtain the latest summary information; A comparison module is used to traverse the node information recorded in the preset computing node list in turn to compare the latest summary information with the summary information of the configuration files in other computing nodes in the high-performance computing cluster except the main computing node to obtain an information comparison result; The file synchronization module is used to synchronize the latest configuration file to the other computing nodes in the high-performance computing cluster except the main computing node if the information comparison result shows that the latest summary information is inconsistent with the summary information of the configuration files in the other computing nodes in the high-performance computing cluster.
9. An electronic device, characterized in that: The method comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the configuration file synchronization method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the configuration file synchronization method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Configuration service method and device for control and service nodes
CN104601366A
Cluster file system based configuration file synchronization method and management host
CN106844681A
Configuration consistency verification method, system and device for large-scale cluster
CN114048206A
Cited By
Data synchronization method and device in cluster system, equipment, medium and product
CN119420769A
