Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for managing a graph database cluster, which can manage and monitor a plurality of sets of graph database cluster environments, including obtaining system resources related to a graph database server node device and business information of a graph database, obtaining alarm information through analysis, and executing related operations for server nodes, thereby improving efficiency of maintaining the graph database cluster and reducing management cost of the graph database cluster.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of managing a cluster of databases, comprising: obtaining operation indexes of graph database server nodes contained in one or more graph database clusters; analyzing the operation index, and generating alarm information containing the operation index and information of a corresponding graph database server node when the operation index indicates that the index is abnormal; and correspondingly executing the operation on the graph database server node according to the alarm information.
Optionally, the method of managing clusters of graph databases,
the operation index includes resource usage information of the graph database server node and service information of a graph database operated based on the graph database server node.
Optionally, the method of managing clusters of graph databases,
the index abnormality comprises that the index indicated by the resource use information does not meet a preset threshold range or/and a log file recording the service information of the graph database comprises a keyword indicating the service abnormality.
Optionally, the method of managing clusters of graph databases,
the executing the corresponding operations on the graph database server nodes comprises adding the graph database server nodes, deleting the graph database server nodes, and executing the operations on software running on the graph database server nodes.
Optionally, the method of managing clusters of graph databases,
displaying the operation index, the warning information and an instruction entry for executing the operation of the graph database server node by a graphical interface; and sending the alarm information to a client.
To achieve the above object, according to a second aspect of an embodiment of the present invention, there is provided an apparatus for managing a cluster of databases, comprising: the system comprises an operation index acquisition module, an operation index analysis module and an operation execution module; the operation index acquisition module is used for acquiring operation indexes of graph database server nodes contained in one or more graph database clusters; the operation index analysis module is used for analyzing the operation index, and when the operation index indicates that the index is abnormal, generating alarm information containing the operation index and information of a corresponding graph database server node; and the operation execution module is used for correspondingly executing the operation on the graph database server node according to the alarm information.
Optionally, the apparatus for managing clusters of graph databases,
the operation index includes resource usage information of the graph database server node and service information of a graph database operated based on the graph database server node.
Optionally, the apparatus for managing clusters of graph databases,
the index abnormality comprises that the index indicated by the resource use information does not meet a preset threshold range or/and a log file recording the service information of the graph database comprises a keyword indicating the service abnormality.
Optionally, the apparatus for managing clusters of graph databases,
the executing the corresponding operations on the graph database server nodes comprises adding the graph database server nodes, deleting the graph database server nodes, and executing the operations on software running on the graph database server nodes.
Optionally, the apparatus for managing clusters of graph databases,
displaying the operation index, the warning information and an instruction entry for executing the operation of the graph database server node by a graphical interface; and sending the alarm information to a client.
To achieve the above object, according to a third aspect of the embodiments of the present invention, there is provided an electronic device, which is an optional management apparatus for a graph database cluster, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method as optionally described above in any of the methods of managing a cluster of databases.
To achieve the above object, according to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a method as in any one of the above methods of view management graph database clustering.
One embodiment of the above invention has the following advantages or benefits: obtaining operation indexes of graph database server nodes contained in one or more graph database clusters; analyzing the operation index, and generating alarm information containing the operation index and information of a corresponding graph database server node when the operation index indicates that the index is abnormal; and correspondingly executing the operation on the graph database server node according to the alarm information. Therefore, the embodiment can manage and monitor the environment of a plurality of sets of graph database clusters, and comprises the steps of obtaining system resources related to graph database server node equipment and business information of the graph database, obtaining alarm information through analysis, and executing related operations aiming at the server nodes, so that the efficiency of maintaining the graph database clusters is improved, and the management cost of the graph database clusters is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in FIG. 1, an embodiment of the present invention provides a method of managing clusters of graph databases, which may include the steps of:
step S101: the method comprises the steps of obtaining operation indexes of graph database server nodes contained in one or more graph database clusters.
Further, the operation index includes resource usage information of the graph database server node and service information of a graph database operated based on the graph database server node.
Specifically, the resource usage information of the graph database server node includes system resource information of a server node running graph database services, for example, memory usage rate of the graph database server node, usage rate of a central processing unit, storage space remaining amount, disk read-write rate throughput, network load indexes and the like, and the service information of the graph database run by the graph database server node includes graph database-based service information including graph database-related services such as data processing service running duration, data transmission service duration, graph database-based service state of the PageRank algorithm, data storage amount and the like; furthermore, the graph database cluster usually has a high availability mechanism to ensure high availability of the graph database, and is generally realized by using a mode of mutual backup of nodes, and if a host fails, service is automatically switched to a standby machine; the service information of the graph database also includes services processed in the process of realizing high availability of the graph database, such as a main/standby switching service, a main/standby data synchronization service, and the like, namely, the functions of monitoring and managing are realized by acquiring such services.
The invention does not limit the specific contents of the system resource information of the server node and the service information of the graph database.
Further, the operation index of the included graph database server node can be obtained through the following method:
the first method comprises the following steps: acquiring running indexes at regular time intervals by using a predefined script and predefined time intervals, acquiring system resource information of a server node, acquiring index data such as memory utilization rate, storage utilization rate, central processing unit utilization rate, process state and the like through a query instruction, and storing the acquired data; for example, in a linux system, a top-bn 1-i-c instruction is utilized to obtain information related to a central processing unit so as to determine the utilization rate of the central processing unit; the invention does not limit the type of the operating system operated by the server node; further, the predefined script can be used for acquiring a log file containing the service information of the graph database according to a predefined time interval; and the predefined script may be modified by the web-based application and the predefined metric data displayed.
The second method comprises the following steps: the method comprises the steps of obtaining the included operation indexes of the graph database server nodes by using software, generating a log file of the operation indexes by collecting system resource information of the monitoring server nodes and service information of the graph database by the software for further analysis, wherein the software can use programming languages such as java and Python, and the like.
It can be understood that after the operation indexes of the graph database server nodes in the graph database cluster are obtained, information is classified and summarized based on the operation indexes, and further the operation indexes of the whole cluster can be obtained;
step S102: and analyzing the operation index, and generating alarm information containing the operation index and information of the corresponding graph database server node when the operation index indicates that the index is abnormal.
Further, the index abnormality includes that the index indicated by the resource usage information does not meet a preset threshold range or/and a log file recording the service information of the graph database includes a keyword indicating a service abnormality.
Analyzing the operation index comprises analyzing resource use information and service information of a graph database, specifically, when the index indicated by the resource use information does not meet a preset threshold range, marking the index as abnormal, for example, setting the highest threshold of the memory use rate to be 90%, and when the obtained value of the memory use rate is higher than 90%, marking the index and information of a corresponding graph database server node; it is understood that the preset threshold range may be a value or an interval, and the preset threshold is variable according to different cluster environments; further, determining a keyword indicating that the service is abnormal from a log file recording service information of a graph database, for example, first automatically determining whether the service of the graph database is normal, searching a corresponding log file containing the service information of the graph database according to specific service information, and performing keyword search on a text of the log file by using a full-text search technology, for example, the predefined keyword includes: the term "ERROR", "WARN", "INFO", etc., where ERROR represents abnormal service information, and when ERROR is found, the service information and the graph database to which the service information belongs and the nodes of the graph database to which the graph database belongs are marked. The invention does not limit the range of the preset threshold value and the specific content of the keyword indicating the abnormal service.
Step S103: and correspondingly executing the operation on the graph database server node according to the alarm information.
Specifically, according to alarm information, including abnormal alarm information of resource use information or/and alarm information of business information of a graph database, correspondingly executing operation on the graph database server node; for example, when the memory usage rate of a graph database node is monitored to be higher than a threshold value, a process or an application occupying an abnormal memory amount is analyzed and determined, and a corresponding operation is executed, for example, an instruction for ending the process or the application is executed. When the alarm reason of the graph database service information is detected to be the problem of the software version of the graph database, the upgrading or patching operation of the related software of the graph database server node is executed; further, when the alarm information indicates that graph database server nodes need to be added or deleted because of resources, the operations of adding the graph database server nodes and deleting the graph database server nodes in the graph database cluster are carried out.
Namely, the executing the corresponding operation on the graph database server node comprises adding the graph database server node, deleting the graph database server node, and executing the operation on the software running on the graph database server node.
Further, displaying the operation index, the warning information and an instruction entry for executing the operation of the graph database server node by a graphical interface; and sending the alarm information to a client.
Specifically, the operation index and the alarm information are displayed by a graphical interface, and there are two methods:
the first method comprises the following steps: the method comprises the steps that acquired resource use information of graph database server nodes and business information of graph databases running on the basis of the graph database server nodes are led into a visualization tool Grafana of monitoring indexes and displayed through an interface of a visual graph; for the alarm information, the alarm information can be displayed in the interface by a special marking method, for example, marking by different colors;
the second method comprises the following steps: the method comprises the steps that acquired resource use information of graph database server nodes and business information of graph databases operated on the basis of the graph database server nodes are imported into application based on a webpage, and when a user accesses the webpage, operation indexes and interfaces displayed by an interface of a visual graph are obtained; for the alarm information, the alarm information can be displayed in the interface by a special marking method, for example, different windows are used for summarizing and displaying;
further, the operations described in step S102 may be performed through an interface for managing clusters of graph databases. In particular, the graphical interface further comprises an instruction entry for performing said operations of said graph database server node. For example, by clicking a button on an interface, a corresponding predefined operation is performed.
As shown in fig. 3, the display interface for the operation index is a plurality of interfaces in a hierarchical level, and the content displayed differs according to the hierarchy, as shown in fig. 3, some operation indexes in the cluster level are displayed, for example, the central processing unit utilization rate, that is, the value of the CPU utilization rate and the value summary in a period of time; meanwhile, the total number of the server nodes contained in the graph database cluster is realized through the example interface, and obviously, the interface of the specific operation index value of each server node in the graph database cluster can be obtained through the operation related to the interface;
displaying the operation index, the alarm information and an instruction entry for executing the operation of the graph database server node by a graphical interface;
the present invention does not limit the software, tools, or content and form of the display of the graphical interface.
Further, there are two methods for sending the alarm information to the client:
the first method comprises the following steps: and connecting the short message gateway to the graph database cluster system, and sending alarm information to one or more specified mobile phones for receiving the short messages through the short message gateway when the alarm information is generated.
The second method comprises the following steps: and connecting a call center in the graph database cluster system, and dialing voice calls to one or more specified mobile phones through the call center when the alarm information is generated.
It can be understood that the above two methods are preferably used for the warning related to timeliness, and the warning information can also be sent to the client through the instant application; the present invention does not limit the kind of the instant application and the specific type of the client.
As shown in fig. 2, an exemplary process for managing a graph database cluster according to an embodiment of the present invention includes the following steps:
step S201: and obtaining an operation index.
Specifically, as shown in fig. 2, the management graph database cluster unit obtains operation indexes of graph database nodes included in a graph database cluster from a plurality of graph database clusters, that is, obtains operation indexes of graph database server nodes included in one or more graph database clusters; further, the operation index includes resource usage information of the graph database server node and service information of a graph database operated based on the graph database server node.
The method for obtaining the operation index is consistent with the description in step S101, and is not described herein again.
Step S202: a graph database cluster management unit.
Specifically, the operation index is analyzed based on the operation index obtained in step S201, that is, the operation index is analyzed, and when the operation index indicates that the index is abnormal, warning information including the operation index and information of a corresponding graph database server node is generated;
and correspondingly executing the operation on the graph database server node according to the alarm information. Further, the operation index, the warning information, and an instruction entry for performing the operation of the graph database server node are displayed with a graphical interface.
The description about the index abnormality, the warning information, and the execution of the operation on the graph database server node is the same as the description in step S102 to step S103, and is not repeated here.
The graph database cluster management unit can be deployed in a dedicated server device, for example, a monitoring management machine, and the graph database cluster management unit included in the monitoring management machine can remotely access one or more graph database clusters through a communication protocol, for example, an HTTP protocol; the graph database cluster management unit can also be deployed in node equipment of a graph database server included in a graph database cluster.
Step S203: and sending the alarm information to the client.
Specifically, based on the steps S201-S202, generating alarm information and sending the alarm information to the client; the description of the method for sending information to the client is consistent with the related contents in S103, and is not repeated herein.
As shown in fig. 4, an embodiment of the present invention provides anapparatus 400 for managing graph database clusters, comprising: an operationindex obtaining module 401, an operationindex analyzing module 402 and anoperation executing module 403; the operationindex obtaining module 401 is configured to obtain operation indexes of graph database server nodes included in one or more graph database clusters; the operationindex analysis module 402 is configured to analyze the operation index, and when the operation index indicates that the index is abnormal, generate warning information that includes the operation index and information of a corresponding graph database server node; theoperation executing module 403 is configured to correspondingly execute an operation on the graph database server node according to the warning information.
Optionally, the operationindex obtaining module 401 includes that the operation index includes resource usage information of the graph database server node and service information of a graph database operated based on the graph database server node.
Optionally, the operationindex analysis module 402 includes that the index abnormality includes that the index indicated by the resource usage information does not meet a preset threshold range or/and a log file recording service information of the graph database includes a keyword indicating a service abnormality.
Optionally, theoperation executing module 403 is configured to execute corresponding operations on the graph database server nodes, including adding the graph database server nodes, deleting the graph database server nodes, and executing operations on software running on the graph database server nodes.
Optionally, the device for managing a graph database cluster is configured to display, by using a graphical interface, the operation index, the warning information, and an instruction entry for executing the operation of the graph database server node; and sending the alarm information to a client.
An embodiment of the present invention further provides an electronic device for managing a graph database cluster, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method provided by any one of the above embodiments.
Embodiments of the present invention further provide a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method provided in any of the above embodiments.
FIG. 5 illustrates anexemplary system architecture 500 for a method of managing a graph database cluster or an apparatus for managing a graph database cluster to which embodiments of the present invention may be applied.
As shown in fig. 5, thesystem architecture 500 may includeterminal devices 501, 502, 503, anetwork 504, and aserver 505. Thenetwork 504 serves to provide a medium for communication links between theterminal devices 501, 502, 503 and theserver 505.Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use theterminal devices 501, 502, 503 to interact with aserver 505 over anetwork 504 to receive or send messages or the like. Theterminal devices 501, 502, 503 may have various communication client applications installed thereon, such as a web browser application, a search application, an instant messaging tool, a mailbox client, and the like.
Theterminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Theserver 505 may be a server providing various services, such as a background management server providing support for a website containing database cluster operation indexes browsed by a user using theterminal devices 501, 502, and 503. The background management server can acquire the operation indexes of the graph database server nodes contained in the graph database cluster, perform processing such as analysis and the like, and feed back the processing results to the terminal equipment.
It should be noted that the method for managing a database cluster provided by the embodiment of the present invention is generally executed by theserver 505, and accordingly, the apparatus for managing a database cluster is generally disposed in theserver 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of acomputer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, thecomputer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from astorage section 608 into a Random Access Memory (RAM) 603. In theRAM 603, various programs and data necessary for the operation of thesystem 600 are also stored. TheCPU 601,ROM 602, andRAM 603 are connected to each other via abus 604. An input/output (I/O)interface 605 is also connected tobus 604.
The following components are connected to the I/O interface 605: aninput portion 606 including a keyboard, a mouse, and the like; anoutput portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage section 608 including a hard disk and the like; and acommunication section 609 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 609 performs communication processing via a network such as the internet. Thedriver 610 is also connected to the I/O interface 605 as needed. Aremovable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 610 as necessary, so that a computer program read out therefrom is mounted in thestorage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through thecommunication section 609, and/or installed from theremovable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units described in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware. The described modules and/or units may also be provided in a processor, and may be described as: an apparatus for managing clusters of graph databases, comprising: the system comprises an operation index acquisition module, an operation index analysis module and an operation execution module. The names of these modules do not form a limitation to the modules themselves in some cases, and for example, the operation execution module may also be described as a "module that executes an operation on a graph database server node in a graph database cluster according to warning information".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: obtaining operation indexes of graph database server nodes contained in one or more graph database clusters; analyzing the operation index, and generating alarm information containing the operation index and information of a corresponding graph database server node when the operation index indicates that the index is abnormal; and correspondingly executing the operation on the graph database server node according to the alarm information.
According to the technical scheme of the embodiment of the invention, a plurality of sets of database cluster environments can be managed and monitored, the system resources related to the database server node equipment and the service information of the database are obtained, the alarm information is obtained through analysis, and the related operation aiming at the server node is executed, so that the efficiency of maintaining the database cluster is improved, and the management cost of the database cluster is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.