Database fault handling method and apparatus, and database system

A fault handling method and database technology, which are applied in the fields of electrical digital data processing, special data processing applications, database distribution/replication, etc., can solve problems such as affecting the operation efficiency of Redis database and the quality of service provision.

Inactive Publication Date: 2015-08-26
BEIJING QIHOO TECH CO LTD
View PDF5 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, in the prior art, when the Redis database selects a new master database from the database, it selects by random selection
Such a defect is that each instance of the slave database is di

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
  • Database fault handling method and apparatus, and database system
  • Database fault handling method and apparatus, and database system
  • Database fault handling method and apparatus, and database system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0076] The embodiment of the present invention provides a database fault handling method, which can be implemented in a database cluster. When the primary database fails to provide services, a secondary database on a server with a strong business carrying capacity can be selected as the new primary database. , to ensure normal service.

[0077] figure 1 It is a schematic flowchart of a database fault handling method provided in this embodiment, and the method is applied to a database cluster with a master-slave structure, including steps S102 to S108.

[0078] S102: Collect usage status information of at least one server corresponding to the master database where a slave database is located when a failure of the master database is detected.

[0079] S104: Analyzing the use status information of the server where each slave database is located, and determining the available service carrying capacity of the server where each slave database is located.

[0080] S106: Compare the...

Embodiment 2

[0084] 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.

[0085] It should be understood that the present invention does not limit the type of the database, as long as the following solution of the present invention can be applied to achieve the purpose of switching from the database to the database applicable here. On the basis of reading the present invention, those skilled in the art can also realize the switching of the master-slave database through simple combination of steps and conversion between steps, which should be covered within the scope of the present invention.

[0086] In this embodiment, the technical solution of the present invention will be described by taking the Redis database as an example:

[0087] In order to describe the method provided by the embodiment of the present invention more clearly, in the seco...

Embodiment 3

[0126] Figure 5 It is a structural block diagram of a database fault processing device provided by an embodiment of the present invention, which is applied to a database cluster with a master-slave structure. The device 500 includes:

[0127] The information collection module 510 is adapted to collect the use status information of at least one slave database corresponding to the server where the master database is located when a fault occurs in the master database;

[0128] The information analysis module 520 is adapted to analyze the use status information of the server where each slave database is located, and determine the available service carrying capacity of the server where each slave database is located;

[0129] The slave database selection module 530 is adapted to compare the available service carrying capacity of the servers where the slave databases are located, and select the slave database with the largest available service carrying capacity; and

[0130] The r...

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 present invention, relating to the field of computers, provides a database fault handling method and apparatus, and a database system. According to embodiments of the present invention, when a primary database encounters a fault, use state information is collected from a server where a secondary database is located, available service bearing capabilities of the servers where various secondary databases are located are determined according to the use state information, and a database corresponding to a server which has the best available service bearing capability from the servers is selected as a new primary database. According to the present invention, when a primary database encounters a fault and fails to provide services, a secondary database corresponding to a server which has the best service bearing capability can be selected as a new primary database, thereby preventing the problem of service interruption or low running efficiency due to improper selection of the new primary database.

Description

technical field [0001] The invention relates to the field of computers, in particular to a database fault handling method, device and database system. Background technique [0002] Redis is an in-memory database, characterized by fast reading and writing speeds. It is an open-source, log-type, Key-Value database that is written in ANSI C language, supports the network, and can be memory-based or persistent. Redis supports master-slave synchronization. [0003] The Redis database supports a master-slave architecture, which can synchronize data from the master database to any number of slave databases. During the operation of the Redis database, when the master database fails, in order to ensure the normal operation of the Redis database, a slave database will be selected from the current slave database as the new master database. [0004] However, in the prior art, when the Redis database selects a new primary database from the databases, it selects by random selection. Su...

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): G06F17/30
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