CN113010599B - MYSQL database group replication state monitoring method, device and system - Google Patents

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

Info

Publication number
CN113010599B
CN113010599B CN201911317601.4A CN201911317601A CN113010599B CN 113010599 B CN113010599 B CN 113010599B CN 201911317601 A CN201911317601 A CN 201911317601A CN 113010599 B CN113010599 B CN 113010599B
Authority
CN
China
Prior art keywords
group
replication
node
copy
state
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.)
Active
Application number
CN201911317601.4A
Other languages
Chinese (zh)
Other versions
CN113010599A (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

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

The invention discloses a method, a device and a system for monitoring the replication state of a MYSQL database group, which are used for solving the problem that the replication state of the MYSQL database group is not timely monitored. The scheme provided by the embodiment timely monitors the group copy state of the target group copy node, and executes corresponding operation on the target group copy node when receiving the group copy monitoring operation instruction. The scheme can automatically inquire the replication state of the MYSQL database group and timely adjust the replication state of the group according to the instruction, so that when the replication state of the MYSQL database group is abnormal, the scheme can realize timely monitoring, and the problem of slow repair caused by manual monitoring is avoided.

Description

MYSQL database group replication 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 replication state of a MYSQL database group.
Background
MYSQL is a relational database management system, and is a relational database management system. The MYSQL often uses SQL language, has small volume, high speed and low total cost of ownership, and can be widely applied to the WEB field.
Mobile operators often need database group replication using MYSQL in implementing network function virtualization (Network Function Virtualization, NFV) deployment software. However, in the process of copying the database group by MYSQL, an abnormality may occur, and the abnormality usually needs to be manually monitored, found and manually repaired, so that more manpower is required to be consumed, and the repairing speed is low.
How to timely and effectively monitor the replication 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 replication state of a MYSQL database group, which are used for solving the problem that the replication state of the MYSQL database group is not timely monitored.
In a first aspect, a method for monitoring a replication state of a MYSQL database group is provided, which is applied to a group replication node proxy device, and includes:
receiving a group copying state query instruction issued by a group copying 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 a MYSQL database;
feeding back the group replication state to the group replication state monitoring device so as to instruct the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal or not;
and when receiving a group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state, executing an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
In a second aspect, a method for monitoring a replication state of a MYSQL database group is provided, which is applied to a device for monitoring a replication state of a group, and includes:
issuing a group replication state query instruction to a target group replication node proxy device, wherein the group replication state query instruction is used for instructing the target group replication node proxy device to query the group replication state of a 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 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;
when the group copy state of the target group copy node is abnormal, a group copy monitoring operation instruction is issued to the target group copy node proxy device according to the group copy state of the target group copy node, so that the target group copy node proxy device is instructed to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
In a third aspect, there is provided a group replication node proxy apparatus comprising:
the first receiving module is used for receiving a group copying state query instruction issued by the group copying state monitoring device;
the first query module queries 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 a MYSQL database;
the first feedback module is used for feeding back the group replication state to the group replication state monitoring device so as to instruct the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal or not;
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 state monitoring apparatus comprising:
the second sending module is used for sending a group replication state query instruction to a 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 a 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 a MYSQL database;
the second receiving module is used for receiving the group copying state fed back by the target group copying node proxy device based on the group copying state query instruction and judging whether the group copying state of the target group copying node is normal or not according to the group copying state through a preset rule;
and the second control module is used for issuing a group copy monitoring operation instruction to the target group copy node proxy device according to the group copy state of the target group copy node when the group copy state of the target group copy node is abnormal, so as to instruct the target group copy node proxy device to execute the operation corresponding to the group copy monitoring operation instruction on the target group copy node.
In a fifth aspect, a MYSQL database group replication status monitoring system is provided, which includes the group replication status monitoring device of the fourth aspect and at least one group replication node proxy device according to the third aspect that is communicatively connected to the group replication status monitoring device through an external interface.
In a sixth aspect, there is provided an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program implementing the steps of the method as in the first or second aspect when executed by the processor.
In a seventh aspect, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method as in 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 first, then a 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 copy state of the target group copy node can be monitored in time, and corresponding operation is executed on the target group copy node when the group copy monitoring operation instruction is received. The scheme can automatically inquire the replication state of the MYSQL database group and timely adjust the replication state of the group according to the instruction, so that when the replication state of the MYSQL database group is abnormal, the scheme can realize timely monitoring, and the problem of slow repair caused by manual monitoring 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 do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a schematic diagram of a replication status monitoring system for a MYSQL database group according to the present embodiment;
FIG. 2a is a flowchart of a method for monitoring replication status of MYSQL database groups according to the present embodiment;
fig. 2b is a schematic logic structure diagram of a group replication node proxy device according to the present embodiment;
FIG. 3 is a second flowchart of a method for monitoring replication status of MYSQL database groups according to the present embodiment;
FIG. 4 is a third flowchart of a method for monitoring replication status of MYSQL database groups according to the present embodiment;
FIG. 5a is a flowchart illustrating a method for monitoring replication status of MYSQL database groups according to the present embodiment;
FIG. 5b is a schematic diagram of a logic structure of a group copy status monitor apparatus according to the present embodiment;
FIG. 6 is a flowchart of a method for monitoring replication status of MYSQL database groups according to the present embodiment;
fig. 7 is a schematic structural diagram of a group replication node proxy apparatus provided in the present embodiment;
fig. 8 is a schematic structural diagram of a group copy status monitoring apparatus according to the present embodiment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. The reference numerals in the present application are only used to distinguish the steps in the scheme, and are not used to limit the execution sequence of the steps, and the specific execution sequence controls the description in the specification.
The scheme provided by the embodiment can be applied to a MYSQL database, and is used for monitoring the states of all groups of replication nodes of the MYSQL database and adjusting abnormal nodes. The embodiment provides a MYSQL database group replication state monitoring method, a group replication node proxy 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 device and at least one group replication node agent device that are communicatively connected through an external interface.
In practical applications, 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 status monitoring device and three group replication node agent devices communicatively connected thereto are included. Each group replication node proxy device corresponds to one group replication node, namely, each group replication node is respectively deployed with the group replication node proxy device in the database group replication nodes, and each group replication node corresponds to one MYSQL database group replication member. The group replication status monitoring device may be located outside the database group.
In the scheme provided by the embodiment, the group replication state monitoring device is in data communication with each group replication node proxy device respectively so as to acquire the states of the group replication nodes corresponding to each group replication node proxy, and timely issue instruction adjustment when the states of the group replication nodes are abnormal, so that the monitoring of each group replication node is realized, and the monitoring of the group replication state of the MYSQL database is further realized.
The embodiment provides a MYSQL database group replication status monitoring method for the group replication node proxy device, as shown in fig. 2a, comprising the following steps:
s21: receiving a group copying state query instruction issued by a group copying 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 a MYSQL database;
s23: feeding back the group replication state to the group replication state monitoring device so as to instruct the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal or not;
s24: and when receiving a group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state, executing an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
The schematic structure diagram of the group replication node proxy device in this embodiment is shown in fig. 2b, where the group replication node proxy device may be applied to a MYSQL database, and includes an external interface and a LUA virtual machine, the external interface may be used to send and receive data, the group replication state query instruction may be received through the external interface, the LUA virtual machine may be used to perform data processing, where database proxy logic is implemented by LUA language, and the LUA virtual machine may further include other functional logic. For example, the external interface may be a REST (Representational State Transfer) access interface that may be used to receive a set of replication status query instructions, which may be HTTP instructions.
In this embodiment, the external interface first parses the received HTTP instruction into a first message request, and forwards the first message request to the LUA virtual machine for processing. The LUA virtual machine pre-loads the protocol adaptation logic LUA library of each service automatically according to the configuration so as to process the first message request subsequently. After each protocol adaptation logic LUA library is preloaded, the LUA virtual machine executes SQL sentences 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 converting LUA logic into database operations and responses.
The group replication node proxy device also comprises an underlying protocol support module which can be used for providing an interface for accessing the MYSQL database by the LUA virtual machine, namely, the LUA business logic can be connected with the SQL execution environment of the MYSQL database. Specifically, the underlying protocol support module can implement tool packages for supporting LUA functions by MYSQL databases, such as character set transcoding, database connection management, and the like. The underlying protocol support module can perform classification control on SQL sentences supported by the LUA virtual machine and provide relevant state responses. In addition, the underlying protocol support module also supports connecting multiple MYSQL databases.
By the scheme provided by the embodiment, the group replication node proxy 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 judging whether the group replication state of the target group replication node is normal or not by the group replication state monitoring device, and issuing 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 queries the group replication status of the target group replication node according to the group replication status query instruction, as shown in fig. 3, and includes the following steps:
s31: analyzing the group replication state query instruction to obtain a first message request;
s32: executing the SQL statement corresponding to the first message request in a target MYSQL database corresponding to the target group replication node according to the loaded business logic by the LUA virtual machine;
s33: and generating the group copy state of the target group copy 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 first message request obtained by parsing 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 sentences in a MYSQL database of the target node, and finally, the group replication state of the target group replication node is generated according to the response result.
By the scheme provided by the embodiment, the LUA virtual machine can inquire the group replication state of the target group replication node in the MYSQL database, so that the generated group replication state corresponds to the actual state of the target group replication node.
Preferably, the group replication node proxy device may be developed and implemented in LUA language, and generates a 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 replication status code "1001" is defined in a state where the group replication node cannot access, such as a failure to establish a connection, a timeout of establishing a connection, a database not being started, a failure of query result, etc. The offline state is handled in the group replication at the group replication node, i.e. the database is operating normally but the database group replication group is not joined, defining the group replication status code "2001". When the group replication node is in the group replication group, but the group replication delay parameter is found to exceed a preset threshold 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 determining the state of the group replication node, the 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, step S24, when receiving a group copy monitoring operation instruction issued by the group copy state monitoring apparatus based on the group copy state, executes an operation corresponding to the group copy monitoring operation instruction on the target group copy node, as shown in fig. 4, includes the steps of:
s41: analyzing the group copy monitoring operation instruction to obtain a second message request;
s42: invoking business logic corresponding to the set of copy monitoring operation instructions by 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 parsed to obtain the second message request. And then the external interface sends the second message request to the LUA virtual machine for data processing, and the LUA virtual machine calls corresponding business logic to execute control operation on the target group replication node.
By the scheme provided by the embodiment, the group copy state of the target group copy node can be queried, and the target group copy node is correspondingly adjusted when the group copy monitoring operation instruction is received. When the state of the target group replication node is abnormal, the abnormality of the group replication state can be timely monitored through the scheme provided by the embodiment, the target group replication node is adjusted, the monitoring of the group replication state is realized, manual adjustment is not needed, and the abnormality of the group replication state can be timely monitored and automatically adjusted.
In order to solve the problems in the prior art, this embodiment provides a MYSQL database group replication status monitoring method applied to a group replication status monitoring device, as shown in fig. 5a, including the following steps:
s51: issuing a group replication state query instruction to a target group replication node proxy device, wherein the group replication state query instruction is used for instructing the target group replication node proxy device to query the group replication state of a 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 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: when the group copy state of the target group copy node is abnormal, a group copy monitoring operation instruction is issued to the target group copy node proxy device according to the group copy state of the target group copy node, so that the target group copy node proxy device is instructed to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
The group replication status monitoring device in this embodiment is shown in fig. 5b, and the group replication status monitoring device 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 the LUA virtual machine generated instruction into an HTTP message and send the HTTP message to the target set of replicated node proxy devices. After the external interface receives the group copy state fed back by the target group copy node proxy device, the group copy state is analyzed, and the analysis result is sent to the LUA virtual machine for processing.
The LUA virtual machine adapts a logic LUA library in advance according to a protocol for loading each service according to configuration, and then the LUA virtual machine can generate a group replication state query instruction according to configuration information and then send the group replication state query instruction to each target group replication node agent device through an external interface. 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 or not according to a preset rule, and if abnormal is found, the LUA virtual machine sends a corresponding operation instruction to the target group replication node proxy device so as to adjust the target group replication node, thereby ensuring the stability of the group replication state of the MYSQL database.
Preferably, step S52, receiving the group replication status fed back by the target group replication node proxy device 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, includes:
judging that the group copy state of the target group copy node is abnormal when the group copy state of the target group copy node meets at least one of the following: the target group replication node cannot be accessed, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node is lagged.
The group copy state of the target group copy node may exhibit an inaccessible state, an offline state, and a group copy efficiency hysteresis state. When the group copy state of the target group copy node is abnormal, the MYSQL database group copy state is affected. The scheme provided by the embodiment can timely detect the abnormal state of the target group replication node so as to be adjusted in a targeted manner.
Preferably, step S53, when the group replication status of the target group replication node is abnormal, issues a group replication monitoring operation instruction to the target group replication node proxy device according to the group replication status 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, 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 so as to instruct the target group replication node proxy device to start the group replication function of the target group replication node;
when the target group replication node is in an offline state, issuing a group replication starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group copying efficiency of the target group copying node is lagged, issuing a group copying pause instruction to the target group copying node proxy device so as to instruct the target group copying node proxy device to control the target group copying node to pause the group copying.
In the actual application process, the group replication status code corresponding to the group replication node status can be predefined, and when the group replication status fed back by the target group replication node proxy device includes the preset group replication status code, the status represented by the group replication status code can be determined according to predefined rules. For example, when the received group copy status includes the group copy status code "1001", the group copy monitoring operation instruction issued to the target group copy node proxy device may include an operation instruction to start the database, set the group copy parameter, start the group copy function, and so on. When the received group copy status includes a group copy status code "2001", the group copy monitoring operation instruction issued to the target group copy node proxy device may include an operation instruction to start a group copy function or the like. When the received group copy status includes a group copy status code "4001", the group copy monitoring operation instruction issued to the target group copy node proxy device may include stopping the group copy function, hibernating 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 queried, and when the node is in an abnormal state, a group replication monitoring operation instruction is sent out according to the actually-occurring abnormal state so as to correct the abnormal state of the node, thereby ensuring the overall stability of the replication state of the MYSQL database group.
Preferably, as shown in fig. 6, step S51, issuing a group replication status query instruction to the target group replication node proxy device includes:
s61: the message generated by the LUA virtual machine is packaged into a group copy state query instruction and sent to a target group copy node proxy device;
wherein, step S52, receiving the group replication status fed back by the target group replication node proxy device based on the group replication status query instruction, includes:
s62: and executing analysis on the received group copy state, and sending an analysis result to the LUA virtual machine.
The group replication status monitoring device may issue a group replication status query instruction to the target group replication node proxy device according to a preset period. The LUA virtual machine can generate a message according to a preset period, and the external interface encapsulates the message generated by the LUA virtual machine into a group copy state query instruction and then sends the group copy state query instruction to the target group copy node proxy device.
When the target group replication node proxy device feeds back the group replication state, the external interface can receive the group replication state and analyze the group replication state, and then the analysis result is sent to the LUA virtual machine, so that the LUA virtual machine can determine whether the state of the target group replication node is abnormal according to the analysis result.
In order to solve the problems existing 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 for receiving 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 status of a target group replication node according to the group replication status query instruction, where the target group replication node corresponds to the group replication node proxy device, and is configured to perform group replication on a MYSQL database;
a first feedback module 73 that feeds back the group replication status to the group replication status monitoring device to instruct the group replication status monitoring device to determine whether the group replication status of the target group replication node is normal;
the first execution module 74, when receiving a group copy monitoring operation instruction issued by the group copy state monitoring apparatus based on the group copy state, executes 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 replication state query instruction to obtain a first message request;
executing the SQL statement corresponding to the first message request in a target MYSQL database corresponding to the target group replication node according to the loaded business logic by the LUA virtual machine;
and generating the group copy state of the target group copy 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 execution module 74 is configured to:
analyzing the group copy monitoring operation instruction to obtain a second message request;
invoking business logic corresponding to the set of copy monitoring operation instructions by 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 status query instruction to a target group replication node proxy device, where the group replication status query instruction is configured to instruct the target group replication node proxy device to query a group replication status of a target group replication node, where the target group replication node corresponds to the group replication node proxy device, and is configured to perform group replication on a MYSQL database;
the second receiving module 82 receives the group replication state fed back by the target group replication node agent device based on the group replication state query instruction, and judges 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 issues a group copy monitoring operation instruction to the target group copy node proxy device according to the group copy state of the target group copy node when the group copy state of the target group copy node is abnormal, so as to instruct the target group copy node proxy device to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node.
Based on the above-mentioned group copy status monitoring apparatus, the second receiving module 82 is preferably configured to:
judging that the group copy state of the target group copy node is abnormal when the group copy state of the target group copy node meets at least one of the following: the target group replication node cannot be accessed, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node is lagged.
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 so as to instruct the target group replication node proxy device to start the group replication function of the target group replication node;
when the target group replication node is in an offline state, issuing a group replication starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group copying efficiency of the target group copying node is lagged, issuing a group copying pause instruction to the target group copying node proxy device so as to instruct the target group copying node proxy device to control the target group copying node to pause the group copying.
Based on the above-mentioned group copy status monitoring apparatus, preferably, the second sending module 81 is configured to:
the message generated by the LUA virtual machine is packaged into a group copy state query instruction and sent to a target group copy node proxy device;
wherein receiving the group replication status fed back by the target group replication node proxy device based on the group replication status query instruction includes:
and executing analysis on the received group copy state, and sending an analysis result to the LUA virtual machine.
In order to solve the problems in the prior art, referring to fig. 1, this embodiment provides a MYSQL database group replication status monitoring system, which includes the group replication status monitoring device described in the foregoing embodiment and at least one group replication node proxy device described in the foregoing embodiment and communicatively connected to the group replication status monitoring device through an external interface.
Preferably, the embodiment of the present invention further provides an electronic device, including 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 embodiment of a method for monitoring a replication status of a MYSQL database group, and the same technical effect can be achieved, and for avoiding repetition, a detailed description is omitted herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the above embodiment of the method for monitoring the replication state of a MYSQL database group, and can achieve the same technical effects, so that repetition is avoided and redundant description is omitted. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (9)

1. The method is characterized by being applied to a group replication node proxy device, wherein at least one group replication node proxy device is in communication connection with the group replication state monitoring device, and one group replication node proxy device corresponds to a group replication node of the MYSQL database; comprising the following steps:
receiving a group copying state query instruction issued by a group copying 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 a MYSQL database;
feeding back the group replication state to the group replication state monitoring device so as to instruct the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal or not;
when receiving a group copy monitoring operation instruction issued by the group copy state monitoring device based on the group copy state, executing an operation corresponding to the group copy monitoring operation instruction on the target group copy node; the group copy monitoring operation instruction is sent by the group copy state monitoring device when the group copy state of the target group copy node is determined to be abnormal;
when the group copy state indicates that the target group copy node cannot access, the group copy monitoring operation instruction is a group copy function starting instruction, so as to instruct the target group copy node proxy device to start the group copy function of the target group copy node;
when the group copy state indicates that the target group copy node is in an offline state, the group copy monitoring operation instruction is a group copy starting instruction so as to instruct the target group copy node proxy device to control the target group copy node to execute group copy;
when the group copy state indicates that the group copy efficiency of the target group copy node lags, the group copy monitoring operation instruction is a issued group copy suspension instruction to instruct the target group copy node proxy device to control the target group copy node to suspend group copy.
2. The method of claim 1, wherein querying the group replication state of the target group replication node according to the group replication state query instruction comprises:
analyzing the group replication state query instruction to obtain a first message request;
executing the SQL statement corresponding to the first message request in a target MYSQL database corresponding to the target group replication node according to the loaded business logic by the LUA virtual machine;
and generating the group copy state of the target group copy 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 copy monitoring operation instruction issued by the group copy state monitoring apparatus based on the group copy state, performing an operation corresponding to the group copy monitoring operation instruction on the target group copy node, comprises:
analyzing the group copy monitoring operation instruction to obtain a second message request;
invoking business logic corresponding to the set of copy monitoring operation instructions by the LUA virtual machine;
and executing the operation corresponding to the business logic on the target group replication node.
4. The method is characterized by being applied to a group replication state monitoring device, wherein the group replication state monitoring device is in communication connection with at least one group replication node proxy device, and one group replication node proxy device corresponds to a group replication node of the MYSQL database; comprising the following steps:
issuing a group replication state query instruction to a target group replication node proxy device, wherein the group replication state query instruction is used for instructing the target group replication node proxy device to query the group replication state of a 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 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;
when the group copy state of the target group copy node is abnormal, issuing a group copy monitoring operation instruction to the target group copy node proxy device according to the group copy state of the target group copy node so as to instruct the target group copy node proxy device to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node;
when the group copy state of the target group copy node is abnormal, issuing a group copy monitoring operation instruction to the target group copy node proxy device according to the group copy state of the target group copy node, so as to instruct the target group copy node proxy device to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node, including:
when the target group replication node cannot be accessed, issuing a group replication function starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to start the group replication function of the target group replication node;
when the target group replication node is in an offline state, issuing a group replication starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group copying efficiency of the target group copying node is lagged, issuing a group copying pause instruction to the target group copying node proxy device so as to instruct the target group copying node proxy device to control the target group copying node to pause the group copying.
5. The method of claim 4, wherein receiving the group copy state fed back by the target group copy node proxy device based on the group copy state query instruction, and determining whether the group copy state of the target group copy node is normal according to the group copy state through a preset rule, comprises:
judging that the group copy state of the target group copy node is abnormal when the group copy state of the target group copy node meets at least one of the following: the target group replication node cannot be accessed, the target group replication node is in an offline state, and the group replication efficiency of the target group replication node is lagged.
6. The method of claim 4, wherein issuing a group replication status query instruction to a target group replication node proxy device comprises:
the message generated by the LUA virtual machine is packaged into a group copy state query instruction and sent to a target group copy node proxy device;
wherein receiving the group replication status fed back by the target group replication node proxy device based on the group replication status query instruction includes:
and executing analysis on the received group copy state, and sending an analysis result to the LUA virtual machine.
7. A group replication node proxy device, wherein at least one group replication node proxy device is in communication connection with a group replication status monitoring device, and one group replication node proxy device corresponds to a group replication node of a MYSQL database; comprising the following steps:
the first receiving module is used for receiving a group copying state query instruction issued by the group copying state monitoring device;
the first query module queries 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 a MYSQL database;
the first feedback module is used for feeding back the group replication state to the group replication state monitoring device so as to instruct the group replication state monitoring device to judge whether the group replication state of the target group replication node is normal or not;
a first execution module that executes an 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 apparatus based on the group copy state; the group copy monitoring operation instruction is sent by the group copy state monitoring device when the group copy state of the target group copy node is determined to be abnormal;
when the group copy state indicates that the target group copy node cannot access, the group copy monitoring operation instruction is a group copy function starting instruction, so as to instruct the target group copy node proxy device to start the group copy function of the target group copy node;
when the group copy state indicates that the target group copy node is in an offline state, the group copy monitoring operation instruction is a group copy starting instruction so as to instruct the target group copy node proxy device to control the target group copy node to execute group copy;
when the group copy state indicates that the group copy efficiency of the target group copy node lags, the group copy monitoring operation instruction is a issued group copy suspension instruction to instruct the target group copy node proxy device to control the target group copy node to suspend group copy.
8. A group replication status monitoring device, wherein the group replication status monitoring device is in communication connection with at least one group replication node proxy device, one of the group replication node proxy devices corresponding to a group replication node of a MYSQL database; comprising the following steps:
the second sending module is used for sending a group replication state query instruction to a 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 a 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 a MYSQL database;
the second receiving module is used for receiving the group copying state fed back by the target group copying node proxy device based on the group copying state query instruction and judging whether the group copying state of the target group copying node is normal or not according to the group copying state through a preset rule;
the second control module is used for issuing a group copy monitoring operation instruction to the target group copy node proxy device according to the group copy state of the target group copy node when the group copy state of the target group copy node is abnormal, so as to instruct the target group copy node proxy device to execute an operation corresponding to the group copy monitoring operation instruction on the target group copy node;
wherein, the second control module is used for:
when the target group replication node cannot be accessed, issuing a group replication function starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to start the group replication function of the target group replication node;
when the target group replication node is in an offline state, issuing a group replication starting instruction to the target group replication node proxy device so as to instruct the target group replication node proxy device to control the target group replication node to execute group replication;
and when the group copying efficiency of the target group copying node is lagged, issuing a group copying pause instruction to the target group copying node proxy device so as to instruct the target group copying node proxy device to control the target group copying node to pause the group copying.
9. A MYSQL database group replication status monitoring system comprising the group replication status monitoring device of claim 8 and at least one group replication node proxy device of claim 7 communicatively coupled to the group replication status monitoring device 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 CN113010599A (en) 2021-06-22
CN113010599B true 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11995100B2 (en) 2022-09-23 2024-05-28 Nutanix, Inc. System and method for highly available database service

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
USD886143S1 (en) 2018-12-14 2020-06-02 Nutanix, Inc. Display screen or portion thereof with a user interface for database time-machine
US10817157B2 (en) 2018-12-20 2020-10-27 Nutanix, Inc. User interface for database management services
US11010336B2 (en) 2018-12-27 2021-05-18 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
US11604705B2 (en) 2020-08-14 2023-03-14 Nutanix, Inc. System and method for cloning as SQL server AG databases in a hyperconverged 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
US11604806B2 (en) 2020-12-28 2023-03-14 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

Citations (5)

* 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
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
CN108599996A (en) * 2018-04-03 2018-09-28 武汉斗鱼网络科技有限公司 Fault handling method, device and the terminal of data-base cluster
CN110463255A (en) * 2017-03-23 2019-11-15 三星电子株式会社 For handling the method and apparatus for being used to be grouped the data of duplication

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810076B (en) * 2012-11-15 2017-09-29 国家电网公司 The monitoring method and device of data duplication
CN104283710A (en) * 2014-08-18 2015-01-14 四川长虹电器股份有限公司 Database cluster fault handling method and management server
EP3366062B1 (en) * 2015-10-20 2021-09-08 Parallel Wireless, Inc. X2 protocol programmability
CN110019500A (en) * 2017-08-21 2019-07-16 东软集团股份有限公司 A kind of copy group method for monitoring state, device, equipment and storage medium

Patent Citations (5)

* 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
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
CN110463255A (en) * 2017-03-23 2019-11-15 三星电子株式会社 For handling the method and apparatus for being used to be grouped the data of duplication
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组复制技术数据备份策略实现;朱崇来;《电子世界》;193+195 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11995100B2 (en) 2022-09-23 2024-05-28 Nutanix, Inc. System and method for highly available database service

Also Published As

Publication number Publication date
CN113010599A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN113010599B (en) MYSQL database group replication state monitoring method, device and system
CN102455915A (en) Method for automatically configuring distributed system, and server
CN110011875B (en) Dial testing method, device, equipment and computer readable storage medium
CN109039724B (en) Log uploading method and device
CN109768980B (en) Server access method, device, mobile terminal and computer readable storage medium
US11956114B2 (en) Device management method, apparatus, and system, device, and storage medium
CN111694620B (en) Interaction method, device and equipment of third party service and computer storage medium
CN108156024B (en) Method, system and storage medium for detecting availability based on distributed website
CN112383507A (en) Firewall policy management method, device and system and computer readable storage medium
US9026582B2 (en) Device management methods and related apparatus for enhancing applicability of status messages in response to commands
CN111857772A (en) Method and equipment for remote transmission and dynamic loading of terminal edge application program
CN117389843B (en) Intelligent operation and maintenance system, method, electronic equipment and storage medium
CN117472673B (en) Automatic test method, system and related equipment for interrupt controller
CN115102857A (en) Method, device, equipment and storage medium for updating client configuration data
US20040268114A1 (en) Electronic apparatus and parameter updating method
CN104158906A (en) Server agent manipulation system and manipulation method
CN104423963A (en) Control program management device, information processing device, and control program processing method
CN113553163B (en) Deployment method and device for Jenkins application based on scheduler
CN112558985B (en) Sub-application deployment method and device
CN105260316A (en) Dynamic testing method, device and system for software system
CN114500510B (en) Request information response method, apparatus, communication device and storage medium
CN116321064A (en) Vehicle remote control method, device, system and server
KR101480293B1 (en) Distributed filesystem processing device and method, and storage media storing the same
CN110266762B (en) Data uploading method, system, device and storage medium
CN105763511A (en) Business processing method and communication system

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