High-availability solving method and device of database cluster

A solution method and database technology, applied in the field of high-availability solutions and devices of database clusters, can solve the problems of unusable, non-existent, and main database master downtime of MySQL database clusters.

Inactive Publication Date: 2015-04-15
BEIJING QIHOO TECH CO LTD +1
View PDF4 Cites 27 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In the actual use of the mysql database, the master database master may go down due to various reasons, such as system failures, hardware failures, etc., which may cause the master database to go down, making the entire mysql database cluster unusable. There is no effective technical means to solve this problem in the existing technology

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
  • High-availability solving method and device of database cluster
  • High-availability solving method and device of database cluster
  • High-availability solving method and device of database cluster

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0066] Embodiments of the present invention provide a high-availability solution for database clusters, which can be implemented in database clusters. When the master database in the database cluster cannot provide services, an alternative slave database can be immediately selected as the new master database. Ensure the normal operation of the database cluster.

[0067] figure 2 It is a schematic flowchart of a high-availability solution method for a database cluster provided in this embodiment, and the method includes steps S202 to S206.

[0068] S202: Obtain a list of all slave databases of the database cluster when the master database of the database cluster cannot provide services.

[0069] S204: According to the preset condition, among all the slave databases recorded in the list, one slave database is selected as a new master database.

[0070] S206: Switch the master database of the database cluster to the above-mentioned new master database.

[0071] The present in...

Embodiment 2

[0073] This embodiment is a specific application scenario of the first embodiment above. Through this embodiment, the method provided by the present invention can be described more clearly and specifically.

[0074] It should be understood that the present invention does not limit the type of database, as long as the following solutions of the present invention can be applied to achieve high availability, all databases are applicable here. In addition, the connection control device is not limited to be implemented by a server, and those skilled in the art can also implement the connection control device in other ways on the basis of reading the present invention, all of which should fall within the scope of the present invention .

[0075] Below, will take Mysql data as an example to illustrate the technical solution of the present invention:

[0076] In order to describe the method provided by the embodiment of the present invention more clearly, in the second embodiment, th...

Embodiment 3

[0122] Figure 6 It is a structural block diagram of a high-availability solution device for a database cluster provided by an embodiment of the present invention. The database cluster adopts a master-slave structure. The device 600 includes:

[0123] The list acquisition module 610 is adapted to acquire a list of all slave databases of the database when the master database of the database cluster cannot provide services;

[0124] The master database screening module 620 is adapted to select a slave database as a new master database among all the slave databases recorded in the above list according to preset conditions;

[0125] The switching module 630 is adapted to switch the primary database of the database cluster to the above-mentioned new primary database.

[0126] Optionally, all IP addresses corresponding to the slave databases are recorded in the above list.

[0127] Optionally, the master database screening module 620 is further adapted to select a vital slave data...

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 provides a high-availability solving method and device of a database cluster and belongs to the field of computers. The method comprises the following steps: when a main database of the database cluster cannot provide services, obtaining a list of all sub-databases in the database cluster; screening one sub-database in all the sub-databases recorded by the list as a new main database; switching the main database of the database cluster to the new main database; and automatically selecting one sub-database and switching the sub-database into the new main database when the main database of the database cluster cannot provide services due to reasons including failures and the like, guaranteeing complete data and recovering the services in extremely short time.

Description

technical field [0001] The invention relates to the field of computers, in particular to a high-availability solution method and device for database clusters. Background technique [0002] At present, relational databases are widely used, such as Mysql database. At present, the architecture of one master and multiple slaves is mostly used in relational database clusters. Such as figure 1 As shown, it is a schematic diagram of the architecture of a mysql database cluster, which includes: the master database master and three slave databases, and the three slave databases are: [0003] Slave-1, Slave-2 and Slave3. [0004] For example figure 1 As shown in , Slave-1 and Slave-2 are located in computer room 1, and Slave3 is located in computer room 2. The main database master is respectively connected with the slave databases Slave-1, Slave-2 and Slave3. [0005] In the actual use of the mysql database, the master database master may go down due to various reasons, such as ...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30G06F11/14
CPCG06F16/27
Inventor 杨挺
Owner BEIJING QIHOO 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