CN116185764A - Distributed database inspection method and device, electronic equipment and storage medium - Google Patents

Distributed database inspection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116185764A
CN116185764A CN202211733114.8A CN202211733114A CN116185764A CN 116185764 A CN116185764 A CN 116185764A CN 202211733114 A CN202211733114 A CN 202211733114A CN 116185764 A CN116185764 A CN 116185764A
Authority
CN
China
Prior art keywords
inspection
node
log
information
patrol
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
CN202211733114.8A
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.)
Jinzhuan Xinke Co Ltd
Original Assignee
Jinzhuan Xinke 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 Jinzhuan Xinke Co Ltd filed Critical Jinzhuan Xinke Co Ltd
Priority to CN202211733114.8A priority Critical patent/CN116185764A/en
Publication of CN116185764A publication Critical patent/CN116185764A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Abstract

The invention discloses a routing inspection method and device for a distributed database, electronic equipment and a storage medium, and belongs to the technical field of databases. Wherein the method comprises the following steps: obtaining a patrol script corresponding to each component under a distributed database, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components; issuing the inspection script to each child node through the master control node, and executing an inspection task according to the inspection script under the child node to obtain inspection information; and storing the inspection information into inspection log files corresponding to the child nodes. The invention solves the technical problem that the distributed database cannot meet the inspection under multi-node, multi-component and high-concurrency application scenes in the related technology.

Description

Distributed database inspection method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of databases, in particular to a distributed database inspection method, a distributed database inspection device, electronic equipment and a storage medium.
Background
The distributed database is used as a core bottom layer part of financial industry business, which has important influence on whether the financial business can be normally operated, so the requirement on the normal operation of the database is extremely high. However, because of the diversity and complexity of application scenarios, it is becoming increasingly important to be able to throttle database problems to a sprouted state. The database inspection tool can acquire the state information and the process information of the database, store the state information and the process information into an inspection file, obtain inspection data by accessing the inspection file, and determine an inspection result according to the inspection data.
The existing database inspection tool only aims at a target database to collect some database information and operating system information, and cannot meet the multi-node, multi-component and high-concurrency application scene of a distributed database.
In view of the above problems in the related art, no effective solution has been found yet.
Disclosure of Invention
The invention provides a routing inspection method, a routing inspection device, electronic equipment and a storage medium for a distributed database, which are used for solving the technical problem that the routing inspection method, the routing inspection device, the electronic equipment and the storage medium for the distributed database cannot meet the multi-node, multi-component and high-concurrency application scenes of the distributed database in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for inspecting a distributed database, including: obtaining a patrol script corresponding to each component under a distributed database, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components; issuing the inspection script to each child node through the master control node, and executing an inspection task according to the inspection script under the child node to obtain inspection information; and storing the inspection information into inspection log files corresponding to the child nodes.
Further, executing the inspection task according to the inspection script under the child node, and obtaining the inspection information includes: acquiring a patrol item configuration file; and controlling the inspection script under the child node to inspect the inspection item information of each component according to the inspection configuration items in the inspection item configuration file.
Further, after storing the inspection information in the inspection log file corresponding to each child node, the method further includes: obtaining patrol log files corresponding to all the child nodes through channels between the master node and the child nodes; summarizing the inspection log file under the master control node to obtain a summarized log; and analyzing the running states of all the child nodes according to the summary log, and performing abnormality diagnosis on the running states of all the child nodes.
Further, executing the inspection task according to the inspection script under the child node, and obtaining the inspection information includes: acquiring a patrol period of the child node; summarizing the patrol log information of the child node in the patrol period; dividing the inspection log information into a normal state information log and an abnormal state information log, wherein the normal state information log and the abnormal state information log are used as inspection information.
Further, after dividing the patrol log information into an information log of a normal state and an information log of an abnormal state, the method includes: acquiring a configuration threshold value in a patrol item configuration file; calculating an abnormal grade corresponding to the information log of the abnormal state according to the configuration threshold; and associating the information log of the abnormal state into a field corresponding to the abnormal level.
Further, issuing the inspection script to each child node through the master node includes: detecting whether a new child node exists in the distributed database; if the new child node exists, comparing file differences among the inspection files of all child nodes by adopting an incremental capacity expansion command, and determining the new child node without deploying the inspection script based on the file differences; and issuing the inspection script to the new child node through the master node.
Further, the method further comprises: acquiring an upgrade configuration file and an upgrade code command of the upgrade configuration file; and upgrading the current configuration file and the current database code of the distributed database by adopting the upgrade configuration file and the upgrade code command.
According to another aspect of the embodiments of the present application, there is also provided a patrol apparatus for a distributed database, including: the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring a patrol script corresponding to each component under a distributed database, the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components; the routing inspection module is used for issuing the routing inspection script to each child node through the master control node, and executing routing inspection tasks according to the routing inspection script under the child nodes to obtain routing inspection information; and the storage module is used for storing the inspection information into inspection log files corresponding to the child nodes.
Further, the inspection module comprises a first inspection unit for acquiring an inspection item configuration file; and controlling the inspection script under the child node to inspect the inspection item information of each component according to the inspection configuration items in the inspection item configuration file.
Further, the inspection device of the distributed database further comprises a summarizing module, wherein the summarizing module is used for obtaining inspection log files corresponding to all the child nodes through channels between the master control node and all the child nodes; summarizing the inspection log file under the master control node to obtain a summarized log; and analyzing the running states of all the child nodes according to the summary log, and performing abnormality diagnosis on the running states of all the child nodes.
Further, the inspection module further comprises a second inspection unit, which is used for obtaining the inspection period of the child node; summarizing the patrol log information of the child node in the patrol period; dividing the inspection log information into a normal state information log and an abnormal state information log, wherein the normal state information log and the abnormal state information log are used as inspection information.
Further, the inspection module further comprises a grading unit for acquiring a configuration threshold value in the inspection item configuration file; calculating an abnormal grade corresponding to the information log of the abnormal state according to the configuration threshold; and associating the information log of the abnormal state into a field corresponding to the abnormal level.
Further, the inspection module further comprises a third inspection unit for detecting whether a new child node exists in the distributed database; if the new child node exists, comparing file differences among the inspection files of all child nodes by adopting an incremental capacity expansion command, and determining the new child node without deploying the inspection script based on the file differences; and issuing the inspection script to the new child node through the master node.
Further, the inspection device of the distributed database further comprises an upgrade module, which is used for obtaining an upgrade configuration file and an upgrade code command of the upgrade configuration file; and upgrading the current configuration file and the current database code of the distributed database by adopting the upgrade configuration file and the upgrade code command.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that performs the steps described above when running.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; and a processor for executing the steps of the method by running a program stored on the memory.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the above method.
According to the invention, the inspection script corresponding to each component under the distributed database is obtained, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components; issuing a patrol script to each child node through the master control node, and executing a patrol task according to the patrol script under the child node to obtain patrol information; and storing the inspection information into inspection log files corresponding to the child nodes. The inspection items at the bottom layer are adapted to different inspection fields according to different components, so that the multi-node, multi-component and high-concurrency application scene of the distributed database can be met.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a block diagram of the hardware architecture of a computer according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of patrol of a distributed database according to an embodiment of the invention;
FIG. 3 is a specific usage flow of the distributed database inspection diagnosis script in an application scenario according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an actual application scenario of a distributed database inspection diagnosis script according to an embodiment of the present invention;
fig. 5 is a block diagram of a distributed database inspection apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method embodiment provided in the first embodiment of the present application may be executed in a mobile phone, a computer, a tablet or a similar computing device. Taking a computer as an example, fig. 1 is a block diagram of a hardware structure of a computer according to an embodiment of the present invention. As shown in fig. 1, the computer may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is merely illustrative and is not intended to limit the configuration of the computer described above. For example, the computer may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a video dynamic and static rate identifying method in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to the computer via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communications provider of a computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for inspecting a distributed database is provided, and fig. 2 is a flowchart of a method for inspecting a distributed database according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S10, a patrol script corresponding to each component under a distributed database is obtained, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components;
step S20, the routing inspection script is issued to each child node through the master control node, and routing inspection tasks are executed according to the routing inspection script under the child nodes, so that routing inspection information is obtained;
and step S30, storing the inspection information into inspection log files corresponding to the child nodes.
The inspection method of the embodiment can be used for inspecting and diagnosing nodes of different components under a distributed database, wherein the distributed database comprises a master node and a plurality of sub-nodes, and each node comprises a plurality of functional components, and the functional components comprise a database db, a computing node cn, a management node manager and the like as shown in fig. 4. In this embodiment, a distributed database inspection diagnostic tool may be downloaded at a master control node, where the tool includes a master control script, an inspection item configuration file and an inspection script that are independent of each component, and obtains an inspection script corresponding to each component under the distributed database, and issues the inspection script and the inspection item configuration file corresponding to each component to each child node through the master control script in the master control node, where the inspection script periodically executes an inspection task under each child node, and the inspection script prints inspection result information to an inspection log file corresponding to a current date, so as to facilitate subsequent inspection of the inspection result information. The access mode between the master node and the child node is mainly through an agent interface, and the access mode based on the agent interface can be used under the conditions of secret free and non-secret free. To adapt to use in various different scenarios, scripts also provide scp (secure copy) and sftp (SSH File Transfer Protocol, secure file transfer protocol) modes as interaction channels. The scp uses the scp instruction transmission file of the machine, so that the speed is high, but only a root encryption-free scene is supported; sftp is the SFTPClient using paramiko for file transfer, which is slow, but supports two modes, secret-free and username-password. Three interactive channel modes can select configuration in configuration files under the master control node.
Through the steps, the inspection script corresponding to each component under the distributed database is obtained, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components; issuing a patrol script to each child node through the master control node, and executing a patrol task according to the patrol script under the child node to obtain patrol information; and storing the inspection information into inspection log files corresponding to the child nodes. The inspection items at the bottom layer are adapted to different inspection fields according to different components, so that inspection under the application scene of multiple nodes, multiple components and high concurrency of the distributed database can be met.
In this embodiment, executing the inspection task according to the inspection script under the child node, and obtaining the inspection information includes:
step 21, acquiring a patrol item configuration file;
and 22, controlling the inspection script under the child node to inspect the inspection item information of each component according to the inspection configuration items in the inspection item configuration file.
The method comprises the steps of obtaining a patrol item configuration file, and controlling a patrol script under a child node to patrol the patrol item information of each component according to the patrol item in the patrol item configuration file, wherein the patrol item configuration file mainly comprises a main process configuration file, threshold configuration of a patrol diagnosis script and forbidden script configuration. Specifically, the configuration items in the main process configuration file mainly include a database manager omm user, IP, password, ssh (Secure Shell protocol) port, and version number. And the interaction modes of the master control node and each node comprise scp, sftp and a agent channel mode. Wherein the agent channel uses agent agents under the distributed database to interact. The agent, scp or sftp mode can be selected according to the specific application scene. In order to meet the flexible requirement of a multi-component high concurrency scene, timeout limitation and concurrency number configuration are also provided, time-based requirements are met for inspection diagnosis, different timeout limitation can be set for time delays of different user environments, different CPU core numbers can be set for different user environments according to the CPU core numbers which can be provided for inspection diagnosis scripts, and the implementation can be adapted to different machine configurations of different clients through a set of concurrency number calculation model, so that inspection diagnosis application under the high concurrency scene is realized.
Threshold configuration of inspection diagnosis script: the configuration file of the diagnostic script is divided into different segments by component name. The configuration items mainly comprise version numbers, users, passwords, a minitor log and a storage duration of a check log; the local field is configured for the main control process, and the configuration items comprise log paths, log storage time length of diag and the like; the configuration items of the os field are mainly some related parameters of cpu use, disk use rate and speed, and whitelist and inspection period of ommagent inspection; under zk field are queue number, response time, and use threshold of memory and cpu; the inspection items under monitor include network flow, network packet loss rate, different network state, server connection number, number of scanned network pages per second and use states of CPU and disk; while the configuration items under other functional components are custom-fit according to their own functions. All threshold class configurations have two threshold configurations, c_ and w_, corresponding to the log levels of the critical level (severe alert level) and the warning level (alert level). The configuration items in the forbidden script configuration file are whether to forbidden configuration of a monitor script or a check script under each component.
In this embodiment, after storing the patrol information in the patrol log file corresponding to each child node, the method further includes:
step A, obtaining a patrol log file corresponding to each sub-node through a channel between the master node and each sub-node;
step B, summarizing the inspection log files under the master control node to obtain summarized logs;
and C, analyzing the running states of all the child nodes according to the summary log, and performing abnormality diagnosis on the running states of all the child nodes.
The channel between the master control node and each sub-node comprises an interaction channel of one of agent, scp or sftp, the master control node obtains the inspection log files corresponding to each sub-node, the inspection log files are summarized under the master control node to obtain a summarized log, the running state of each sub-node is analyzed according to the summarized log, and the running state of each sub-node is subjected to abnormal diagnosis. When diagnosis operation is carried out, the diagnosis operation of the master control script is only needed to be carried out on the master control node where the master control script is located through an interface, the master control script can acquire the inspection log files under each child node through the agent channels of each component, the files are summarized under the master control node, the state of each node can be analyzed according to the summarized log, the key information in the summarized log is extracted and converted into an unintelligible operation state description through the professional diagnosis operation, the method is directly matched with the operation state description from a method library, and then expert advice is provided, so that a health degree report is obtained.
In this embodiment, executing the inspection task according to the inspection script under the child node, and obtaining the inspection information includes:
step D, obtaining the inspection period of the child node;
step E, summarizing the patrol log information of the child node in the patrol period;
and F, dividing the inspection log information into a normal state information log and an abnormal state information log, wherein the normal state information log and the abnormal state information log are used as inspection information.
Designating a component type, a node cluster and a patrol period by using a diag command through a master control script, wherein the setting mode of designating the patrol period comprises setting a starting time point and a terminating time point of the patrol period under a during command, for example, adding a time interval in a standard format in a form of 2010-10-09 19:00:00-2020-10-10:10:19:00'; or adding a time length in the form of 30min (1 hour 2day2 week) under the second before command, and acquiring a time interval from the current time to the time before the specified time length as a patrol period. After the diagnosis command is executed, the master control script gathers the inspection log information in the inspection period under the designated child node to the master control node, and generates a normal good state file and an abnormal error state file, wherein the inside of the good state file is an information log of the normal state of each index; inside the error state file is an information log of each index abnormal state.
In this embodiment, after dividing the patrol log information into an information log of a normal state and an information log of an abnormal state, the method includes:
step H, acquiring a configuration threshold value in a patrol item configuration file;
step I, calculating an abnormal grade corresponding to the information log of the abnormal state according to the configuration threshold;
and step J, associating the information log of the abnormal state into a field corresponding to the abnormal level.
The configuration threshold value in the inspection item configuration file is obtained, the abnormal grade corresponding to the information log of the abnormal state is calculated according to the configuration threshold value, the information log of the abnormal state is associated to the field of the corresponding abnormal grade, the abnormal error state file is divided into log sections of different abnormal grades, the log sections can be divided into a serious warning critical grade and a warning grade in the embodiment, and the abnormal state information reaching the corresponding threshold value is respectively divided into the lower part of the field of the corresponding grade according to the threshold value configured in the inspection item configuration file, so that a user can conveniently check and locate the abnormal log.
In this embodiment, issuing the inspection script to each child node through the master node includes:
step K, detecting whether a new child node exists in the distributed database;
step L, if the new child node exists, comparing file differences among the inspection files of all child nodes by adopting an incremental capacity expansion command, and determining the new child node without deploying the inspection script based on the file differences;
and M, issuing the inspection script to the new child node through the master node.
In the scene that the existing nodes in the distributed database are all deployed with the patrol script, if a user performs capacity-increasing and capacity-expanding operation, when a new plurality of nodes are added, the newly added child nodes are not deployed with the patrol script, and at the moment, the patrol script is deployed under the newly added child nodes, and cannot be deployed again in batches. The incremental capacity expansion function is to solve the problem, and by using an incremental capacity expansion command, scripts can automatically compare differences among inspection files among all nodes, and then the inspection scripts are deployed under the nodes where the inspection scripts are not deployed.
In this embodiment, the functional interface implemented by the inspection diagnostic tool includes: deployment, starting inspection, stopping inspection, diagnosis, incremental capacity expansion, version information acquisition, upgrading of configuration files, upgrading codes, unloading and disabling. All of the above operations may bring up object information, component type dimensions and cluster (cluster) dimensions, or intersections of component type dimensions with cluster dimensions, e.g., a component under a certain cluster, if not with up-dimension parameters, all by default. The upgrade configuration file and the upgrade code comprise: acquiring an upgrade configuration file and an upgrade code command of the upgrade configuration file; and upgrading the current configuration file and the current database code of the distributed database by adopting the upgrade configuration file and the upgrade code command. When the inspection diagnostic tool needs to be upgraded, the configuration file, the code and the log file in the tool are all emptied after being directly unloaded, and the log file possibly contains important information, so that in order to avoid deleting the log file, commands for upgrading the configuration file unpdate_config and the upgrading code update_script are provided, and the configuration file and the code can be independently upgraded by using the two commands. Stopping inspection: in order to meet the stop detection requirement of some users in a specific scene, a stop command interface is provided, the component type dimension and the cluster dimension are specified, and the inspection activities under the specified nodes are stopped. Version information is acquired: each version of inspection diagnostic tool has a version number as an identification, and the version number of the target inspection diagnostic tool can be acquired by using a version command corresponding to the version number of the distributed database, so that the help is provided for the updating of the follow-up inspection diagnostic tool. Unloading: by using the universal command through the master control script, the inspection process, the inspection configuration file, the code and the log on the user under all the distributed databases can be deleted, and only the file on the master control is reserved.
In this embodiment, the built-in process of the distributed database inspection diagnosis script includes a daemon process, a sub-server and a process of an inspection task. The inspection task process is to execute the issued specific inspection task; the sub-server side mainly functions in receiving tasks issued by the master control and transmitting information; the daemon is used for daemon each sub-inspection task under each user and clearing the log files beyond the preservation range according to the log preservation time and the space configured in the configuration file. Metadata batch inspection tool: when the inspection task is carried out, the inspection tool is started, and comparison and check are carried out according to the logic relation generated by the service scene and the relation between the data fields in the database table to check whether the logic relation is consistent with the relation.
The specific use flow of this embodiment is as follows: as shown in fig. 3, the tool pack is first downloaded onto the current master management node. Configuration files for configuring the host process: configuration of the master process's configuration files under the master node requires configuration omm (components for providing data for use by the visualization interface) of the user, IP, password, ssh port, version number, master node interaction with each node, and timeout limit and concurrency number settings. Deploying a patrol script on a specified cluster and component by using an install command, wherein the cluster is a child node in the embodiment: and designating the component type dimension and the cluster dimension through the instruction under the master control node where the master control script is located, and deploying the patrol files on each designated child node in batches. Starting a patrol script through a start command: and designating the component type dimension and the cluster dimension by using a start command through the master control script, starting the inspection script under each designated node, enabling the inspection script to periodically execute the inspection task, and summarizing the inspection result into the corresponding log file. Executing a diagnosis command to diagnose the inspection information in a specified time range (inspection period) on a specified cluster and a component, and summarizing the diagnosis report: and obtaining a summary inspection log of the inspection period and the assembly after the diagnosis operation is performed. At this time, health check may also be performed to obtain a health report. The embodiment obtains the progress of the health report by performing professional diagnosis on the distributed database inspection result, achieves the effects of inspecting and diagnosing in a high concurrency environment and obtaining a intelligible diagnosis report, provides professional problem processing suggestions according to the diagnosis result, saves the diagnosis time and the labor consumption in the scene of excessive nodes, and improves the inspection diagnosis efficiency.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
Example 2
In this embodiment, a routing inspection device for a distributed database is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a block diagram of a distributed database inspection apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes: an acquisition module 60, a patrol module 61, a storage module 62, wherein,
the acquiring module 60 is configured to acquire a patrol script corresponding to each component under a distributed database, where the distributed database includes a master node and a plurality of child nodes, and each node includes a plurality of functional components;
the inspection module 61 is configured to issue the inspection script to each child node through the master control node, and execute an inspection task according to the inspection script under the child node to obtain inspection information;
and the storage module 62 is configured to store the routing inspection information into routing inspection log files corresponding to the child nodes.
Optionally, the inspection module includes a first inspection unit, configured to obtain an inspection item configuration file; and controlling the inspection script under the child node to inspect the inspection item information of each component according to the inspection configuration items in the inspection item configuration file.
Optionally, the inspection device of the distributed database further includes a summarizing module, configured to obtain inspection log files corresponding to each child node through a channel between the master node and each child node; summarizing the inspection log file under the master control node to obtain a summarized log; and analyzing the running states of all the child nodes according to the summary log, and performing abnormality diagnosis on the running states of all the child nodes.
Optionally, the inspection module further includes a second inspection unit, configured to obtain an inspection period of the child node; summarizing the patrol log information of the child node in the patrol period; dividing the inspection log information into a normal state information log and an abnormal state information log, wherein the normal state information log and the abnormal state information log are used as inspection information.
Optionally, the inspection module further includes a grading unit, configured to obtain a configuration threshold in the inspection item configuration file; calculating an abnormal grade corresponding to the information log of the abnormal state according to the configuration threshold; and associating the information log of the abnormal state into a field corresponding to the abnormal level.
Optionally, the inspection module further includes a third inspection unit, configured to detect whether a new child node exists in the distributed database; if the new child node exists, comparing file differences among the inspection files of all child nodes by adopting an incremental capacity expansion command, and determining the new child node without deploying the inspection script based on the file differences; and issuing the inspection script to the new child node through the master node.
Optionally, the inspection device of the distributed database further comprises an upgrade module, which is used for obtaining an upgrade configuration file and an upgrade code command of the upgrade configuration file; and upgrading the current configuration file and the current database code of the distributed database by adopting the upgrade configuration file and the upgrade code command.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Example 3
An embodiment of the invention also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, acquiring a patrol script corresponding to each component under a distributed database, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components;
s2, issuing the inspection script to each child node through the master control node, and executing an inspection task according to the inspection script under the child node to obtain inspection information;
and S3, storing the inspection information into inspection log files corresponding to the child nodes.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring a patrol script corresponding to each component under a distributed database, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components;
s2, issuing the inspection script to each child node through the master control node, and executing an inspection task according to the inspection script under the child node to obtain inspection information;
and S3, storing the inspection information into inspection log files corresponding to the child nodes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for inspecting a distributed database, the method comprising:
obtaining a patrol script corresponding to each component under a distributed database, wherein the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components;
issuing the inspection script to each child node through the master control node, and executing an inspection task according to the inspection script under the child node to obtain inspection information;
and storing the inspection information into inspection log files corresponding to the child nodes.
2. The method of claim 1, wherein performing the patrol task according to the patrol script under the child node, obtaining the patrol information comprises:
acquiring a patrol item configuration file;
and controlling the inspection script under the child node to inspect the inspection item information of each component according to the inspection configuration items in the inspection item configuration file.
3. The method of claim 1, wherein after storing the patrol information in a patrol log file corresponding to each of the child nodes, the method further comprises:
obtaining patrol log files corresponding to all the child nodes through channels between the master node and the child nodes;
summarizing the inspection log file under the master control node to obtain a summarized log;
and analyzing the running states of all the child nodes according to the summary log, and performing abnormality diagnosis on the running states of all the child nodes.
4. The method of claim 1, wherein performing the patrol task according to the patrol script under the child node, obtaining the patrol information comprises:
acquiring a patrol period of the child node;
summarizing the patrol log information of the child node in the patrol period;
dividing the inspection log information into a normal state information log and an abnormal state information log, wherein the normal state information log and the abnormal state information log are used as inspection information.
5. The method according to claim 4, wherein after dividing the patrol log information into an information log of a normal state and an information log of an abnormal state, the method comprises:
acquiring a configuration threshold value in a patrol item configuration file;
calculating an abnormal grade corresponding to the information log of the abnormal state according to the configuration threshold;
and associating the information log of the abnormal state into a field corresponding to the abnormal level.
6. The method of claim 1, wherein issuing the inspection script to each of the child nodes through the master node comprises:
detecting whether a new child node exists in the distributed database;
if the new child node exists, comparing file differences among the inspection files of all child nodes by adopting an incremental capacity expansion command, and determining the new child node without deploying the inspection script based on the file differences;
and issuing the inspection script to the new child node through the master node.
7. The method according to claim 1, wherein the method further comprises:
acquiring an upgrade configuration file and an upgrade code command of the upgrade configuration file;
and upgrading the current configuration file and the current database code of the distributed database by adopting the upgrade configuration file and the upgrade code command.
8. A distributed database inspection device, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring a patrol script corresponding to each component under a distributed database, the distributed database comprises a master control node and a plurality of sub-nodes, and each node comprises a plurality of functional components;
the routing inspection module is used for issuing the routing inspection script to each child node through the master control node, and executing routing inspection tasks according to the routing inspection script under the child nodes to obtain routing inspection information;
and the storage module is used for storing the inspection information into inspection log files corresponding to the child nodes.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
a memory for storing a computer program;
a processor for executing the method steps of any one of claims 1 to 7 by running a program stored on a memory.
10. A storage medium comprising a stored program, wherein the program when run performs the method steps of any of the preceding claims 1 to 7.
CN202211733114.8A 2022-12-30 2022-12-30 Distributed database inspection method and device, electronic equipment and storage medium Pending CN116185764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211733114.8A CN116185764A (en) 2022-12-30 2022-12-30 Distributed database inspection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211733114.8A CN116185764A (en) 2022-12-30 2022-12-30 Distributed database inspection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116185764A true CN116185764A (en) 2023-05-30

Family

ID=86443548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211733114.8A Pending CN116185764A (en) 2022-12-30 2022-12-30 Distributed database inspection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116185764A (en)

Similar Documents

Publication Publication Date Title
US11815991B2 (en) Systems and methods to reprogram mobile devices including a cross-matrix controller to port connection
CN111124850A (en) MQTT server performance testing method, system, computer equipment and storage medium
CN105357038B (en) Monitor the method and system of cluster virtual machine
TWI450103B (en) Remote management systems and methods for servers, and computer program products thereof
CN104360878B (en) A kind of method and device of application software deployment
WO2021029856A1 (en) Network connectivity performance determination on computing devices
CN114328102B (en) Equipment state monitoring method, equipment state monitoring device, equipment and computer readable storage medium
CN111625383B (en) Process exception event processing method and device, electronic equipment and storage medium
US11438249B2 (en) Cluster management method, apparatus and system
CN111400127B (en) Service log monitoring method and device, storage medium and computer equipment
CN111625419B (en) Log acquisition method, system, equipment and computer readable storage medium
CN103530193A (en) Method and device used for adjusting application process
CN103544095A (en) Server program monitoring method and system of server program
CN111045893A (en) Method, device and system for executing monitoring task, storage medium and electronic device
CN105843675B (en) Thread exit method and device
CN113885971A (en) State management method and device based on self-adaptive platform system
CN113852426A (en) Remote testing method, device and system
CN111859139A (en) Application program recommendation method and device, computing equipment and medium
CN116185764A (en) Distributed database inspection method and device, electronic equipment and storage medium
CN100421381C (en) Method and device for obtaining information of operation and failure state for network equipment
CN114124727B (en) Network management communication pressure testing method and system
CN113282308A (en) Mirror image construction method and device, storage medium and electronic device
CN113722211A (en) BMC (baseboard management controller) debugging method, device and system and embedded equipment
CN111694752A (en) Application testing method, electronic device and storage medium
CN117349127B (en) GPU card-falling detection method and device

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