Nothing Special   »   [go: up one dir, main page]

CN113010599A - MYSQL database group copy state monitoring method, device and system - Google Patents

MYSQL database group copy state monitoring method, device and system Download PDF

Info

Publication number
CN113010599A
CN113010599A CN201911317601.4A CN201911317601A CN113010599A CN 113010599 A CN113010599 A CN 113010599A CN 201911317601 A CN201911317601 A CN 201911317601A CN 113010599 A CN113010599 A CN 113010599A
Authority
CN
China
Prior art keywords
group replication
group
replication
state
node
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.)
Granted
Application number
CN201911317601.4A
Other languages
Chinese (zh)
Other versions
CN113010599B (en
Inventor
李燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Sichuan Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Sichuan Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Sichuan Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911317601.4A priority Critical patent/CN113010599B/en
Publication of CN113010599A publication Critical patent/CN113010599A/en
Application granted granted Critical
Publication of CN113010599B publication Critical patent/CN113010599B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种MYSQL数据库组复制状态监控方法、装置和系统,用以解决监控MYSQL数据库组复制状态不及时的问题。本实施例提供的方案对目标组复制节点的组复制状态进行及时监控,并在接收到组复制监控操作指令时对目标组复制节点执行相应的操作。由于本方案能自动查询MYSQL数据库组复制状态,并根据指令及时调整组复制状态,因此当MYSQL的数据库组复制状态出现异常时,通过本方案能实现及时监控,避免人工监控造成的修复慢的问题。

Figure 201911317601

The invention discloses a MYSQL database group replication state monitoring method, device and system, which are used to solve the problem of untimely monitoring of the MYSQL database group replication state. The solution provided by this embodiment monitors the group replication status of the target group replication node in time, and performs corresponding operations on the target group replication node when receiving the group replication monitoring operation instruction. Since this solution can automatically query the MYSQL database group replication status and adjust the group replication status in time according to the instructions, when the MYSQL database group replication status is abnormal, this solution can realize timely monitoring, avoiding the problem of slow repair caused by manual monitoring. .

Figure 201911317601

Description

MYSQL database group copy state monitoring method, device and system
Technical Field
The invention relates to the field of network management support, in particular to a method, a device and a system for monitoring the copy state of a MYSQL database group.
Background
MYSQL is a relational database management system, which is a relational database management system. MYSQL usually uses SQL language, which has small volume, fast speed and low total cost, and can be widely applied to WEB field.
In the process of implementing Network Function Virtualization (NFV) deployment software, mobile operators often need to use MYSQL database group replication. However, an exception may occur in the process of copying the database group by MYSQL, and the exception generally needs to be manually monitored, discovered and manually repaired, and needs to consume more manpower, so that the repair speed is slow.
How to timely and effectively monitor the copy state of the MYSQL database group is a technical problem to be solved by the application.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device and a system for monitoring the copy state of a MYSQL database group, which are used for solving the problem that the copy state of the MYSQL database group is not monitored timely.
In a first aspect, a method for monitoring a group replication state of a MYSQL database is provided, which is applied to a group replication node proxy apparatus, and includes:
receiving a group copy state query instruction issued by a group copy state monitoring device;
inquiring the group replication state of a target group replication node according to the group replication state inquiry instruction, wherein the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
feeding back the group replication state to the group replication state monitoring device to indicate the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal;
and when a group replication monitoring operation instruction issued by the group replication state monitoring device based on the group replication state is received, executing an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
In a second aspect, a method for monitoring a group replication state of a MYSQL database is provided, which is applied to a group replication state monitoring apparatus, and includes:
issuing a group replication state query instruction to a target group replication node agent device, wherein the group replication state query instruction is used for indicating the target group replication node agent device to query a group replication state of a target group replication node, and the target group replication node corresponds to the group replication node agent device and is used for performing group replication on a MYSQL database;
receiving a group replication state fed back by the target group replication node proxy device based on the group replication state query instruction, and judging whether the group replication state of the target group replication node is normal or not according to the group replication state through a preset rule;
and when the group replication state of the target group replication node is abnormal, issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node so as to instruct the target group replication node proxy device to execute an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
In a third aspect, a group replication node proxy apparatus is provided, including:
the first receiving module is used for receiving a group copy state query instruction issued by the group copy state monitoring device;
the first query module is used for querying the group replication state of a target group replication node according to the group replication state query instruction, wherein the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
the first feedback module feeds the group replication state back to the group replication state monitoring device to indicate the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal;
and the first execution module is used for executing the operation corresponding to the group copy monitoring operation instruction on the target group copy node when receiving the group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state.
In a fourth aspect, there is provided a group copy status monitoring apparatus, comprising:
the second sending module is used for issuing a group replication state query instruction to the target group replication node proxy device, wherein the group replication state query instruction is used for indicating the target group replication node proxy device to query the group replication state of the target group replication node, and the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
the second receiving module is used for receiving the group replication state fed back by the target group replication node proxy device based on the group replication state query instruction, and judging whether the group replication state of the target group replication node is normal or not according to the group replication state through a preset rule;
and the second control module is used for issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node when the group replication state of the target group replication node is abnormal so as to instruct the target group replication node proxy device to execute the operation corresponding to the group replication monitoring operation instruction on the target group replication node.
In a fifth aspect, a MYSQL database group replication status monitoring system is provided, which includes the group replication status monitoring apparatus of the fourth aspect and at least one group replication node agent apparatus of the third aspect communicatively connected to the group replication status monitoring apparatus through an external interface.
In a sixth aspect, an electronic device is provided, the electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method according to the first or second aspect.
In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method of the first or second aspect.
In the embodiment of the application, a group copy state query instruction issued by a group copy state monitoring device is received, then the group copy state of a target group copy node is queried according to the group copy state query instruction, then the group copy state is fed back to the group copy state monitoring device, and when a group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state is received, an operation corresponding to the group copy monitoring operation instruction is executed on the target group copy node. By the scheme provided by the embodiment, the group replication state of the target group replication node can be monitored in time, and corresponding operation is executed on the target group replication node when the group replication monitoring operation instruction is received. According to the scheme, the copy state of the MYSQL database group can be automatically inquired, and the copy state of the MYSQL database group can be adjusted in time according to the instruction, so that when the copy state of the MYSQL database group is abnormal, timely monitoring can be achieved through the scheme, and the problem that manual monitoring causes slow repair is avoided.
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 specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic diagram of a system for monitoring a copy status of a MYSQL database group provided in this embodiment;
fig. 2a is a schematic flow chart of a method for monitoring a copy status of a MYSQL database group according to this embodiment;
fig. 2b is a schematic diagram of a logical structure of a group replication node proxy apparatus according to this embodiment;
FIG. 3 is a second schematic flowchart of a method for monitoring the replication status of a MYSQL database group provided in this embodiment;
fig. 4 is a third schematic flowchart of a method for monitoring a copy status of a MYSQL database group according to this embodiment;
fig. 5a is a fourth schematic flowchart of a method for monitoring a copy status of a MYSQL database group according to this embodiment;
fig. 5b is a schematic diagram of a logic structure of a group copy status monitoring apparatus provided in this embodiment;
fig. 6 is a fifth flowchart illustrating a method for monitoring a copy status of a MYSQL database group according to this embodiment;
fig. 7 is a schematic structural diagram of a group replication node proxy apparatus according to this embodiment;
fig. 8 is a schematic structural diagram of a group copy status monitoring apparatus provided in this embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The reference numbers in the present application are only used for distinguishing the steps in the scheme and are not used for limiting the execution sequence of the steps, and the specific execution sequence is described in the specification.
The scheme provided by the embodiment can be applied to the MYSQL database and is used for monitoring the state of each group of copy nodes of the MYSQL database and adjusting abnormal nodes. The embodiment provides a MYSQL database group replication state monitoring method, a group replication node agent device, a group replication state monitoring device and a system.
Fig. 1 shows a schematic structural diagram of a MYSQL database group replication status monitoring system, and in the system provided in this embodiment, the system includes a group replication status monitoring apparatus and at least one group replication node proxy apparatus, which are communicatively connected through an external interface.
In practical application, the number of group replication node proxy devices in the system is related to the number of MYSQL database group replication members. In the system shown in fig. 1, one group replication state monitoring apparatus and three group replication node proxy apparatuses communicatively connected thereto are included. Each group replication node proxy device corresponds to one group replication node, namely, the group replication node proxy devices are respectively deployed at each node of database group replication, and each group replication node corresponds to one MYSQL database group replication member. The group replication status monitoring means may be provided outside the database group.
In the solution provided in this embodiment, the group replication state monitoring device performs data communication with each group replication node agent device, so as to obtain the state of the group replication node corresponding to each group replication node agent, and issue an instruction adjustment in time when the state of the group replication node is abnormal, thereby implementing monitoring on each group replication node, and further implementing monitoring on the MYSQL database group replication state.
The present embodiment provides a MYSQL database group replication state monitoring method applied to the group replication node proxy apparatus, as shown in fig. 2a, including the following steps:
s21: receiving a group copy state query instruction issued by a group copy state monitoring device;
s22: inquiring the group replication state of a target group replication node according to the group replication state inquiry instruction, wherein the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
s23: feeding back the group replication state to the group replication state monitoring device to indicate the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal;
s24: and when a group replication monitoring operation instruction issued by the group replication state monitoring device based on the group replication state is received, executing an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
A schematic structural diagram of the group replication node proxy apparatus described in this embodiment is shown in fig. 2b, and the group replication node proxy apparatus may be applied to a MYSQL database, and includes an external interface and an LUA virtual machine, where the external interface may be used to receive and transmit data, the group replication state query instruction may be received through the external interface, and the LUA virtual machine may be used to perform data processing, where the database proxy logic is implemented by LUA language, and the LUA virtual machine may further include other functional logics. For example, the external interface may be a rest (representational State transfer) access interface, which may be used to receive a set of copy State query instructions, which may be HTTP instructions.
In this embodiment, the external interface first parses the received HTTP command into a first message request and forwards the first message request to the LUA virtual machine for processing. The LUA virtual machine automatically loads the protocol adaptation logic LUA library of each service in advance according to the configuration so as to process the first message request subsequently. After preloading each protocol adaptation logic LUA library, the LUA virtual machine executes SQL statements in the corresponding MYSQL database, and the group replication state of the target group replication node can be obtained according to the result. In addition, the LUA virtual machine also provides connection database underlying protocol support for transforming LUA logic into database operations and responses.
An underlying protocol support module is also included in the group replication node proxy device and may be configured to provide an interface for the LUA virtual machine to access the MYSQL database, i.e., to enable the LUA business logic to interface with the MYSQL database SQL execution environment. Specifically, the underlying protocol support module can realize a toolkit for supporting LUA functions by a MYSQL database, such as character set transcoding, database connection management and the like. The bottom layer protocol support module can carry out classification control on SQL statements supported by the LUA virtual machine and provide related state response. In addition, the underlying protocol support module also supports interfacing with multiple MYSQL databases.
By the scheme provided by this embodiment, the group replication node agent device can feed back the group replication state of the target group replication node according to the group replication state query instruction issued by the group replication state monitoring device, and the group replication state can be used for the group replication state monitoring device to determine whether the group replication state of the target group replication node is normal, and issue a group replication monitoring operation instruction to adjust the group replication state of the target group replication node when the state is abnormal.
Preferably, step S22, querying the group replication status of the target group replication node according to the group replication status query instruction, as shown in fig. 3, includes the following steps:
s31: analyzing the group of the replication state query instruction to obtain a first message request;
s32: executing an SQL statement corresponding to the first message request on a target MYSQL database corresponding to the target group replication node according to the loaded service logic by the LUA virtual machine;
s33: and generating the group replication state of the target group replication node according to the response result of the target MYSQL database to the SQL statement.
The step S31 may be executed by the external interface, and the parsed first message request is sent to the LUA virtual machine by the external interface for processing. The first message request corresponds to a service, the LUA virtual machine executes SQL statements in the MYSQL database of the target node, and finally generates a group replication state of the target group replication node according to the response result.
By the scheme provided by the embodiment, the group replication state of the target group replication node can be queried in the MYSQL database through the LUA virtual machine, so that the generated group replication state corresponds to the actual state of the target group replication node.
Preferably, the group replication node agent device may be developed and implemented using LUA language, and generates the group replication state according to a result obtained by executing an SQL statement in the MYSQL database of the corresponding node. In the actual application process, the state codes of the nodes in various states can be predefined. For example, the group copy status code "1001" is defined in the state where the group copy node cannot access, such as failure to establish a connection, timeout to establish a connection, database not started, failure of query result, and so on. The offline state is handled in group replication at the group replication node, i.e., the database operates normally but is not added to the database group replication group, and a group replication state code "2001" is defined. When the group replication node is in the group replication group, but the group replication delay parameter is found to exceed the predetermined threshold value according to the executed SQL statement result, the group replication efficiency is judged to be seriously lagged, and a group replication status code '4001' is defined. After the state of the group replication node is determined, a group replication state can be generated according to a predefined group replication state code and fed back to the group replication state monitoring device.
Preferably, in step S24, when receiving a group copy monitoring operation instruction issued by the group copy status monitoring apparatus based on the group copy status, the method performs an operation corresponding to the group copy monitoring operation instruction on the target group copy node, as shown in fig. 4, and includes the following steps:
s41: analyzing the group of copy monitoring operation instructions to obtain a second message request;
s42: calling a service logic corresponding to the group of copy monitoring operation instructions through the LUA virtual machine;
s43: and executing the operation corresponding to the business logic on the target group replication node.
In this embodiment, the group copy monitoring operation instruction may be received through the external interface, and the second message request may be obtained through parsing. And then sending the second message request to the LUA virtual machine for data processing by the external interface, and calling the corresponding service logic by the LUA virtual machine to execute control operation on the target group replication node.
By the scheme provided by the embodiment, the group replication state of the target group replication node can be inquired, and the target group replication node is correspondingly adjusted when the group replication monitoring operation instruction is received. When the state of the target group copy node is abnormal, the abnormal state of the group copy node can be monitored in time through the scheme provided by the embodiment, the target group copy node is adjusted, the monitoring of the group copy state is realized, manual adjustment is not needed, and the abnormal state of the group copy node can be monitored in time and automatically adjusted.
In order to solve the problems in the prior art, the present embodiment provides a MYSQL database group replication state monitoring method applied to a group replication state monitoring apparatus, as shown in fig. 5a, including the following steps:
s51: issuing a group replication state query instruction to a target group replication node agent device, wherein the group replication state query instruction is used for indicating the target group replication node agent device to query a group replication state of a target group replication node, and the target group replication node corresponds to the group replication node agent device and is used for performing group replication on a MYSQL database;
s52: receiving a group replication state fed back by the target group replication node proxy device based on the group replication state query instruction, and judging whether the group replication state of the target group replication node is normal or not according to the group replication state through a preset rule;
s53: and when the group replication state of the target group replication node is abnormal, issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node so as to instruct the target group replication node proxy device to execute an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
As shown in fig. 5b, the group copy state monitoring apparatus according to this embodiment may be applied to a MYSQL database, and specifically may include an external interface and a LUA virtual machine, where the external interface may be a REST interface. The external interface may be configured to encapsulate an instruction generated by the LUA virtual machine as an HTTP message, and send the HTTP message to the target group replication node proxy apparatus. And when the external interface receives the group copy state fed back by the target group copy node proxy device, analyzing the group copy state and sending an analysis result to the LUA virtual machine for processing.
The LUA virtual machine loads a protocol adaptation logic LUA library of each service according to configuration in advance, and then the LUA virtual machine can generate a group replication state query instruction according to the configured information and further send the group replication state query instruction to each target group replication node agent device through an external interface. And for the group replication state fed back by the target group replication node proxy device, the LUA virtual machine judges whether the group replication state is normal according to a preset rule, and if the group replication state is abnormal, the LUA virtual machine sends a corresponding operation instruction to the target group replication node proxy device to adjust the target group replication node, so that the stability of the MYSQL database group replication state is ensured.
Preferably, the step S52, receiving the group replication state fed back by the target group replication node proxy apparatus based on the group replication state query instruction, and determining whether the group replication state of the target group replication node is normal according to the group replication state by using a preset rule, includes:
judging that the group replication state of the target group replication node is abnormal when the group replication state of the target group replication node meets at least one of the following conditions: the target group replication node is inaccessible, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node lags behind.
The group replication state of the target group replication node may be an inaccessible state, an offline state, and a group replication efficiency hysteresis state. When the group replication state of the target group replication node is abnormal, the MYSQL database group replication state is affected. The scheme provided by the embodiment can detect the abnormal state of the target group replication node in time so as to carry out targeted adjustment later.
Preferably, in step S53, when the group replication state of the target group replication node is abnormal, a group replication monitoring operation instruction is issued to the target group replication node proxy apparatus according to the group replication state of the target group replication node to instruct the target group replication node proxy apparatus to perform an operation corresponding to the group replication monitoring operation instruction on the target group replication node, including the following steps:
when the target group replication node cannot be accessed, issuing a group replication function starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to start a group replication function of the target group replication node;
when the target group replication node is in an off-line state, issuing a group replication starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group replication efficiency of the target group replication node lags, issuing a group replication suspension instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to suspend group replication.
In an actual application process, a group replication state code corresponding to a group replication node state may be predefined, and when the group replication state fed back by the target group replication node proxy apparatus includes a preset group replication state code, a state represented by the group replication state code may be determined according to a predefined rule. For example, when the received group copy status includes the group copy status code "1001", the group copy monitoring operation command issued to the target group copy node proxy apparatus may include an operation command to start a database, set a group copy parameter, and start a group copy function. When the received group copy status includes the group copy status code "2001", the group copy monitoring operation instruction issued to the target group copy node proxy apparatus may include an operation instruction to start a group copy function and the like. When the received group copy status includes the group copy status code "4001", the group copy monitoring operation command issued to the target group copy node proxy apparatus may include stopping the group copy function, sleeping for a certain time, and starting the group copy function.
By the scheme provided by the embodiment, the group replication state of the target group replication node can be inquired, and when the node is in an abnormal state, the group replication monitoring operation instruction is issued according to the actually occurring abnormal state so as to correct the abnormal state of the node, so that the overall stability of the replication state of the MYSQL database group is ensured.
Preferably, as shown in fig. 6, step S51, the issuing a group replication status query command to the target group replication node proxy apparatus includes:
s61: encapsulating a message generated by the LUA virtual machine into a group replication state query instruction, and sending the group replication state query instruction to a target group replication node agent device;
step S52, receiving the group replication status fed back by the target group replication node proxy apparatus based on the group replication status query instruction, includes:
s62: and analyzing the received group of copy states, and sending an analysis result to the LUA virtual machine.
The group replication state monitoring device may issue a group replication state query instruction to the target group replication node agent device according to a preset period. The message generated by the LUA virtual machine can be encapsulated into a group replication state query instruction by the external interface, and then the group replication state query instruction is sent to the target group replication node proxy device.
When the target group replication node proxy apparatus feeds back the group replication state, the external interface may receive and analyze the group replication state, and then send an analysis result to the LUA virtual machine, so that the LUA virtual machine determines whether the state of the target group replication node is abnormal according to the analysis result.
In order to solve the problems in the prior art, as shown in fig. 7, the present embodiment provides a group replication node proxy apparatus 70, including:
a first receiving module 71, configured to receive a group copy status query instruction issued by the group copy status monitoring apparatus;
a first query module 72, configured to query a group replication state of a target group replication node according to the group replication state query instruction, where the target group replication node corresponds to the group replication node proxy apparatus and is used to perform group replication on a MYSQL database;
a first feedback module 73, configured to feed back the group replication state to the group replication state monitoring apparatus, so as to instruct the group replication state monitoring apparatus to determine whether the group replication state of the target group replication node is normal;
a first executing module 74, configured to, when receiving a group copy monitoring operation instruction issued by the group copy state monitoring apparatus based on the group copy state, execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
Based on the group replication node proxy apparatus provided in the foregoing embodiment, preferably, the first query module 72 is configured to:
analyzing the group of the replication state query instruction to obtain a first message request;
executing an SQL statement corresponding to the first message request on a target MYSQL database corresponding to the target group replication node according to the loaded service logic by the LUA virtual machine;
and generating the group replication state of the target group replication node according to the response result of the target MYSQL database to the SQL statement.
Based on the group replication node proxy apparatus provided in the foregoing embodiment, preferably, the first executing module 74 is configured to:
analyzing the group of copy monitoring operation instructions to obtain a second message request;
calling a service logic corresponding to the group of copy monitoring operation instructions through the LUA virtual machine;
and executing the operation corresponding to the business logic on the target group replication node.
In order to solve the problems in the prior art, as shown in fig. 8, the present embodiment provides a group copy status monitoring apparatus 80, including:
a second sending module 81, configured to issue a group replication state query instruction to a target group replication node proxy apparatus, where the group replication state query instruction is used to instruct the target group replication node proxy apparatus to query a group replication state of a target group replication node, and the target group replication node corresponds to the group replication node proxy apparatus and is used to perform group replication on a MYSQL database;
a second receiving module 82, configured to receive a group replication state fed back by the target group replication node proxy apparatus based on the group replication state query instruction, and determine whether the group replication state of the target group replication node is normal according to the group replication state through a preset rule;
the second control module 83, when the group replication state of the target group replication node is abnormal, issues a group replication monitoring operation instruction to the target group replication node proxy apparatus according to the group replication state of the target group replication node, so as to instruct the target group replication node proxy apparatus to execute an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
Based on the above-mentioned group copy status monitoring apparatus, preferably, the second receiving module 82 is configured to:
judging that the group replication state of the target group replication node is abnormal when the group replication state of the target group replication node meets at least one of the following conditions: the target group replication node is inaccessible, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node lags behind.
Based on the above-mentioned group copy status monitoring apparatus, preferably, the second control module 83 is configured to:
when the target group replication node cannot be accessed, issuing a group replication function starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to start a group replication function of the target group replication node;
when the target group replication node is in an off-line state, issuing a group replication starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group replication efficiency of the target group replication node lags, issuing a group replication suspension instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to suspend group replication.
Based on the above group copy status monitoring apparatus, preferably, the second sending module 81 is configured to:
encapsulating a message generated by the LUA virtual machine into a group replication state query instruction, and sending the group replication state query instruction to a target group replication node agent device;
receiving the group replication state fed back by the target group replication node proxy device based on the group replication state query instruction includes:
and analyzing the received group of copy states, and sending an analysis result to the LUA virtual machine.
In order to solve the problems in the prior art, referring to fig. 1, the present embodiment provides a MYSQL database group replication state monitoring system, which includes the group replication state monitoring apparatus described in the foregoing embodiment and at least one group replication node agent apparatus described in the foregoing embodiment, which is communicatively connected to the group replication state monitoring apparatus through an external interface.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the foregoing MYSQL database group copy status monitoring method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program realizes each process of the MYSQL database group replication state monitoring method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A MYSQL database group copy state monitoring method is applied to a group copy node agent device and comprises the following steps:
receiving a group copy state query instruction issued by a group copy state monitoring device;
inquiring the group replication state of a target group replication node according to the group replication state inquiry instruction, wherein the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
feeding back the group replication state to the group replication state monitoring device to indicate the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal;
and when a group replication monitoring operation instruction issued by the group replication state monitoring device based on the group replication state is received, executing an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
2. The method of claim 1, wherein querying a group replication state of a target group replication node according to the group replication state query instruction comprises:
analyzing the group of the replication state query instruction to obtain a first message request;
executing an SQL statement corresponding to the first message request on a target MYSQL database corresponding to the target group replication node according to the loaded service logic by the LUA virtual machine;
and generating the group replication state of the target group replication node according to the response result of the target MYSQL database to the SQL statement.
3. The method according to claim 1 or 2, wherein when receiving a group replication monitoring operation instruction issued by the group replication state monitoring apparatus based on the group replication state, performing an operation corresponding to the group replication monitoring operation instruction on the target group replication node, includes:
analyzing the group of copy monitoring operation instructions to obtain a second message request;
calling a service logic corresponding to the group of copy monitoring operation instructions through the LUA virtual machine;
and executing the operation corresponding to the business logic on the target group replication node.
4. A MYSQL database group copy state monitoring method is applied to a group copy state monitoring device and comprises the following steps:
issuing a group replication state query instruction to a target group replication node agent device, wherein the group replication state query instruction is used for indicating the target group replication node agent device to query a group replication state of a target group replication node, and the target group replication node corresponds to the group replication node agent device and is used for performing group replication on a MYSQL database;
receiving a group replication state fed back by the target group replication node proxy device based on the group replication state query instruction, and judging whether the group replication state of the target group replication node is normal or not according to the group replication state through a preset rule;
and when the group replication state of the target group replication node is abnormal, issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node so as to instruct the target group replication node proxy device to execute an operation corresponding to the group replication monitoring operation instruction on the target group replication node.
5. The method as claimed in claim 4, wherein receiving the group replication status fed back by the target group replication node proxy apparatus based on the group replication status query instruction, and determining whether the group replication status of the target group replication node is normal according to the group replication status through a preset rule, comprises:
judging that the group replication state of the target group replication node is abnormal when the group replication state of the target group replication node meets at least one of the following conditions: the target group replication node is inaccessible, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node lags behind.
6. The method of claim 5, wherein issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node to instruct the target group replication node proxy device to perform an operation corresponding to the group replication monitoring operation instruction on the target group replication node when the group replication state of the target group replication node is abnormal, comprises:
when the target group replication node cannot be accessed, issuing a group replication function starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to start a group replication function of the target group replication node;
when the target group replication node is in an off-line state, issuing a group replication starting instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group replication efficiency of the target group replication node lags, issuing a group replication suspension instruction to the target group replication node proxy device to instruct the target group replication node proxy device to control the target group replication node to suspend group replication.
7. The method of claim 4, wherein issuing a group replication status query instruction to the target group replication node proxy device comprises:
encapsulating a message generated by the LUA virtual machine into a group replication state query instruction, and sending the group replication state query instruction to a target group replication node agent device;
receiving the group replication state fed back by the target group replication node proxy device based on the group replication state query instruction includes:
and analyzing the received group of copy states, and sending an analysis result to the LUA virtual machine.
8. A group replication node proxy apparatus, comprising:
the first receiving module is used for receiving a group copy state query instruction issued by the group copy state monitoring device;
the first query module is used for querying the group replication state of a target group replication node according to the group replication state query instruction, wherein the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
the first feedback module feeds the group replication state back to the group replication state monitoring device to indicate the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal;
and the first execution module is used for executing the operation corresponding to the group copy monitoring operation instruction on the target group copy node when receiving the group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state.
9. A group copy status monitoring apparatus, comprising:
the second sending module is used for issuing a group replication state query instruction to the target group replication node proxy device, wherein the group replication state query instruction is used for indicating the target group replication node proxy device to query the group replication state of the target group replication node, and the target group replication node corresponds to the group replication node proxy device and is used for performing group replication on the MYSQL database;
the second receiving module is used for receiving the group replication state fed back by the target group replication node proxy device based on the group replication state query instruction, and judging whether the group replication state of the target group replication node is normal or not according to the group replication state through a preset rule;
and the second control module is used for issuing a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication state of the target group replication node when the group replication state of the target group replication node is abnormal so as to instruct the target group replication node proxy device to execute the operation corresponding to the group replication monitoring operation instruction on the target group replication node.
10. A MYSQL database group replication status monitoring system comprising the group replication status monitoring apparatus of claim 9 and at least one group replication node agent apparatus of claim 8 communicatively connected to the group replication status monitoring apparatus via an external interface.
CN201911317601.4A 2019-12-19 2019-12-19 MYSQL database group replication state monitoring method, device and system Active CN113010599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911317601.4A CN113010599B (en) 2019-12-19 2019-12-19 MYSQL database group replication state monitoring method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911317601.4A CN113010599B (en) 2019-12-19 2019-12-19 MYSQL database group replication state monitoring method, device and system

Publications (2)

Publication Number Publication Date
CN113010599A true CN113010599A (en) 2021-06-22
CN113010599B CN113010599B (en) 2023-07-21

Family

ID=76381496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911317601.4A Active CN113010599B (en) 2019-12-19 2019-12-19 MYSQL database group replication state monitoring method, device and system

Country Status (1)

Country Link
CN (1) CN113010599B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11320978B2 (en) 2018-12-20 2022-05-03 Nutanix, Inc. User interface for database management services
USD956776S1 (en) 2018-12-14 2022-07-05 Nutanix, Inc. Display screen or portion thereof with a user interface for a database time-machine
CN115086405A (en) * 2022-06-10 2022-09-20 上海莉莉丝科技股份有限公司 Data processing method, system, device, medium and program product for server
US11604762B2 (en) 2018-12-27 2023-03-14 Nutanix, Inc. System and method for provisioning databases in a hyperconverged infrastructure system
US11604705B2 (en) 2020-08-14 2023-03-14 Nutanix, Inc. System and method for cloning as SQL server AG databases in a hyperconverged system
US11604806B2 (en) 2020-12-28 2023-03-14 Nutanix, Inc. System and method for highly available database service
US11640340B2 (en) 2020-10-20 2023-05-02 Nutanix, Inc. System and method for backing up highly available source databases in a hyperconverged system
US11803368B2 (en) 2021-10-01 2023-10-31 Nutanix, Inc. Network learning to control delivery of updates
US11816066B2 (en) 2018-12-27 2023-11-14 Nutanix, Inc. System and method for protecting databases in a hyperconverged infrastructure system
US11892918B2 (en) 2021-03-22 2024-02-06 Nutanix, Inc. System and method for availability group database patching
US11907167B2 (en) 2020-08-28 2024-02-20 Nutanix, Inc. Multi-cluster database management services
US12105683B2 (en) 2021-10-21 2024-10-01 Nutanix, Inc. System and method for creating template for database services
US12164541B2 (en) 2020-08-28 2024-12-10 Nutanix, Inc. Multi-cluster database management system
US12174856B2 (en) 2021-10-25 2024-12-24 Nutanix, Inc. Database group management

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101981575A (en) * 2008-06-03 2011-02-23 图形科技公司 Method and apparatus for copying objects in an object-oriented environment using a multiple-transaction technique
CN103810076A (en) * 2012-11-15 2014-05-21 国家电网公司 Monitoring method and device for data reproduction
CN104283710A (en) * 2014-08-18 2015-01-14 四川长虹电器股份有限公司 Database cluster fault handling method and management server
WO2015021828A1 (en) * 2013-08-16 2015-02-19 华为技术有限公司 Data storage method and device for distributed database
CN105959130A (en) * 2016-04-13 2016-09-21 乐视控股(北京)有限公司 Monitoring method and monitoring device based on big data operation
CN108353327A (en) * 2015-10-20 2018-07-31 并行无线公司 X2 Protocols
CN108599996A (en) * 2018-04-03 2018-09-28 武汉斗鱼网络科技有限公司 Fault handling method, device and the terminal of data-base cluster
CN110019500A (en) * 2017-08-21 2019-07-16 东软集团股份有限公司 A kind of copy group method for monitoring state, device, equipment and storage medium
CN110463255A (en) * 2017-03-23 2019-11-15 三星电子株式会社 For handling the method and apparatus for being used to be grouped the data of duplication

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101981575A (en) * 2008-06-03 2011-02-23 图形科技公司 Method and apparatus for copying objects in an object-oriented environment using a multiple-transaction technique
CN103810076A (en) * 2012-11-15 2014-05-21 国家电网公司 Monitoring method and device for data reproduction
WO2015021828A1 (en) * 2013-08-16 2015-02-19 华为技术有限公司 Data storage method and device for distributed database
CN104283710A (en) * 2014-08-18 2015-01-14 四川长虹电器股份有限公司 Database cluster fault handling method and management server
CN108353327A (en) * 2015-10-20 2018-07-31 并行无线公司 X2 Protocols
CN105959130A (en) * 2016-04-13 2016-09-21 乐视控股(北京)有限公司 Monitoring method and monitoring device based on big data operation
CN110463255A (en) * 2017-03-23 2019-11-15 三星电子株式会社 For handling the method and apparatus for being used to be grouped the data of duplication
CN110019500A (en) * 2017-08-21 2019-07-16 东软集团股份有限公司 A kind of copy group method for monitoring state, device, equipment and storage medium
CN108599996A (en) * 2018-04-03 2018-09-28 武汉斗鱼网络科技有限公司 Fault handling method, device and the terminal of data-base cluster

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱崇来: "基于MySQL组复制技术数据备份策略实现", 《电子世界》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
USD956776S1 (en) 2018-12-14 2022-07-05 Nutanix, Inc. Display screen or portion thereof with a user interface for a database time-machine
US11320978B2 (en) 2018-12-20 2022-05-03 Nutanix, Inc. User interface for database management services
US11907517B2 (en) 2018-12-20 2024-02-20 Nutanix, Inc. User interface for database management services
US11860818B2 (en) 2018-12-27 2024-01-02 Nutanix, Inc. System and method for provisioning databases in a hyperconverged infrastructure system
US11604762B2 (en) 2018-12-27 2023-03-14 Nutanix, Inc. System and method for provisioning databases in a hyperconverged infrastructure system
US11816066B2 (en) 2018-12-27 2023-11-14 Nutanix, Inc. System and method for protecting databases in a hyperconverged infrastructure system
US12026124B2 (en) 2018-12-27 2024-07-02 Nutanix, Inc. System and method for provisioning databases in a hyperconverged infrastructure system
US11604705B2 (en) 2020-08-14 2023-03-14 Nutanix, Inc. System and method for cloning as SQL server AG databases in a hyperconverged system
US12019523B2 (en) 2020-08-14 2024-06-25 Nutanix, Inc. System and method for cloning as SQL server AG databases in a hyperconverged system
US12164541B2 (en) 2020-08-28 2024-12-10 Nutanix, Inc. Multi-cluster database management system
US11907167B2 (en) 2020-08-28 2024-02-20 Nutanix, Inc. Multi-cluster database management services
US11640340B2 (en) 2020-10-20 2023-05-02 Nutanix, Inc. System and method for backing up highly available source databases in a hyperconverged system
US12153499B2 (en) 2020-10-20 2024-11-26 Nutanix, Inc. System and method for backing up highly available source databases in a hyperconverged system
US11604806B2 (en) 2020-12-28 2023-03-14 Nutanix, Inc. System and method for highly available database service
US11995100B2 (en) 2020-12-28 2024-05-28 Nutanix, Inc. System and method for highly available database service
US11892918B2 (en) 2021-03-22 2024-02-06 Nutanix, Inc. System and method for availability group database patching
US11803368B2 (en) 2021-10-01 2023-10-31 Nutanix, Inc. Network learning to control delivery of updates
US12105683B2 (en) 2021-10-21 2024-10-01 Nutanix, Inc. System and method for creating template for database services
US12174856B2 (en) 2021-10-25 2024-12-24 Nutanix, Inc. Database group management
CN115086405B (en) * 2022-06-10 2024-05-31 上海莉莉丝科技股份有限公司 Data processing method, system, device, medium and program product for server
CN115086405A (en) * 2022-06-10 2022-09-20 上海莉莉丝科技股份有限公司 Data processing method, system, device, medium and program product for server

Also Published As

Publication number Publication date
CN113010599B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN113010599A (en) MYSQL database group copy state monitoring method, device and system
US9277030B2 (en) Stream processing using a client-server architecture
CN108804119A (en) Configure update method, device, system, configuration center, application node and medium
WO2022127504A1 (en) Network element management method and apparatus, and storage medium
US8719406B2 (en) Selectively monitoring a service endpoint of an information technology system
CN109426510B (en) Software processing method and device, electronic equipment and computer readable storage medium
CN108200132B (en) Resource acquisition method, device, equipment and computer readable storage medium
JP5514040B2 (en) Operation management system, operation management method, and operation management apparatus
US20160352843A1 (en) Data Processing Method, Device, and ESB System
WO2022062661A1 (en) Operation notification method and apparatus, and storage medium and electronic apparatus
CN112583630A (en) Device management method, device, system, device and storage medium
CN111694620B (en) Interaction method, device and equipment of third party service and computer storage medium
CN111679850B (en) Application program hot update processing method, device and system
CN111679842B (en) Application program hot update processing method, device and system
CN115103007A (en) Distributed cloud-based service discovery method, device and readable storage medium
CN113553163A (en) Scheduler-based Jenkins application deployment method and device
JP2013535736A (en) Apparatus for providing terminal management package and method for receiving terminal management package
KR101480293B1 (en) Distributed filesystem processing device and method, and storage media storing the same
CN112558985B (en) Sub-application deployment method and device
CN112214437B (en) Storage device, communication method and device and computer readable storage medium
CN116321064A (en) Vehicle remote control method, device, system and server
CN114650317A (en) Micro-service system and micro-service registration, discovery and keep-alive method
CN108259527B (en) Proxy-based service processing method and device and network element equipment
CN112188189B (en) Early warning method of television equipment, early warning server and computer readable storage medium
JP2006301769A (en) Server 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
GR01 Patent grant
GR01 Patent grant