Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for switching master database and slave database

A master database and database technology, applied in the computer field, can solve problems such as inability to effectively perform master-slave switching, and achieve the effect of avoiding data access errors and fast switching

Pending Publication Date: 2022-07-12
QILIN HESHENG NETWORK TECH INC
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The embodiment of the present application provides a master-slave database switching method and device, which are used to solve the problem that the current database master-slave switching scheme has limitations, resulting in the inability to effectively perform master-slave switching

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
  • Method and device for switching master database and slave database
  • Method and device for switching master database and slave database
  • Method and device for switching master database and slave database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described The embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of this application.

[0042] At present, when using the MHA high availability software to switch the master-slave database, the master-slave switch may not be successful in some cases. For example, the high-availability service of MHA is a single-point service. When the MHA fails, the service of master-slave switchover cannot be provided. For an...

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 invention discloses a method and a device for switching master and slave databases. The method comprises the following steps: monitoring instance state information of multiple groups of databases; for the first group of databases, determining whether the first database has a fault according to the monitoring result, the first database being a main database in the first group of databases; under the condition that it is determined that the first database breaks down, target databases in second databases are determined, the second databases are slave databases of the first database, and the target databases comprise the database with the smallest data difference with the first database in the second databases; switching the target database into a new main database; and redirecting the main database domain name of the first group of databases as the domain name of the target database. Whether the master database breaks down or not can be accurately judged by monitoring the instance state information of the databases, and when the master database breaks down, the database with the smallest data difference with the master database in the slave databases is switched into the new master database, so that rapid switching of the master database and the slave databases can be achieved.

Description

technical field [0001] The present application relates to the field of computer technology, and in particular, to a method and device for switching a master-slave database. Background technique [0002] At present, in order to improve the high availability of the database, the database service is usually provided by the database cluster. A database cluster can include a master database and one or more slave databases. The master database provides normal database services to the outside world. The slave database maintains data consistency with the master database in real time or asynchronously in some ways. One of them switches from the database to the main database and continues to provide services to the outside world. [0003] When switching the master-slave database, it can usually be realized by using the high-availability software MHA (Master High Availability). However, in practical applications, MHA has certain limitations, which makes it impossible to effectively p...

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): G06F11/07G06F11/30
CPCG06F11/0709G06F11/0793G06F11/3006
Inventor 王小兵吴宏亮李涛
Owner QILIN HESHENG NETWORK TECH INC
Features
  • Generate Ideas
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More