Master-slave switching method and device for database cluster nodes, equipment and medium

A database and node technology, applied in the database field, can solve problems such as high development and maintenance costs, long master-slave switching time, and large performance loss, and achieve the effect of transparent master-slave switching access

Inactive Publication Date: 2020-05-26
GUANGZHOU HUYA TECH CO LTD
View PDF8 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the prior art, the Mysql instance is mainly based on the proxy layer or the client SDK (Software Development Kit, software development kit) to achieve master-slave switching, but there are many shortcomings, for example, the business user needs to manually maintain the access address of the master-slave cluster , switch to other available nodes when the current cluster node is unavailable; when the database proxy layer implements master-slave switching, it is necessary to develop the database proxy layer switching service, which has high development and maintenance costs and large performance loss; the client SDK implements instance intrusion and development during iteration High maintenance costs; when the business side configures the host (Host) solution, it needs to manually replace the local Host file, and the service will not take effect until the Host is restarted, resulting in a long time for master-slave switching, etc.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Master-slave switching method and device for database cluster nodes, equipment and medium
  • Master-slave switching method and device for database cluster nodes, equipment and medium
  • Master-slave switching method and device for database cluster nodes, equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0027] figure 1 This is a flowchart of a method for master-slave switching of database cluster nodes based on a name service provided by the first embodiment of the present invention. This embodiment can be applied to the situation that master-slave switching is required when a database cluster node fails. This method can be implemented by the present invention. The name service-based cluster node master-slave switching device provided in any embodiment is executed. The device may be composed of hardware and / or software, and may generally be integrated in computer equipment, such as computer equipment running a database management system.

[0028] like figure 1 As mentioned above, the method for master-slave switching of database cluster nodes based on the name service provided by this embodiment includes the following steps:

[0029] S110. Determine that the first master node is faulty, wherein the first master node is configured to establish master-master synchronization wi...

Embodiment 2

[0053] This embodiment is embodied on the basis of the above embodiments, wherein, after setting the first slave node and the second master node to establish master-master synchronization, it further includes:

[0054] Registering the name of the first master node and the original access address of the instance of the first slave node to a matching name server, updating the registered information in the name server, so that the name server will use the updated registration The information is pushed to the host DNS (Domain Name System, domain name system) proxy component in real time;

[0055] Wherein, the host DNS proxy component is configured to intercept and analyze the DNS request of the application service, and respond to the DNS request based on the name service when the DNS request points to an internal LAN.

[0056] like image 3 As shown, the method of this embodiment specifically includes:

[0057] S310. Determine that the first master node is faulty, wherein the fi...

Embodiment 3

[0077] Figure 5 This is a schematic diagram of the module structure of an apparatus for master-slave switching of database cluster nodes based on a name service provided by Embodiment 3 of the present invention. It is implemented in software and / or hardware, and can generally be integrated in a computer device, such as a computer device running a database management system. like Figure 5 As shown, the device includes: a fault detection module 510 , a master node access address replacement module 520 and a master master synchronization setting module 530 . in,

[0078] The fault detection module 510 is configured to determine that the first master node is faulty, wherein the first master node is configured to establish master-master synchronization with the second master node, and the first master node is configured to establish master-master synchronization with the first slave node. from sync;

[0079] The master node access address replacement module 520 is configured ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses a master-slave switching method and device for database cluster nodes, equipment and a medium. The method comprises the steps of determining that a first master node breaks down, wherein the first master node is set to establish master-master synchronization with a second master node, and the first master node is set to establish master-slave synchronization with a first slave node; taking the instance original access address of the first slave node as an instance current access address of the first master node to replace the instance original access address of the first master node; and setting the first slave node and the second master node to establish master-master synchronization, so that an application service continues to access a database according to the name of the first master node. According to the technical scheme, when the cluster node breaks down, the cluster node automatically switches to an available node; transparent master-slave switching access is achieved; and a service user does not perceive switching.

Description

technical field [0001] Embodiments of the present invention relate to database technology, and in particular, to a method, apparatus, device and medium for master-slave switching of database cluster nodes. Background technique [0002] Mysql is a relational database management system that keeps data in different tables instead of putting all the data in one big data warehouse to increase processing speed and increase flexibility. However, the original high availability features of MySQL are not enough to support various accidents in the production environment. For example, after the machine where the Mysql instance is located goes down, this will make the Mysql instance unavailable. In view of this situation, the best solution is to switch the Mysql standby instance to the primary to provide normal services. [0003] In the prior art, Mysql instances are mainly based on the proxy layer or client SDK (Software Development Kit, software development kit) to achieve master-sla...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04L12/24H04L29/08H04L29/12
CPCH04L41/0663H04L67/1095H04L61/4511
Inventor 张波王华夏毛茂德
Owner GUANGZHOU HUYA TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products