Database access method, system and device and readable storage medium

A database and master database technology, applied in the field of database access, can solve problems such as loss of high availability, long time, large business impact, etc., and achieve the effect of high availability access

CN112286738APending Publication Date: 2021-01-29政采云有限公司
0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2021-01-29

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a database access method. The method comprises the steps of detecting an identity of a to-be-detected node; when the identity of the to-be-tested node changes, judging whetherthe current identity of the to-be-tested node is a main node or not; if so, registering the address and the port of the main node to a registration center; establishing a first corresponding relationship between the main node and the write server through the registration center, wherein the application program accesses a main database located at the main node through the write server. By utilizingthe service discovery characteristic of the registration center, the application program can access the main database located at the main node through the write server without worrying about whetherthe IPs of the write node database and the read-only node database are changed or not, the application is not perceived during database fault switching, the execution of the service is not influenced,and high-availability access of the domain name after database fault switching is realized. The invention furthermore provides a database access system and device, and a readable storage medium, which have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The present application relates to the field of database access, in particular to a database access method, system, device and readable storage medium. Background technique

[0002] For Internet companies, the use of databases is becoming more and more extensive, and the availability of database services is becoming more and more important. In order to achieve high availability of database services, currently more commonly used or relatively mature solutions are based on high availability software MHA (Master High Availability) to manage databases.

[0003] MHA is a script management tool written in Perl language. This tool is an excellent high-availability software for failover and master-slave promotion in a high-availability database environment. In the process of database failover, MHA can complete the database failover operation within 0~30s, and in the process of failover, MHA can ensure the consistency of data to the greatest extent, so as to a...

Examples

Embodiment Construction

[0046] The core of the present application is to provide a method, system, device and readable storage medium for database access, which are used to realize highly available domain name access after database failover.

[0047] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

[0048] Please refer to figure 1 , figure 1 It is a flow chart of a database access method provided by the embodiment of this applic...