CN115001974A - Cluster system consistency detection method, device, system, equipment and storage medium - Google Patents

Cluster system consistency detection method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN115001974A
CN115001974A CN202210552329.3A CN202210552329A CN115001974A CN 115001974 A CN115001974 A CN 115001974A CN 202210552329 A CN202210552329 A CN 202210552329A CN 115001974 A CN115001974 A CN 115001974A
Authority
CN
China
Prior art keywords
cluster
server node
identification code
server
unique identification
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.)
Pending
Application number
CN202210552329.3A
Other languages
Chinese (zh)
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.)
China Telecom Digital Intelligence Technology Co Ltd
Original Assignee
China Telecom Digital Intelligence 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 China Telecom Digital Intelligence Technology Co Ltd filed Critical China Telecom Digital Intelligence Technology Co Ltd
Priority to CN202210552329.3A priority Critical patent/CN115001974A/en
Publication of CN115001974A publication Critical patent/CN115001974A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/08Configuration management of networks or network elements
    • H04L41/0866Checking the configuration
    • H04L41/0869Validating the configuration within one network element
    • 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
    • H04L67/303Terminal profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a device, a system, equipment and a storage medium for detecting the consistency of a cluster system, which relate to the technical field of intelligent operation and maintenance of an IT system, and the method for detecting the consistency of the cluster system comprises the following steps: acquiring remote access parameters of each server node in a cluster; based on the remote access parameters, accessing each server node in the cluster to acquire an identification code of a configuration file of each server node in the cluster; acquiring a unique identification code of a standard configuration file of each server node in a cluster; and comparing the identification code of each server node in the cluster with the unique identification code, and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server nodes in the cluster are abnormal or not. The invention can realize the consistency detection of each server node in the cluster and the update of abnormal server nodes.

Description

Cluster system consistency detection method, device, system, equipment and storage medium
Technical Field
The invention relates to the technical field of IT system intelligent operation and maintenance, in particular to a cluster system consistency detection method, a device, a system, equipment and a storage medium.
Background
The cluster refers to the same service, and is deployed on a plurality of servers, that is, the working contents and working processes of the plurality of servers are completely the same, so as to achieve higher working efficiency.
In the prior art, when a service system is deployed by a cluster, all node systems of a cluster server need to be kept consistent, so that the cluster service system operates normally. However, each server node in the cluster occasionally changes in operation, which causes the server node to be inconsistent with other server nodes in the cluster, thereby affecting the normal operation of the service system.
Disclosure of Invention
The invention provides a method, a device, a system, equipment and a storage medium for detecting the consistency of a cluster system, which are used for solving the defect of inconsistency of all server nodes in a cluster in the prior art and realizing the consistency detection of all the server nodes in the cluster and the updating of abnormal server nodes.
The invention provides a method for detecting consistency of a cluster system, which comprises the following steps:
acquiring remote access parameters of each server node in a cluster;
accessing each server node in the cluster based on the remote access parameters to acquire an identification code of a configuration file of each server node in the cluster, wherein the identification code is dynamically generated based on the configuration file, and the configuration file comprises a system file and/or a file related to an application program of each server node in the cluster;
acquiring a unique identification code of a standard configuration file of each server node in a cluster, wherein the unique identification code is generated based on the standard configuration file, the standard configuration file comprises a system file and/or a file related to an application program, which are/is arranged in each server node in the cluster when each server node in the cluster is initialized, and the standard configuration file is kept uniform when each server node in the cluster is initialized and configured;
and comparing the identification code of each server node in the cluster with the unique identification code, and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server nodes in the cluster are abnormal or not.
According to the method for detecting the consistency of the cluster system provided by the invention, the step of comparing the identification code of each server node in the cluster with the unique identification code and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server node in the cluster is abnormal or not, comprises the following steps:
comparing the identification code of each server node in the cluster with the unique identification code;
if the identification code of the server node is consistent with the unique identification code, judging that the system state of the corresponding server node is normal;
and if the identification code of the server node is inconsistent with the unique identification code, judging that the system state of the corresponding server node is abnormal.
According to the method for detecting the consistency of the cluster system provided by the invention, the identification code of each server node in the cluster is compared with the unique identification code, and the system state of each server node in the cluster is judged based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server node in the cluster is abnormal or not, and the method further comprises the following steps:
and under the condition that the system state of the server node is abnormal, sending an update message to the corresponding server node, wherein the update message is used for informing the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster.
According to the method for detecting the consistency of the cluster system provided by the invention, the accessing each server node in the cluster based on the remote access parameter to obtain the identification code of the configuration file of each server node in the cluster comprises the following steps:
and based on the remote access parameters, accessing each server node in the cluster based on a secure Shell protocol (SSH) method, and acquiring the identification code of the configuration file of each server node in the cluster.
According to the cluster system consistency detection method provided by the invention, the remote access parameters comprise: IP address, port number, user name, password.
The invention also provides a device for detecting the consistency of the cluster system, which comprises:
the first information acquisition module is used for acquiring remote access parameters of each server node in the cluster;
the second information acquisition module is used for accessing each server node in the cluster based on the remote access parameters and acquiring the identification code of the configuration file of each server node in the cluster, wherein the identification code is dynamically generated based on the configuration file, and the configuration file comprises the system file and/or the file related to the application program of each server node in the cluster;
the third information acquisition module is used for acquiring a unique identification code of a standard configuration file of each server node in the cluster, wherein the unique identification code is generated based on the standard configuration file, the standard configuration file comprises a system file and/or a file related to an application program, which are/is arranged in each server node in the cluster when each server node in the cluster is initialized, and the standard configuration file is kept uniform when each server node in the cluster is initialized and configured;
and the consistency detection module is used for comparing the identification code of each server node in the cluster with the unique identification code and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server nodes in the cluster are abnormal or not.
The device for detecting the consistency of the cluster system provided by the invention further comprises:
and the message notification module is used for sending an update message to the corresponding server node under the condition that the system state of the server node is abnormal, wherein the update message is used for notifying the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster.
The invention also provides a system for detecting the consistency of the cluster system, which comprises:
the cluster comprises a plurality of server nodes, configuration files are arranged on the server nodes, the configuration files comprise system files and/or files related to application programs, and each server node dynamically generates an identification code based on the configuration files;
the system consistency detection node is used for installing and deploying the cluster system consistency detection device, wherein the system consistency detection node is in communication connection with each server node in a cluster, and the cluster system consistency detection of each server node in the cluster is realized based on the cluster system consistency detection device;
and the database is used for storing the remote access parameters, the identification codes and the unique identification codes of all the server nodes in the cluster and the system states of all the server nodes in the cluster, and is in communication connection with the system consistency detection node.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the cluster system consistency detection method.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a cluster system consistency detection method as described in any of the above.
According to the cluster system consistency detection method, device, system, equipment and storage medium provided by the invention, the identification code of the configuration file of each server node is obtained through the remote access parameter of each server node in the cluster, and the change condition of the configuration file of each server node in the cluster is detected in real time based on the comparison result of the identification code and the unique identification code obtained based on the standard configuration file, so that the change condition of the system state of each server node in the cluster is reflected in real time, the detection timeliness and expandability are improved, the whole detection method is automatically realized, and the workload of operation and maintenance personnel is greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a cluster system consistency detection method provided by the present invention;
FIG. 2 is a schematic flow chart of an example of a cluster system consistency detection method provided by the present invention;
fig. 3 is a schematic structural diagram of a device for detecting consistency of a cluster system provided in the present invention;
FIG. 4 is a schematic structural diagram of a cluster system consistency detection system provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. 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.
The cluster system consistency detection method of the present invention is described below with reference to fig. 1-2.
Fig. 1 is a schematic flowchart of a method for detecting consistency of a cluster system provided in the present invention, and as shown in fig. 1, the method includes:
step 110, obtaining remote access parameters of each server node in the cluster 301, where the remote access parameters are used as remote access parameters when each server node in the cluster 301 is remotely accessed.
TABLE 1 remote Access parameters Table
IP address Port number User name Cipher code
10.203.4.22 80 user1 duhsg11@o
10.203.4.23 80 user2 dkd982#Ⅱ
10.203.4.24 8080 user3 76*j23&o
10.203.4.25 23 user4 halg12@uu
Optionally, as shown in table 1, the remote access parameter may be stored in a table form in the database 303, as can be seen from table 1, the cluster 301 includes a plurality of server nodes, and the specific number of the server nodes in table 1 is 4, while in practical applications, the number of the server nodes in the cluster 301 may be configured according to practical needs, which is not limited in the present invention, and the remote access parameter is represented by four fields in table 1, and includes: IP address, port number, user name, password, meaning that each field represents is as follows:
IP address: IP addresses representing server nodes in cluster 301;
port number: representing an access port number;
user name: a username for remote access;
password: the password corresponding to the user name.
Through the above access information, it is possible to remotely connect and access the respective server nodes in the cluster 301.
It should be noted that table 1 only shows one form of table storage of the database 303 by way of example, and the present invention is not limited to the form of table 1, and the above-mentioned information of each field may also be stored by associating a plurality of tables. In addition, it should be noted that the above-mentioned storage form of the remote access parameter includes, but is not limited to, via the database 303, and may also be stored via other forms, such as a disk file or other forms.
Step 120, accessing each server node in the cluster 301 based on the remote access parameter, and acquiring an identification code of a configuration file of each server node in the cluster 301, where the identification code is dynamically generated based on the configuration file, and the configuration file includes a system file and/or a file related to an application program of each server node in the cluster 301.
Specifically, there are multiple server nodes in the cluster 301, and the work content and the work process of the multiple server nodes are completely the same. In order to ensure the normal operation of the cluster 301 service, the server nodes need to be consistent. However, the individual server nodes occasionally change and are inconsistent with other server nodes, thereby affecting the normal operation of the entire cluster 301.
In order to ensure that each server node in the cluster 301 is consistent, each server node is remotely connected based on the remote access parameter, and the identification code of the configuration file of each server node in the cluster 301 is acquired and used for identifying whether the configuration file is abnormal or not, so that whether the corresponding server node is abnormal or not is reflected.
Optionally, the method for acquiring the identification code includes:
based on the remote access parameter, each server node in the cluster 301 is accessed based on a Secure Shell (SSH) method, and the identification code of the configuration file of each server node in the cluster 301 is acquired.
Optionally, the access method of each server node in the cluster 301 includes, but is not limited to: a multi-threaded polling method and a single-threaded polling method.
Optionally, the manner of remotely accessing each server node in the cluster 301 includes, but is not limited to: the SSH method, which optionally includes an IP address, a port number, a user name, and a password, implements remote connection and access to each server node in the cluster 301 by using the stored remote access parameters, based on the SSH interaction-free method, to obtain a configuration file of a host corresponding to each server node of the cluster 301 and an identification code of the configuration file, and updates the identification code of a host field corresponding to each server node of the cluster 301.
Optionally, the identification code includes, but is not limited to, MD5 code, for example, other types of identification codes for indicating whether the configuration files of the respective server nodes in the cluster 301 change may also be generated through a plurality of file encryption algorithms, so that the cluster system consistency detection method provided by the present invention has a plurality of embodiments and is well scalable.
Step 130, acquiring a unique identification code of a preset standard configuration file of each server node in the cluster 301. The unique identification code is generated based on a standard configuration file, the standard configuration file includes a system file and/or a file related to an application program, which are/is set in each server node in the cluster 301 when each server node in the cluster 301 is initialized, and the standard configuration file is kept uniform when each server node in the cluster 301 is initialized and configured.
Optionally, the obtained standard configuration file and the unique identification code are stored in the database 303, and/or stored in a disk file or other form.
It should be noted that the standard configuration file in step 130 is uniformly deployed and uniformly configured when initializing each server node in the cluster 301, and is therefore referred to as a standard configuration file. Then, during the operation of each server node in the cluster, the system files and/or application-related files of each server node may change, that is, the standard configuration files dynamically change along with the operation of the cluster. Thus, once the cluster initialization is complete, the dynamically changing profile may no longer be in the same state as the initialization, and the original standard profile becomes the profile during the post-initialization cluster operation in step 120.
Step 140, comparing the identification code of each server node in the cluster 301 with the unique identification code, and determining the system state of each server node in the cluster 301 based on the comparison result between the identification code of each server node in the cluster 301 and the unique identification code, where the system state is used to indicate whether the server node in the cluster 301 is abnormal.
Optionally, the step 140 of the cluster system consistency detection method further includes:
comparing the identification code of each server node in the cluster 301 with the unique identification code;
if the identification code of the server node is consistent with the unique identification code, judging that the system state of the corresponding server node is normal;
and if the identification code of the server node is inconsistent with the unique identification code, judging that the system state of the corresponding server node is abnormal.
Optionally, after step 140, the method for detecting consistency of a cluster system further includes:
under the condition that the system state of the server node is abnormal, an update message may also be sent to the corresponding server node, where the update message is used to notify the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of the other server nodes in the cluster 301.
Alternatively, the system status may use "1" to indicate that the system is normal and "0" to indicate that the system is abnormal.
Optionally, the system of each server node in the cluster 301 includes but is not limited to: linux system, Windows system.
Exemplarily, taking MD5 code as an example, fig. 2 is an exemplary flowchart of the cluster system consistency detection method provided by the present invention, as shown in fig. 2.
Firstly, the IP address, the port number, the user name and the password of each server node of the cluster 301 are all stored in a remote access parameter list of the database 303 in advance and used as remote access parameters of each server node in the cluster;
meanwhile, on each server node of the cluster 301, based on a standard configuration file (a system file and/or an application program-related file) when each server node is initially configured, a unique MD5 code of the standard configuration file is generated, and the unique MD5 code is stored, for example, in the database 303;
then, the cluster 301 starts to work, and in the working process, each server node dynamically generates an MD5 code based on the current configuration file;
under the condition of starting the cluster system consistency detection method, the detection process comprises the following steps:
based on a multithread polling method and an SSH interaction-free method, the IP address, the port number, the user name and the password in the obtained remote access parameter list are used as remote access parameters to remotely connect each server node of the cluster 301;
acquiring MD5 codes dynamically generated by each server node of the cluster 301 based on system files and/or application program files, and updating the MD5 codes to MD5 codes associated with host fields corresponding to each server node of the cluster 301 in the database 303;
comparing the dynamically generated MD5 code with the unique MD5 code to detect whether the configuration file of each server node of the cluster 301 is abnormal, if so, indicating that the corresponding server node in the cluster 301 is normal, updating the system state field value of the corresponding server node in the remote access parameter list to be 1, if not, indicating that the corresponding server node in the cluster 301 is abnormal, updating the system state field value of the corresponding server node in the remote access parameter list to be 0, and simultaneously sending an update message to the abnormal server node to update the configuration file and the MD5 code of the abnormal server node. The updated remote access parameter list is shown in table 2.
Table 2 updated remote access parameter list
Figure BDA0003655394230000101
According to the cluster system consistency detection method provided by the invention, the identification code of the configuration file of each server node in the cluster 301 is obtained through the remote access parameter of each server node in the cluster 301, and the change condition of the configuration file of each server node in the cluster 301 is detected in real time based on the comparison result of the identification code and the unique identification code obtained based on the standard configuration file, so that the change condition of the system state of each server node in the cluster 301 is reflected in real time, the detection timeliness and expandability are improved, the whole detection method is automatically realized, and the workload of operation and maintenance personnel is greatly reduced.
The following describes the consistency detection apparatus for a cluster system according to the present invention, and the consistency detection apparatus for a cluster system described below and the consistency detection method for a cluster system described above may be referred to in a corresponding manner.
Fig. 3 is a schematic structural diagram of the device for detecting consistency of a cluster system provided in the present invention, and as shown in fig. 3, the device 200 for detecting consistency of a cluster system includes: a first information acquisition module 201, a second information acquisition module 202, a third information acquisition module 203, and a consistency detection module 204, wherein:
the first information acquisition module 201 is configured to acquire a remote access parameter of each server node in the cluster 301, where the remote access parameter is used as a remote access parameter when each server node in the cluster 301 is remotely accessed;
the second information obtaining module 202 is configured to obtain, based on the remote access parameter, an identification code of a configuration file of each server node in the cluster 301, where the identification code is dynamically generated based on the configuration file, and the configuration file is used to represent a system file and/or a file related to an application program of each server node in the cluster 301;
the third information obtaining module 203 is configured to obtain a unique identification code of a preset standard configuration file of each server node in the cluster 301, where the unique identification code is generated based on the standard configuration file, the standard configuration file is used to represent a system file and/or a file related to an application program of each server node in the cluster 301 when each server node in the cluster 301 is initialized, and the standard configuration file is unified when each server node in the cluster 301 is initialized and configured;
the consistency detection module 204 is configured to compare the identification code of each server node in the cluster 301 with the unique identification code, and determine a system state of each server node in the cluster 301 based on a comparison result between the identification code of each server node in the cluster 301 and the unique identification code, where the system state is used to indicate whether the server node in the cluster 301 is abnormal.
Optionally, the apparatus 200 further includes a message notification module 205, wherein:
the message notification module 205 is configured to send an update message to a corresponding server node when the system state of the server node is abnormal, where the update message is used to notify the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster 301.
According to the cluster system consistency detection device provided by the invention, the remote access parameters of each server node in the cluster 301 are acquired by the first information acquisition module 201, each server node is remotely accessed by the second information acquisition module 202, the identification code of the configuration file of each server node is acquired, the change condition of the configuration file of each server node in the cluster 301 is detected in real time by the consistency detection module 204 based on the comparison result of the identification code and the unique identification code acquired by the third information acquisition module 203 based on the standard configuration file, so that the change condition of the system state of each server node in the cluster 301 is reflected in real time, the detection timeliness and expandability are improved, the whole detection method is automatically realized, and the workload of operation and maintenance personnel is greatly reduced.
Optionally, the first information obtaining module 201 is specifically configured to:
and acquiring remote access parameters, wherein the remote access parameters comprise an IP address, a port number, a user name and a password.
Optionally, the second information obtaining module 202 is specifically configured to:
based on the remote access parameters, each server node in the cluster 301 is accessed based on an SSH method, and the identification code of the configuration file of each server node in the cluster 301 is obtained.
Optionally, the consistency detection module 204 is specifically configured to:
comparing the identification code of each server node in the cluster 301 with the unique identification code;
if the identification code of the server node is consistent with the unique identification code, judging that the system state of the corresponding server node is normal;
and if the identification code of the server node is inconsistent with the unique identification code, judging that the system state of the corresponding server node is abnormal.
Optionally, the message notification module 205 is specifically configured to:
and under the condition that the system state of the server node is abnormal, sending an update message to the corresponding server node, wherein the update message is used for notifying the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster 301.
Fig. 4 is a schematic structural diagram of the consistency detection system of the cluster system provided in the present invention, and as shown in fig. 4, the consistency detection system 300 of the cluster system includes: cluster 301, system consistency detection node 302, and database 303, wherein:
the cluster 301 comprises a plurality of server nodes, the plurality of server nodes are provided with configuration files, the configuration files comprise system files and/or files related to application programs, and each server node dynamically generates an identification code based on the configuration files;
a system consistency detection node 302, configured to install and deploy the cluster system consistency detection apparatus, where the system consistency detection node 302 is in communication connection with each server node in the cluster 301, and implements cluster 301 system consistency detection on each server node in the cluster 301 based on the cluster system consistency detection apparatus;
and the database 303 is used for storing the remote access parameters, the identification codes and the unique identification codes of the server nodes in the cluster 301 and the system states of the server nodes in the cluster 301, and the database 303 is in communication connection with the system consistency detection node 302.
The cluster system consistency detection system provided by the invention acquires the identification code of the configuration file of each server node through the remote access parameters of each server node in the cluster 301, and detects the change condition of the configuration file of each server node in the cluster 301 in real time based on the comparison result of the identification code and the unique identification code acquired based on the standard configuration file, thereby reflecting the change condition of the system state of each server node in the cluster 301 in real time, improving the detection timeliness and expandability, realizing the whole detection method automatically, and greatly reducing the workload of operation and maintenance personnel.
Optionally, the system consistency detection node 302 may be deployed in the cluster 301, and together with each server node, form the cluster 301, and may also be deployed outside the cluster 301, and is independent from the cluster 301, and is in communication connection with each server node in the cluster 301, so as to implement consistency detection.
Optionally, the system consistency detection node 302 is specifically configured to:
comparing the identification code of each server node in the cluster 301 with the unique identification code;
if the identification code of the server node is consistent with the unique identification code, judging that the system state of the corresponding server node is normal;
and if the identification code of the server node is inconsistent with the unique identification code, judging that the system state of the corresponding server node is abnormal.
Optionally, the system consistency detection node 302 is specifically configured to:
and under the condition that the system state of the server node is abnormal, sending an update message to the corresponding server node, wherein the update message is used for notifying the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster 301.
Optionally, the system consistency detection node 302 is specifically configured to:
based on the remote access parameters, each server node in the cluster 301 is accessed based on an SSH method, and the identification code of the configuration file of each server node in the cluster 301 is obtained.
Optionally, the system consistency detection node 302 is specifically configured to:
obtaining remote access parameters, wherein the remote access parameters comprise: IP address, port number, user name, password.
Fig. 5 illustrates a physical structure diagram of an electronic device, and as shown in fig. 5, the electronic device 400 may include: a processor (processor)410, a communication Interface 420, a memory (memory)430 and a communication bus 440, wherein the processor 410, the communication Interface 420 and the memory 430 are communicated with each other via the communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform a cluster system consistency detection method comprising:
obtaining remote access parameters of each server node in the cluster 301, wherein the remote access parameters are used as remote access parameters when each server node in the cluster 301 is remotely accessed;
acquiring identification codes of configuration files of all server nodes in the cluster 301 based on the remote access parameters, wherein the identification codes are dynamically generated based on the configuration files, and the configuration files comprise system files and/or application program related files of all the server nodes in the cluster 301;
acquiring a unique identification code of a preset standard configuration file of each server node in the cluster 301, wherein the unique identification code is generated based on the standard configuration file, the standard configuration file comprises a system file and/or a file related to an application program, which are/is arranged in each server node in the cluster 301 when each server node in the cluster 301 is initialized, and the standard configuration file is kept uniform when each server node in the cluster 301 is initialized and configured;
the identification code of each server node in the cluster 301 is compared with the unique identification code, and the system state of each server node in the cluster 301 is determined based on the comparison result of the identification code of each server node in the cluster 301 and the unique identification code, wherein the system state is used for indicating whether the server node in the cluster 301 is abnormal or not.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, the computer can execute the cluster system consistency detection method provided by the above methods, and the method includes:
obtaining remote access parameters of each server node in the cluster 301, wherein the remote access parameters are used as remote access parameters when each server node in the cluster 301 is remotely accessed;
acquiring identification codes of configuration files of all server nodes in the cluster 301 based on the remote access parameters, wherein the identification codes are dynamically generated based on the configuration files, and the configuration files comprise system files and/or application program related files of all the server nodes in the cluster 301;
acquiring a unique identification code of a preset standard configuration file of each server node in the cluster 301, wherein the unique identification code is generated based on the standard configuration file, the standard configuration file comprises a system file and/or a file related to an application program, which are/is arranged in each server node in the cluster 301 when each server node in the cluster 301 is initialized, and the standard configuration file is kept uniform when each server node in the cluster 301 is initialized and configured;
the identification code of each server node in the cluster 301 is compared with the unique identification code, and the system state of each server node in the cluster 301 is determined based on the comparison result of the identification code of each server node in the cluster 301 and the unique identification code, wherein the system state is used for indicating whether the server node in the cluster 301 is abnormal or not.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor, implements a method for cluster system consistency detection provided by the above methods, the method comprising:
obtaining remote access parameters of each server node in the cluster 301, wherein the remote access parameters are used as remote access parameters when each server node in the cluster 301 is remotely accessed;
acquiring an identification code of a configuration file of each server node in the cluster 301 based on the remote access parameter, wherein the identification code is dynamically generated based on the configuration file, and the configuration file comprises a system file and/or a file related to an application program of each server node in the cluster 301;
acquiring a unique identification code of a preset standard configuration file of each server node in the cluster 301, wherein the unique identification code is generated based on the standard configuration file, the standard configuration file comprises a system file and/or a file related to an application program, which are/is arranged in each server node in the cluster 301 when each server node in the cluster 301 is initialized, and the standard configuration file is kept uniform when each server node in the cluster 301 is initialized;
the identification code of each server node in the cluster 301 is compared with the unique identification code, and the system state of each server node in the cluster 301 is determined based on the comparison result of the identification code of each server node in the cluster 301 and the unique identification code, wherein the system state is used for indicating whether the server node in the cluster 301 is abnormal or not.
The above-described embodiments of the apparatus are merely illustrative, and units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A cluster system consistency detection method is characterized by comprising the following steps:
acquiring remote access parameters of each server node in a cluster;
based on the remote access parameters, accessing each server node in the cluster to acquire an identification code of a configuration file of each server node in the cluster;
acquiring a unique identification code of a standard configuration file of each server node in a cluster;
and comparing the identification code of each server node in the cluster with the unique identification code, and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server nodes in the cluster are abnormal or not.
2. The method according to claim 1, wherein comparing the identification code of each server node in the cluster with the unique identification code, and determining a system status of each server node in the cluster based on a comparison result between the identification code of each server node in the cluster and the unique identification code, wherein the system status is used to indicate whether the server nodes in the cluster are abnormal, comprises:
comparing the identification code of each server node in the cluster with the unique identification code;
if the identification code of the server node is consistent with the unique identification code, judging that the system state of the corresponding server node is normal;
and if the identification code of the server node is inconsistent with the unique identification code, judging that the system state of the corresponding server node is abnormal.
3. The method according to claim 2, wherein the comparing the identification code of each server node in the cluster with the unique identification code, and determining a system status of each server node in the cluster based on a comparison result between the identification code of each server node in the cluster and the unique identification code, wherein the system status is used to indicate whether the server node in the cluster is abnormal, further comprises:
and under the condition that the system state of the server node is abnormal, sending an updating message to the corresponding server node, wherein the updating message is used for informing the server node with the abnormal system state to update the configuration file, so that the server node with the abnormal system state is consistent with the configuration files of other server nodes in the cluster.
4. The method according to claim 1, wherein the accessing each server node in the cluster based on the remote access parameter to obtain the identification code of the configuration file of each server node in the cluster comprises:
and based on the remote access parameters, accessing each server node in the cluster based on a secure Shell protocol (SSH) method, and acquiring the identification code of the configuration file of each server node in the cluster.
5. The method according to any of claims 1 to 4, wherein the remote access parameters comprise: IP address, port number, user name, password.
6. A device for detecting consistency of a cluster system is characterized by comprising:
the first information acquisition module is used for acquiring remote access parameters of each server node in the cluster;
the second information acquisition module is used for accessing each server node in the cluster based on the remote access parameters and acquiring the identification codes of the configuration files of each server node in the cluster;
the third information acquisition module is used for acquiring the unique identification code of the standard configuration file of each server node in the cluster;
and the consistency detection module is used for comparing the identification code of each server node in the cluster with the unique identification code and judging the system state of each server node in the cluster based on the comparison result of the identification code of each server node in the cluster and the unique identification code, wherein the system state is used for indicating whether the server nodes in the cluster are abnormal or not.
7. The device according to claim 6, further comprising:
and the message notification module is used for sending an update message to the corresponding server node under the condition that the system state of the server node is abnormal, wherein the update message is used for notifying the server node with the system state abnormality to update the configuration file, so that the server node with the system state abnormality is consistent with the configuration files of other server nodes in the cluster.
8. A cluster system consistency detection system, comprising:
the cluster comprises a plurality of server nodes, configuration files are arranged on the server nodes, the configuration files comprise system files, and each server node dynamically generates an identification code based on the configuration files;
the system consistency detection node is used for installing and deploying the cluster system consistency detection device as claimed in any one of claims 6 to 7, wherein the system consistency detection node is in communication connection with each server node in a cluster, and the cluster system consistency detection of each server node in the cluster is realized based on the cluster system consistency detection device.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the cluster system consistency detection method according to any one of claims 1 to 5 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the cluster system consistency detection method according to any one of claims 1 to 5.
CN202210552329.3A 2022-05-20 2022-05-20 Cluster system consistency detection method, device, system, equipment and storage medium Pending CN115001974A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210552329.3A CN115001974A (en) 2022-05-20 2022-05-20 Cluster system consistency detection method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210552329.3A CN115001974A (en) 2022-05-20 2022-05-20 Cluster system consistency detection method, device, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115001974A true CN115001974A (en) 2022-09-02

Family

ID=83027434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210552329.3A Pending CN115001974A (en) 2022-05-20 2022-05-20 Cluster system consistency detection method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115001974A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115801666A (en) * 2022-11-29 2023-03-14 中国建设银行股份有限公司 Transaction link switching method and device, electronic equipment and computer storage medium
CN116737641A (en) * 2023-06-26 2023-09-12 合芯科技有限公司 Connection device, four-way server, and initialization method and device of four-way server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108063675A (en) * 2016-11-08 2018-05-22 北京京东尚科信息技术有限公司 Detection method, detection device and the cluster configuration detecting system of cluster configuration
CN110825420A (en) * 2019-11-26 2020-02-21 中国银行股份有限公司 Configuration parameter updating method, device, equipment and storage medium for distributed cluster
CN111625252A (en) * 2020-04-23 2020-09-04 平安科技(深圳)有限公司 Cluster upgrading maintenance method and device, electronic equipment and storage medium
WO2021223471A1 (en) * 2020-05-08 2021-11-11 国云科技股份有限公司 Configuration file centralized management system, method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108063675A (en) * 2016-11-08 2018-05-22 北京京东尚科信息技术有限公司 Detection method, detection device and the cluster configuration detecting system of cluster configuration
CN110825420A (en) * 2019-11-26 2020-02-21 中国银行股份有限公司 Configuration parameter updating method, device, equipment and storage medium for distributed cluster
CN111625252A (en) * 2020-04-23 2020-09-04 平安科技(深圳)有限公司 Cluster upgrading maintenance method and device, electronic equipment and storage medium
WO2021223471A1 (en) * 2020-05-08 2021-11-11 国云科技股份有限公司 Configuration file centralized management system, method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
(美)RICHARDPETERSEN: "《Red Hat Linux技术大全》", 30 September 2001, 机械工业出版社, pages: 592 - 595 *
方晨: "《Dreamweaver MX 2004中文版实例教程》", 31 January 2006, 上海科学普及出版社, pages: 297 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115801666A (en) * 2022-11-29 2023-03-14 中国建设银行股份有限公司 Transaction link switching method and device, electronic equipment and computer storage medium
CN116737641A (en) * 2023-06-26 2023-09-12 合芯科技有限公司 Connection device, four-way server, and initialization method and device of four-way server

Similar Documents

Publication Publication Date Title
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN115001974A (en) Cluster system consistency detection method, device, system, equipment and storage medium
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN106533753B (en) Role configuration method and device of distributed system
CN107547565B (en) Network access authentication method and device
US20180302500A1 (en) Environment isolation method and device
CN111225064A (en) Ceph cluster deployment method, system, device and computer-readable storage medium
CN107423942B (en) Service transfer method and device
CN113055252B (en) Method, device, equipment and storage medium for detecting newly added service host
CN113347037B (en) Data center access method and device
JP2003233512A (en) Client monitoring system with maintenance function, monitoring server, program, and client monitoring/ maintaining method
CN114153705A (en) Data monitoring method and device based on configuration management database
CN108494749B (en) Method, device and equipment for disabling IP address and computer readable storage medium
US11258664B2 (en) System for provisioning racks autonomously in data centers
JP6885255B2 (en) Flow generation program, flow generation device and flow generation method
CN113922988B (en) Network-based host security policy detection method and system
US20130104215A1 (en) System and method for managing network devices
CN110188007B (en) Distributed data repair method, device, network node and storage medium
CN112214437A (en) Storage device, communication method and device and computer readable storage medium
CN111314384A (en) Terminal authentication method, device and equipment
CN107306202B (en) Network management method, server, client and system
CN112860708B (en) Data consistency restoration method, system, device and equipment
CN111478794B (en) Signaling message interaction method and device, terminal equipment and storage medium
CN115905271B (en) Virus library updating method and device and multi-engine detection system
CN115617917B (en) Method, device, system and equipment for controlling multiple activities of database cluster

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