CN110069365A - Manage the method and corresponding device, computer readable storage medium of database - Google Patents

Manage the method and corresponding device, computer readable storage medium of database Download PDF

Info

Publication number
CN110069365A
CN110069365A CN201910353959.6A CN201910353959A CN110069365A CN 110069365 A CN110069365 A CN 110069365A CN 201910353959 A CN201910353959 A CN 201910353959A CN 110069365 A CN110069365 A CN 110069365A
Authority
CN
China
Prior art keywords
database
management server
primary
primary database
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910353959.6A
Other languages
Chinese (zh)
Other versions
CN110069365B (en
Inventor
姜承尧
赖明星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910353959.6A priority Critical patent/CN110069365B/en
Publication of CN110069365A publication Critical patent/CN110069365A/en
Application granted granted Critical
Publication of CN110069365B publication Critical patent/CN110069365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1466Management of the backup or restore process to make the backup process non-disruptive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

Present disclose provides a kind of methods and corresponding server, computer readable storage medium for managing database.This method comprises: receiving the running state information of primary database;The operating status of the primary database is determined according to the running state information of the primary database;When the operating status for determining the primary database is that the primary database breaks down, from least two select from database one from database as new primary database;And to sending the information about new primary database from the corresponding management server proxy module of database from other in database with described at least two respectively, by with it is described other from the corresponding management server proxy module control of database it is described other from database from new primary database Backup Data.

Description

Manage the method and corresponding device, computer readable storage medium of database
Technical field
This disclosure relates to database field, and in particular, to a kind of method for managing database and corresponding device, Computer readable storage medium.
Background technique
Infrastructure of the database as storing data, is widely used in the various products of internet area.For having Data volume is big, products to characteristics such as response delay requirement height, business complexity, in order to support the load of product business, especially Instantaneous superelevation load, it has been proposed that use data-base cluster.Data-base cluster may include a primary database and one Or it is multiple from database, wherein primary database is responsible for the write-in of data, be responsible for the reading of data from database, and from database It can be from primary database Backup Data (or being referred to as synchrodata or replicate data).In data-base cluster, work as master When database breaks down, it can will be promoted to primary database from database, and to reduce the downtime of business, keep database The high degree of availability of service.
In order to guarantee the data consistency of each database in data-base cluster, the O&M of data-base cluster is improved, Some general data base management systems have been proposed.For example, including using extensive data base management system at present Keepalived system, cloud Database Systems and primary database high-availability system (Master High Availability, MHA).However, there are various defects for these existing data base management systems, for example, cannot support the extension from database with Meet that the read-write demand of superelevation load, self-healing ability is not strong and can not manage that a large amount of data-base cluster, there are safety issues It is unable to satisfy the conjunction rule requirement etc. of financial scenario.
Summary of the invention
For this purpose, the method and corresponding device, computer-readable storage that present disclose provides a kind of for managing database Medium.
According to one aspect of the disclosure, a kind of method for managing database is provided.The described method includes: receiving The running state information of primary database;The operation shape of the primary database is determined according to the running state information of the primary database State;When the operating status for determining the primary database is that the primary database breaks down, from least two from database Select one from database as new primary database;And to respectively with described at least two from other in database from number Send the information about new primary database according to the corresponding management server proxy module in library, by with it is described other from database The control of corresponding management server proxy module it is described other from database from new primary database Backup Data.
According to another aspect of the present disclosure, it provides a kind of for managing the device of database.Described device includes: to receive Unit is configured as receiving the running state information of primary database;Determination unit is configured as the fortune according to the primary database Row status information determines the operating status of the primary database;Selecting unit is configured as working as described in determination unit determination The operating status of primary database is the primary database when breaking down, from least two select from database one from data Library is as new primary database;And transmission unit, it is configured as to respectively with described at least two from other in database Send the information about new primary database from the corresponding management server proxy module of database, by with it is described other from number According to the control of the corresponding management server proxy module in library it is described other from database from new primary database Backup Data.
According to the disclosure example, receiving unit is configured as from management server corresponding with the primary database Proxy module receives the running state information of the primary database.
According to the disclosure example, receiving unit be configured as from described at least two from database at least One receives the running state information of the primary database from the corresponding management server proxy module of database.
According to the disclosure example, selecting unit is configured as determining candidate's from described at least two from database From database;And selected from the slave database of the candidate one from database as new primary database.
According to the disclosure example, selecting unit be configured to determine that described at least two from database its affairs Mark be managed server acquisition slave database, wherein the management server for manage the primary database and it is described extremely Lack two from database;Whether it is greater than described at least two from the quantity of database from the quantity of database determined by judgement Predetermined ratio;When it is identified from the quantity of database be greater than described at least two from the predetermined ratio of the quantity of database when, It is determined as candidate slave database from database for identified;And selected from the slave database of the candidate one from number According to library as new primary database.
According to the disclosure example, each there is its priority for serving as primary database from database;Selecting unit It is configured as the priority according at least to each of slave database of the candidate from database, from the slave data of the candidate Selected in library one from database as new primary database.
According to the disclosure example, selecting unit be configured as according to each of slave database of the candidate from The priority and Transaction Identifier of database, selected from the slave database of the candidate one from database as new master data Library.
According to the disclosure example, selecting unit is configured as having highest in the slave database for judging the candidate Whether the slave database of priority has maximum transaction mark;And when the slave database with highest priority has most major issue When business mark, using the slave database with highest priority as new primary database.
According to the disclosure example, selecting unit is configured as working as, and there is the slave database of highest priority not have When maximum transaction identifies, pass through management server proxy module corresponding with the slave database with highest priority, control tool There is the slave database of highest priority from the slave database back-up data identified with maximum transaction, so that having highest preferential The slave database of grade is identified with maximum transaction;And using the slave database with highest priority as new primary database.
According to the disclosure example, transmission unit is configured as taking to management corresponding with the new primary database Device proxy module of being engaged in sends configuration information, wherein the configuration information indicate the new primary database and it is described other from data Replicanism between library, so that management server proxy module corresponding with the new primary database controls the new master Database uses the replicanism.
According to the disclosure example, transmission unit is configured as to management server corresponding with the primary database Proxy module sends restoration information, so that management server proxy module corresponding with the primary database repairs the master data Library.
According to another aspect of the present disclosure, it provides a kind of for managing the device of database.The management server packet Include processor;And memory, wherein computer-readable code, the computer-readable code are stored in the memory When being run by the processor, the above method is executed.
According to another aspect of the present disclosure, a kind of computer readable storage medium is provided, instruction is stored thereon with, it is described Instruction by processor when being run, so that the processor executes the above method.
By disclosed method and corresponding device, computer readable storage medium, when primary database breaks down, One can be selected from database as new primary database, to ensure the High Availabitity of database service from multiple.In addition, logical Disclosed method and corresponding device, computer readable storage medium are crossed, management server acts on behalf of mould by management server Block operates database, avoids relying on SSH and operates to database, meets the compliance requirement of financial scenario.
Detailed description of the invention
The embodiment of the present disclosure is described in more detail in conjunction with the accompanying drawings, the above-mentioned and other purpose of the disclosure, Feature and advantage will be apparent.Attached drawing is used to provide to further understand the embodiment of the present disclosure, and constitutes explanation A part of book is used to explain the disclosure together with the embodiment of the present disclosure, does not constitute the limitation to the disclosure.In the accompanying drawings, Identical reference label typically represents same parts or step.
Fig. 1 shows the configuration diagram of keepalived system.
Fig. 2 shows the configuration diagrams of cloud Database Systems.
Fig. 3 shows the configuration diagram of MHA system.
Fig. 4 A is the configuration diagram according to the data base management system of the embodiment of the present disclosure.
Fig. 4 B is the schematic diagram of the database in the data base management system according to the embodiment of the present disclosure.
Fig. 5 is the flow chart according to the method for the embodiment of the present disclosure executed by management server.
Fig. 6 is an illustrative detailed process of the framework according to shown in the application drawing 4A of the embodiment of the present disclosure.
Fig. 7 is the framework signal according to the realization management server High Availabitity and system library High Availabitity of the embodiment of the present disclosure Figure.
Fig. 8 shows the structural schematic diagram of the management server according to the embodiment of the present disclosure.
Fig. 9 shows the framework of the computer equipment according to the embodiment of the present disclosure.
Specific embodiment
In order to enable the purposes, technical schemes and advantages of the disclosure become apparent, root is described in detail below with reference to accompanying drawings According to the example embodiment of the disclosure.In the accompanying drawings, identical reference label indicates identical element from beginning to end.It is understood that The embodiments described herein is merely illustrative, and is not necessarily to be construed as limiting the scope of the present disclosure.
Firstly, -3 describing existing keepalived system, cloud Database Systems and MHA system respectively referring to Fig.1.Figure 1 shows the configuration diagram of keepalived system.As shown in Figure 1, keepalived system includes a primary database 110 With one from database 120.When primary database 110 breaks down, new master data can be promoted to from database 120 Library.Since keepalived system is only supported one main one from can not be extended to from database, therefore, be not suitable for database The application scenarios that example is more or database loads are more.In addition, in keepalived system, when primary database breaks down When, primary database does not have any self-healing ability.
Cloud Database Systems have more advantage relative to keepalived system.Specifically, cloud Database Systems are one Main one on the basis of, increases one or more read-only from database, is extended, provides to from database to realize Better reading extended capability.In addition, the database self-healing component of a set of complexity is devised in cloud Database Systems, so as to Make primary database self-healing when primary database breaks down.
Fig. 2 shows the configuration diagrams of cloud Database Systems.As shown in Fig. 2, cloud Database Systems include a main number According to 210, one, library from database 220 and three it is read-only from database 230,240 and 250 (with dotted line and main number i.e. in Fig. 2 The database connected according to library 210).When primary database 210 breaks down, master data only can be promoted to from database 220 Library.In addition, when primary database 210 breaks down, primary database 210 can be with self-healing, and after self-healing, primary database 210 It can be used as from the slave database of database 220 and from from 220 Backup Data of database.
Although cloud Database Systems overcome the defect of keepalived system, it is substantially or one one master one From database high-availability system.There are certain defects for cloud Database Systems.For example, if master data in cloud Database Systems Library and from database simultaneously break down when, can not ensure the High Availabitity of database service.In addition, due to cloud Database Systems Limitation is forced, therefore, the read-only limited amount from database in cloud Database Systems, thus can not be according to demand to from data Library is extended.In addition, in cloud Database Systems, the read-only computer room locating for the database can not be customized, to be unable to satisfy Individual demand of certain business to the geographical location of computer room.
Primary database high-availability system (Master High Availability, MHA) is the number of real one master and multiple slaves According to library high-availability system.Fig. 3 shows the configuration diagram of existing MHA system.As shown in figure 3, MHA system includes a master Database 310, four is from database 320,330,340 and 350.When primary database 310 breaks down, from database 320, 330, any one of 340 and 350 primary database can be promoted to.
However, MHA system is to be realized by script, and script can not support a series of complex of database self-healing to grasp Make, therefore, the database in MHA system does not have self-healing ability.In addition, being configured in MHA system for managing database Managing device.The managing device carries out database by safety shell protocol (Secure SHell protocol, SSH) Operation.For example, the managing device can be by the primary database in SSH timing probe cluster, and works as and detect primary database When breaking down, which can select one and to be promoted to primary database from database from multiple, and lead to Cross SSH indicate it is remaining from database from new primary database Backup Data.However, SSH has defect in secure context, such as SSH can suffer from " go-between " attack, therefore, be forbidden to use SSH under financial scenario.
There is a problem of in view of existing data base management system it is various, the present disclosure proposes one kind for one master it is more From data base management system specifically propose a kind of method for managing the database in one master and multiple slaves and corresponding Server, computer readable storage medium.By the data base management system of the disclosure, existing data base administration system is overcome The defect of system.
In the following, describing the framework of the data base management system of the disclosure referring to Fig. 4 A-4B.Fig. 4 A is according to disclosure reality Apply the configuration diagram of the data base management system of example.As shown in Figure 4 A, which includes management server 410, primary database 420, from database 430 to 450, management server proxy module 410-2 corresponding with primary database 420, And it is acted on behalf of from the corresponding management server proxy module 410-3 of database 430, with from the corresponding management server of database 440 Module 410-4 and with from the corresponding management server proxy module 410-5 of database 450.
In the framework shown in Fig. 4 A, each database can be deployed at some node in a manner of application program, example Such as, it is deployed on some server.For example, each database can be deployed in a server in a manner of existing MySQL On.In addition, management server proxy module corresponding with each database can also be deployed in some in a manner of application program At node.In addition, each database and management server proxy module corresponding with each database can be deployed in identical section At point, it can also be deployed at different nodes.In addition, primary database 420 and can be deployed in each other from database 430 to 450 At different nodes.
In addition, management server 410 passes through management server proxy module 410-2 respectively in the framework shown in Fig. 4 A It is operated to 410-5 to primary database 420 and from database 430 to 450, to realize to database 420 and from database 430 To 450 management.Specifically, management server 410 is used to control the operation to carry out to database.When management server 410 When operating to certain database, management server 410 can be to management server proxy module corresponding with the database Send instruction, then, management server proxy module corresponding with the database according to the instruction received to the database into Row operation.For example, management server proxy module corresponding with the database can according to the instruction received, pass through SQL language Speech operates the database.Here " operation " may include the switching of database, modification, creation, deletion, installation, again One or more of open, unload, starting duplication, setting replicanism etc..By framework shown in Fig. 4 A, when primary database is sent out When raw failure, one can be selected from database as new primary database, to ensure that the height of database service can from multiple With.In addition, when primary database breaks down, which has self-healing ability, so as to effective by this framework Ground reduces manually-operated number, improves O&M efficiency.In addition, avoiding relying on SSH by this framework and being carried out to database Operation meets the compliance requirement of financial scenario.
In addition, data base management system shown in Fig. 4 A can also include system library 410-1, so as to management server 410 Instance metadata is stored, thus the information of persisted instances.
In addition, data base management system shown in Fig. 4 A can also include that one or more is read-only from database, to realize To the extension from database, extended capability is preferably read to provide.It includes one that Fig. 4 A, which shows the data base management system, It is read-only from database, i.e., from database 460.In addition, the framework can also include with from the corresponding management server of database 460 Proxy module 410-6.
In addition, in the framework shown in Fig. 4 A, it is each to be located in a different geographical location from database.For example, from number The first city can be located at according to library 430 to 450, the second city can be located at from database 460.Disposing in this way is advantageous in that, When the business in the second city wants the data of reading database cluster, the slave database in the second city need to be only read, without reading The slave database in the first city, across city access when so as to avoid business reading database reduce from the second city to Across the city network delay in one city.
Fig. 4 B is the schematic diagram of the database in the data base management system according to the embodiment of the present disclosure.As shown in Figure 4 B, The data base management system has five databases, respectively primary database 420, from database 430 to 450 and read-only from data Library 460, wherein be located at the first city (as shown in the white box in Fig. 4 B) from database 430 to 450, it is read-only from database 460 Positioned at the second city (as shown in the grey box in Fig. 4 B).Primary database 420 is responsible for the write-in of data, from database 430,440, 450 and the read-only reading for being responsible for data from database 460, and from database 430,440,450 and it is read-only can from database 460 With from 420 Backup Data of primary database.When primary database 420 breaks down, from any in database 430,440 and 450 One can be promoted to primary database, and read-only cannot be promoted to primary database from database 460.For example, working as master data When library 420 is broken down, it is promoted to primary database from database 440, then is responsible for the write-in of data from database 440, from number According to library 430,450 and the read-only reading for being responsible for data from database 460, and from database 430,450 and read-only from database 460 can be from from 440 Backup Data of database.
It will be appreciated that although being illustrated in figures 4A and 4 B a management server, a system library, a master data Library and four are from database, but this is only schematical.The framework may include more management servers, and/or more System library, and/or more primary databases, and/or less or more from database.
The method of the execution of the management server as shown in Fig. 4 A is described below in conjunction with Fig. 5.Specifically, Fig. 5 will be combined To describe the method that the master-slave database of the execution of the management server as shown in Fig. 4 A switches.Fig. 5 is according to the embodiment of the present disclosure By management server execute method 500 flow chart.In method 500, management server is for managing a master data Library and at least two is from database.Here " at least two from database " can not include read-only from database.For example, scheming In the example of 4A, " at least two from database " may include from database 430 to 450.
As shown in figure 5, management server receives the running state information of primary database in step S501.Primary database Running state information can indicate the operating status of primary database.The operating status of primary database can not sent out for primary database Raw failure.Alternatively, the operating status of primary database can also break down for primary database.
According to the disclosure example, when deployment primary database and management server corresponding with primary database act on behalf of mould When the node of block does not break down, management server can be received from management server proxy module corresponding with primary database and be led The running state information of database.In this example, management server can be periodically from management corresponding with primary database The running state information of server agent module reception primary database.Alternatively, management server can aperiodically from Management server proxy module corresponding with primary database receives the running state information of primary database.
Primary database periodically is received from management server proxy module corresponding with primary database in management server Running state information situation in, management server can periodically from management server corresponding with primary database act on behalf of Module receives the heartbeat message of primary database, and wherein the heartbeat message of the primary database includes the operating status letter of primary database Breath.
For example, the heartbeat mechanism between management server and primary database can be preset.It is main under the heartbeat mechanism Database can be used as the client of management server and periodically report the heartbeat message of primary database to management server, And the heartbeat message of the primary database includes the running state information of primary database.Specifically, primary database can be according to certainly The operating status of body periodically generates the running state information of primary database, and includes by the running state information of primary database In the heartbeat message of primary database.Then, management server proxy module corresponding with primary database can be to management service The heartbeat message of device transmission primary database.Correspondingly, management server can be from management server generation corresponding with primary database The heartbeat message that module receives primary database is managed, to receive the running state information of primary database.
Master data aperiodically is received from management server proxy module corresponding with primary database in management server In the situation of the running state information in library, management server can be to management server proxy module wheel corresponding with primary database Ask the running state information of primary database.
However, when the nodes break down of deployment primary database and management server proxy module corresponding with primary database When, management server possibly can not receive the operation shape of primary database from management server proxy module corresponding with primary database State information.Therefore, management server can preset waiting time (for example, 24 seconds), as can not be from when management server Management server will wait when management server proxy module corresponding with primary database receives the running state information of primary database To time.When management server can not still connect from management server proxy module corresponding with primary database within the waiting time When receiving the running state information of primary database, deployment primary database and management server generation corresponding with primary database can be determined Failure has occurred in the node of reason module, then management server can be believed by the operating status for receiving primary database from database Breath.It is had received conversely, working as the management server within the waiting time from management server proxy module corresponding with primary database When the running state information of primary database, management server need not be by the operating status for receiving primary database from database Information.
Be described below management server by from database come receive primary database running state information example.Root According to an example of the disclosure, management server can be from corresponding from least one of database from database at least two Management server proxy module receive primary database running state information.In this example, management server can be with the period Property receive main number from least one of database from the corresponding management server proxy module of database from at least two According to the running state information in library.Alternatively, management server can aperiodically from at least two from database At least one receives the running state information of primary database from the corresponding management server proxy module of database.
Management server periodically from at least two from least one of database from the corresponding pipe of database Manage server agent module receive primary database running state information situation in, management server can periodically from At least two receive at least one from number from least one of database from the corresponding management server proxy module of database According to the heartbeat message in library, wherein this at least one from the heartbeat message of database include primary database running state information.
For example, management server can be preset and from the heartbeat mechanism between database.Under the heartbeat mechanism, from Database can be used as the client of management server and periodically report heartbeat message from database to management server, It and should include the running state information of primary database from the heartbeat message of database.It specifically, can be periodical from database Ground detects the operating status of primary database, is then believed according to the operating status that the operating status of primary database generates primary database Breath, and the running state information of primary database is included in from the heartbeat message of database.Then, corresponding with from database Management server proxy module can send the heartbeat message from database to management server.Correspondingly, management server can With from the heartbeat message from database is received from the corresponding management server proxy module of database, to receive primary database Running state information.
In addition, from the heartbeat message of database can also include the running state information from database.Specifically, from data Library can periodically generate the running state information from database according to the operating status of itself, and will be from the operation of database Status information is included in from the heartbeat message of database.Then, with can from the corresponding management server proxy module of database To send the heartbeat message from database to management server.Correspondingly, management server can be from corresponding with from database Management server proxy module receives the heartbeat message from database, to receive the running state information from database.
In management server aperiodically from corresponding from least one of database from database at least two Management server proxy module receives in the situation of the running state information of primary database, and management server can be to at least two It is a from least one of database from the operating status of the corresponding management server proxy module poll primary database of database Information.For example, management server can take to at least two from least one of database from the corresponding management of database The running state information for device proxy module request primary database of being engaged in.Then, master can be detected in response to the request from database Then the operating status of database generates bishop according to the running state information in library according to the operating status of primary database.Then, with The running state information of primary database can be sent to management server from the corresponding management server proxy module of database.
Fig. 5 is returned to, in step S502, management server is according to the determination of the running state information of the primary database The operating status of primary database.When the running state information of primary database instruction primary database does not break down, management service Device can determine that the operating status of primary database is that primary database does not break down.Alternatively, when the operation shape of primary database When state information instruction primary database breaks down, management server can determine the operating status of primary database for primary database hair Raw failure.
Then, in step S503, when management server determines that the operating status of the primary database is the master data When library is broken down, management server from described at least two select from database one from database as new master data Library.For example, management server can determine candidate slave databases from least two from database, then from it is described it is candidate from Selected in database one from database as new primary database.Here " candidate from database " can be one or more It is a from database.
Be described below management server determined from least two from database one of candidate slave database it is exemplary Process.
According to the disclosure example, firstly, management server can determine at least two from database its affairs Identify the slave database obtained by the management server.Specifically, management server can preset acquisition Transaction Identifier Time-out time (for example, 5 seconds).Management server can determine at least two from database its Transaction Identifier in the time-out The interior slave database obtained by the management server.
For example, management server has got the affairs mark from database 430 in time-out time in the example of Fig. 4 A Know and from the Transaction Identifier of database 440 without getting the Transaction Identifier from database 450, then management server can be with Determine that slave database that its Transaction Identifier is obtained in the time-out time by the management server is from database 430 and from number According to library 440.
" Transaction Identifier " described above may include the identification information for the affairs that primary database executed and from data The identification information for the affairs that library executed.For example, Transaction Identifier can be global transaction identifier (Global Transaction IDentifiers, GTID).Management server can determine thing that primary database executed according to from the Transaction Identifier of database Business and the affairs executed from database, so that it is determined that should be from the consistency of the data of the data and primary database of database (or being registration).For example, when the affairs that primary database executed are identical with the affairs executed from database, pipe Reason server can determine that the data from database are identical as the data of primary database.When affairs that primary database executed and When the affairs part executed from database is identical, management server can determine the data and primary database from database Data portion is identical.
In addition, at least two from database its Transaction Identifier be not managed server acquisition slave database, Management server can delete these from database, for example, these are kicked out of data-base cluster from database from data-base cluster. For example, in the example of Fig. 4 A, management server got in time-out time from the Transaction Identifier of database 430 and from The Transaction Identifier of database 440 is without getting the Transaction Identifier from database 450, then management server can will be from data Kick out of data-base cluster in library 450.
Management server determined at least two from database its Transaction Identifier obtained by the management server After database, management server may determine that whether the identified quantity from database is greater than described at least two from number According to the predetermined ratio (for example, half) of the quantity in library.It is greater than described at least two from the quantity of database when identified When from the predetermined ratio of the quantity of database, management server can be determined as candidate slave data from database for identified Library.When it is identified from the quantity of database be less than described at least two from the predetermined ratio of the quantity of database when, management clothes Business device will not be determined as candidate slave database from database for identified.
It from database is from database 430 and from database determined by management server for example, in the example of Fig. 4 A 440.From the quantity of database be 2 as determined by management server, at least two from the quantity of database be 3, and institute The quantity of determining slave database is greater than the half of at least two quantity from database, then management server can will be from Database 430 and the slave database for being determined as candidate from database 440.
It from database is from database 430 determined by management server in another example in the example of Fig. 4 A.Due to pipe Managing determined by server from the quantity of database is 1, at least two from the quantity of database be 3, and it is identified from number According to the quantity in library less than at least two from the half of the quantity of database, then management server will not will be from database 430 It is determined as candidate slave database.
After management server determines candidate slave database from least two from database, management server can be from Selected in the slave database of the candidate one from database as new primary database.According to the disclosure example, often It is a to can have its priority for serving as primary database from database.For example, management server can be in advance to each from data Its priority for serving as primary database of lab setting.For example, management server can give in advance from database in the example of Fig. 4 A 430 its priority for serving as primary database of setting are 1, are 2 to its priority for serving as primary database is arranged from database 440, And to from database 450 be arranged its priority for serving as primary database be 3.
In this example, management server can be according at least to each of slave database of the candidate from database Priority, selected from the slave database of the candidate one from database as new primary database.For example, management server It can be according to each of candidate slave database from the priority and Transaction Identifier of database, from the slave database of the candidate It is middle select one from database as new primary database.
Management server is considered when selecting new primary database from both the priority of database and Transaction Identifier, is It is necessary to.This is because, in the ideal case, the slave database with highest priority may have maximum transaction mark, That is the registration of the data of the data and primary database of the slave database with highest priority is highest.Therefore, work as management For server using the slave database with highest priority as when new primary database, other can be from highest from database The slave database back-up data of priority, to guarantee the data consistency of data-base cluster.However, under non-ideal conditions, Slave database with highest priority may not have maximum transaction and identify, i.e. the number of the slave database with highest priority Registration according to the data with primary database is not highest.Therefore, when management server is by the slave number with highest priority When according to library as new primary database, although other can be from the slave DB Backup number with highest priority from database According to, but do not ensure that the data consistency of data-base cluster.Therefore, management server can be according to the slave number of the candidate According to each of library from the priority and Transaction Identifier of database, selection has highest preferential from the slave database of the candidate The slave database of grade is as new primary database, to guarantee the data consistency of data-base cluster.
Priority and affairs of the management server according to each of candidate slave database from database is described below Mark, selects an exemplary flow from database as new primary database from the slave database of the candidate.
Management server may determine that whether the slave database in candidate slave database with highest priority has most Big Transaction Identifier.According to the disclosure example, when there is the slave database with highest priority maximum transaction to identify, Management server can be using the slave database with highest priority as new primary database.
For example, in the example of Fig. 4 A, it is candidate from database be from database 430 and from database 440, and from number It is 1 according to the priority that primary database is served as in library 430, the priority for serving as primary database from database 440 is 2, from database 440 With maximum transaction identify, then management server can by from database 440 as new primary database.
According to another example of the disclosure, when the slave database with highest priority, which does not have maximum transaction, to be identified, Management server can control the slave database with highest priority and identify with maximum transaction, then will have highest preferential The slave database of grade is as new primary database, to guarantee the data consistency of data-base cluster.
Specifically, when the slave database with highest priority, which does not have maximum transaction, to be identified, management server can be with By management server proxy module corresponding with the slave database with highest priority, control have highest priority from Database is from the slave database back-up data identified with maximum transaction, so that the slave database with highest priority has Maximum transaction mark.For example, management server can when the slave database with highest priority does not have maximum transaction and identifies To send to management server proxy module corresponding with the slave database with highest priority about with maximum transaction mark The information for the slave database known, so as to management server proxy module corresponding with the slave database with highest priority control Slave database with highest priority is from the slave database back-up data identified with maximum transaction.When with highest priority Slave database after the slave database back-up data identified with maximum transaction, with highest priority slave database energy Enough there is maximum transaction mark, then management server is using the slave database with highest priority as new primary database.
For example, in the example of Fig. 4 A, it is candidate from database be from database 430 and from database 440, and from number It is 1 according to the priority that primary database is served as in library 430, the priority for serving as primary database from database 440 is 2, from database 430 It is identified with maximum transaction, then management server can the corresponding management server proxy module 410-4 of Xiang Yucong database 440 It sends about the information from database 430, so that management server proxy module 410-4 control is from database 440 from from data 430 Backup Data of library.After from database 440 from from 430 Backup Data of database, there can be maximum from database 440 Transaction Identifier, then management server can be by the slave database 440 after Backup Data as new primary database.
In addition, as also described above, primary database is responsible for the write-in of data, it is responsible for the reading of data from database, And it can be from primary database replicate data from database.In order to forbid that data are written to from database, management server can be with Attribute (such as super read-only (super read only) option) is replicated to from data lab setting, is held with limitation to from database Row write operation.For example, management server 410 can give from database 430 to 450 and be respectively provided with super in the example of Fig. 4 A Read only option.
In the disclosure, when management server using some from database as when new primary database, can first remove From the duplication attribute of database.For example, in the example of Fig. 4 A, when management server by from database 440 as new master When database, the super read only option from database 440 can be first removed.
Return Fig. 5, in step S504, management server to respectively with described at least two from database other from The corresponding management server proxy module of database sends the information about new primary database, by with it is described other from data Library corresponding management server proxy module control it is described other from database from new primary database Backup Data.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database after, pipe Managing server can the corresponding management server proxy module 410-3 of Xiang Yucong database 430, corresponding with from database 450 Management server proxy module 410-5 is sent about the information from database 440.Management server is acted on behalf of by management server Module 410-3 can control from database 430 from from 440 Backup Data of database and management server proxy module 410-5 Control is from database 450 from from 440 Backup Data of database.
" information about new primary database " described above can be the identification information of new primary database, example Such as, the static ip address (or fixed ip address) of new primary database.The quiet of new primary database can be passed through from database State IP address, from new primary database Backup Data.For example, in the example of Fig. 4 A, management server will be from database 440 After new primary database, from database 430 and from database 450 can by the static ip address from database 440, From from 440 Backup Data of database.
After step S504, method 500 can also include step S505: management server can to the new master The corresponding management server proxy module of database sends configuration information, wherein the configuration information indicates the new master data Library and it is described other from the replicanism between database, so as to management server corresponding with new primary database agency Module controls the new primary database using the replicanism.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database after, pipe Manage server can the corresponding management server proxy module 410-4 of Xiang Yucong database 440 send configuration information, wherein this is matched The instruction of confidence breath as the slave database 440 of new primary database and from database 430, from the duplicator between database 450 System, the slave database 440 so as to management server proxy module 410-4 control as new primary database use the duplicator System.
" replicanism " described above may include complete synchronous replicanism, asynchronous replication mechanism or partly synchronize multiple Any one of making mechanism etc..In situation of the primary database using complete synchronous replicanism, primary database can according to The write operation of family instruction execution data, and after having executed the write operation of data, it is not to return to confirm to user at once Message, but wait it is all from database after primary database Backup Data again to user return confirmation message.In master data Using in the situation of asynchronous replication mechanism, primary database can execute the write operation of data according to user instructions in library, and After the write operation for having executed data, confirmation message is returned to user at once, it is standby from database from primary database without waiting Confirmation message is returned to user again after part data.In situation of the primary database using half synchronous replicanism, primary database can It is not at once to user to execute the write operation of data according to user instructions, and after having executed the write operation of data Confirmation message is returned, but waits part from database (can be arranged by parameter ack count from the quantity of database) from master Confirmation message is returned to user again after database back-up data.
In the disclosure, in new primary database and the feelings from the replicanism between database for half synchronous replicanism In shape, new primary database can execute the write operation of data according to user instructions, and in the write-in behaviour for having executed data After work, confirmation message is not returned to user not instead of at once, one or more is waited to back up from database from new primary database Confirmation message is returned to user again after data, to guarantee the data consistency of new data-base cluster.It is synchronous by using half Replicanism, though new data-base cluster is hit again, such as the primary database delay machine in new data-base cluster, but Since the data of the slave database in new data-base cluster and primary database are consistent, in new data-base cluster Slave database still ensure that the High Availabitity of database.Therefore, by using half synchronous replicanism, data base set can be assigned The ability of the anti-two-hit of group.
In addition, in the disclosure, management server can be to each data base set group configuration dynamic IP (for example, floating IP), externally to provide the unified IP of service using the dynamic IP as data-base cluster.User can be accessed by the dynamic IP Data-base cluster, such as data are written to data-base cluster by the dynamic IP.In this case, after step s 505, Method 500 can also include step S506: the dynamic IP of data-base cluster can be tied to new master data by management server Library.In this way, data can be written to data-base cluster by dynamic IP in user, without knowing in data-base cluster Which database be primary database, to improve the Experience Degree of user.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database before, pipe The Floating IP address of data-base cluster can be tied to primary database 410 by reason server.It will make from database 440 in management server After new primary database, in step S506, the Floating IP address of data-base cluster can be tied to from number by management server According to library 440.
By the above-mentioned method executed by management server, after the primary database delay machine in data-base cluster, management clothes Some can be promoted to new primary database from database by business device, so that data-base cluster, which reverts to service, can use shape State provides service to continue as user.However, the present disclosure is not limited thereto.Management server can also repair the master data of delay machine Library.According to the disclosure example, after step S506, method 500 can also include step S507: management server can To send restoration information to management server proxy module corresponding with the primary database, so as to corresponding with the primary database Management server proxy module repair the primary database.Here " restoration information " may include the instruction of restarting of database And the information about new primary database.
For example, in the example of Fig. 4 A, after 420 delay machine of primary database, management server can to primary database 420 corresponding management server proxy module 410-2 send restoration information, so that management server proxy module 410-2 is controlled Primary database 420 processed closes and restarts and control the primary database after restarting successfully 420 from new primary database Backup Data, So that management server proxy module 410-2 repairs primary database 420.
In this example, data-base cluster can be added in the primary database after reparation by management server.For example, management clothes Be engaged in device can by the primary database 420 after reparation as the slave database from database 440 (being promoted to primary database) and Data-base cluster is added.Alternatively, management server can delete the primary database after reparation from data-base cluster.
In addition, in this example, management server can carry out the verification of data consistency to the primary database after reparation, Quadratic search is carried out, to guarantee the data consistency of data-base cluster.In addition, management server can also be by database instance It is set as available mode, in order to provide database service.
In addition, in the disclosure, management server can show notification information to the operator of management server, so as to pipe The operator of reason server knows the operating status of data-base cluster.For example, in the example of Fig. 4 A, when primary database 420 is delayed When machine, management server can be to operator's display alarm information of management server, so that the operator of management server obtains Know 420 delay machine of primary database.In another example when the primary database delay machine in data-base cluster and management server can not be from data When library is promoted to new primary database, management server can to operator's display alarm information of management server, so as to Operator's notice of management server can not carry out master-slave swap, to set maintenance state for data-base cluster.In another example In the example of Fig. 4 A, after 420 delay machine of primary database and after being repaired, management server can be to the operation of management server Person's display alarm information, so that the operator of management server knows that primary database 420 has been repaired.
By the method for the embodiment of the present disclosure, when primary database breaks down, can be selected from database from multiple One as new primary database, to ensure the High Availabitity of database service.In addition, by the method for the embodiment of the present disclosure, pipe Reason server operates database by management server proxy module, avoids relying on SSH and operates to database, Meet the compliance requirement of financial scenario.In addition, being realized by the method for the embodiment of the present disclosure to the expansion from database Exhibition preferably reads extended capability to provide.
In the following, the illustrative detailed process that framework shown in application drawing 4A will be described in conjunction with Fig. 6.Fig. 6 is root One illustrative detailed process of framework shown in the application drawing 4A according to the embodiment of the present disclosure.As shown in fig. 6, in step S1 In, management server by primary database and the heartbeat reported from database find primary database delay machine (one main three from feelings It must be first to find primary database delay machine under condition).Then, in step s 2, management server is attempted from all from database Obtain GTID.Then, in step s3, management server determines whether correctly to obtain the slave database of more than half GTID, and the slave database for not obtaining its GTID correctly can be kicked out of into data-base cluster.Then, in step s 4, manage Reason server judgement has whether the slave database of highest priority has maximum GTID.When the slave number with highest priority According to library have maximum GTID when, in step s 5, management server by with highest priority slave database promoted based on Database, and remove the super read only option from database.When the slave database with highest priority does not have When maximum GTID, in step s 12, slave database of the management server control with highest priority, which connects, has maximum The slave database of GTID executes step S5 with replicate data after the completion of duplication.Then, in step s 6, management server It controls other and connects new primary database from database and replicated.Then, in the step s 7, management server can be by the height Availability database switchs to synchronous duplication, and Floating IP address is tied to new primary database, so that database service restores available. Then, in step s 8, management server can repair old primary database, specifically, pass through kill instruction and instruction of restarting Restart old primary database, restarts old primary database successfully.Then, in step s 9, management server controls old master Database connects new primary database with replicate data.Then, in step slo, if necessary, management server can be with Modify ack count parameter.Then, in step s 11, management server can set available mode for database instance.
In addition, when management server, which fails, executes step S3~S7, management server can alarm in Fig. 6, To set maintenance state for database.In addition, in Fig. 6, after management server executes step S9~S10, if data Library cluster is one main one from then management server can alarm and set maintenance state, otherwise, management server for database It can also alarm and kick out of old primary database and set maintenance state for old primary database after data cluster, to prevent two Secondary strike.
Embodiments described above is primary database in management server management data-base cluster and/or from database To realize the embodiment of database High Availabitity.However the present disclosure is not limited thereto.According to another embodiment of the present disclosure, it may be implemented The High Availabitity of management server.In this embodiment it is possible to dispose multiple management servers.Although deploying multiple management services Device, still, at a time, only one management server is used to manage primary database in data-base cluster and/or from data Library.In the disclosure, it can be taken by the primary database in current time management data-base cluster and/or from the management of database Business device is known as work management server.
According to the disclosure example, when work management server fail, other management servers can fill When work management server.Specifically, the management module for managing multiple management servers can be disposed.Other management services Device can serve as work management server by means of management module.Here " management module " can be existing ZooKeeper application program.
For example, management module can select one from other management servers when work management server fail It is a to serve as work management server.Specifically, management server can according to the mark of each management server (for example, ID), one is selected to serve as work management server from multiple management servers.For example, management server can be from multiple There is the management server of minimum ID to serve as work management server for selection in management server.In this example, work as work When management server breaks down, management module can select the management server with minimum ID from remaining management server To serve as work management server.
In another example a management service can not be selected by management module when work management server fail Device serves as work management server, but other management servers are automatically attempted to serve as work management server.Specifically, Management module can notify work management server fail to give other management servers, then, other management servers It can attempt to serve as work management server.For example, management module can detecte the operating status of work management server, and When work management server fail, which can notify work management server fail to manage to other Server is managed, then, other management servers can be attempted to serve as work management server.Other management servers attempt at When for work management server, each management server in other management servers can pass through respective identification information and determine Whether itself can serve as work management server.For example, a management server in other management servers may determine that Whether the ID of itself is less than the ID of the remaining management server in other management servers, if it is, the management server can To serve as work management server.
By the embodiment, in work management server fail, work can be served as by another management server Make management server, with continue manage data-base cluster in primary database and/or from database, to realize management service The High Availabitity of device.
According to the another embodiment of the disclosure, the High Availabitity of system library may be implemented.In this embodiment it is possible to configure more A system library.Although being configured with multiple system libraries, at a time, management server only uses in multiple system libraries One system library.
According to the disclosure example, IP address can be configured to each system library in multiple system libraries.This In situation, management server can select a system library to make according to the IP address of each system library from multiple system libraries With.For example, management server can be selected from multiple system libraries the system library with minimum IP address come using.In the example In, when the current system library that management server uses is broken down, management server can select tool from remaining system library Have the system library of minimum IP address come using.
By the embodiment, when current system library breaks down, another system library is can be used in management server Instance metadata is stored, to realize the High Availabitity of system library.
In the following, the configuration diagram that realization management server High Availabitity and system library High Availabitity will be described in conjunction with Fig. 7.Figure 7 be the configuration diagram of the realization management server High Availabitity and system library High Availabitity according to the embodiment of the present disclosure.Such as Fig. 7 institute Show, five management servers, respectively management server 1 to 5 can be disposed, wherein management server 1 to 3 can be located at deep Ditch between fields, management server 4 to 5 can be located at Shanghai.Furthermore, it is possible to dispose ZooKeeper in each management server.In addition, Five system libraries, respectively metadatabase (mata batabase) 1 to 5 can be disposed.Furthermore, it is possible to dispose clothes to be managed The data-base cluster of business device management, which includes database MySQL 1 to 6.Furthermore, it is possible to dispose and database The corresponding management server proxy module Agent of MySQL 1 to 6.
As shown in fig. 7, management server 3 manages database MySQL 1 to 6 using system library 1.When management server 3 When breaking down, ZooKeeper can detecte management server 3 and break down, and management server 3 to that event can occur The message informing of barrier is to management server 1,2,4 and 5.Then, a management server in management server 1,2,4 and 5 can To take over management server 3, Lai Guanli database MySQL 1 to 6.In addition, when system library 1 breaks down, management server 3 In system library 2 to 5 system library can be used to manage database MySQL 1 to 6.
In addition, the operator of management server can pass through web application programming interface (Web in Fig. 7 Application Programming Interface, Web API) carry out operate administrative service device.
Hereinafter, being described referring to Fig. 8 according to the embodiment of the present disclosure for managing the device of database.The device can be Management server.Fig. 8 shows the structural schematic diagram of the management server 800 according to the embodiment of the present disclosure.Due to management service The function of device 800 is identical as the details of method described above with reference to Fig. 5, therefore herein for simplicity, omits To the detailed description of identical content.As shown in figure 8, management server 800 includes: receiving unit 810, it is configured as receiving main number According to the running state information in library;Determination unit 820 is configured as according to the determination of the running state information of the primary database The operating status of primary database;Selecting unit 830 is configured as determining the operation shape of the primary database when the determination unit State is the primary database when breaking down, from least two select from database one from database as new master data Library;And transmission unit 840, be configured as to respectively with described at least two from database other are corresponding from database Management server proxy module sends information about new primary database, by with it is described other from the corresponding management of database Server agent module control it is described other from database from new primary database Backup Data.Other than this four units, Management server 800 can also include other component, however, since these components are unrelated with the content of the embodiment of the present disclosure, because This omits its diagram and description herein.Here " at least two from database " can not include read-only from database.For example, In the example of Fig. 4 A, " at least two from database " may include from database 430 to 450.
In the disclosure, the running state information of primary database can indicate the operating status of primary database.Primary database Operating status can not break down for primary database.Alternatively, the operating status of primary database can also be master data It breaks down in library.
According to the disclosure example, when deployment primary database and management server corresponding with primary database act on behalf of mould When the node of block does not break down, receiving unit 810 can be received from management server proxy module corresponding with primary database The running state information of primary database.In this example, receiving unit 810 can be periodically from pipe corresponding with primary database Manage the running state information that server agent module receives primary database.Alternatively, receiving unit 810 can be aperiodically The running state information of primary database is received from management server proxy module corresponding with primary database.
Primary database periodically is received from management server proxy module corresponding with primary database in receiving unit 810 Running state information situation in, receiving unit 810 can be periodically from management server generation corresponding with primary database The heartbeat message that module receives primary database is managed, wherein the heartbeat message of the primary database includes the operating status letter of primary database Breath.
For example, the heartbeat mechanism between management server and primary database can be preset.It is main under the heartbeat mechanism Database can be used as the client of management server and periodically report the heartbeat message of primary database to management server, And the heartbeat message of the primary database includes the running state information of primary database.Specifically, primary database can be according to certainly The operating status of body periodically generates the running state information of primary database, and includes by the running state information of primary database In the heartbeat message of primary database.Then, management server proxy module corresponding with primary database can be to management service The heartbeat message of device transmission primary database.Correspondingly, receiving unit 810 can be from management server generation corresponding with primary database The heartbeat message that module receives primary database is managed, to receive the running state information of primary database.
Master data aperiodically is received from management server proxy module corresponding with primary database in receiving unit 810 In the situation of the running state information in library, receiving unit 810 can be to management server proxy module corresponding with primary database The running state information of poll primary database.
However, when the nodes break down of deployment primary database and management server proxy module corresponding with primary database When, receiving unit 810 possibly can not receive the operation of primary database from management server proxy module corresponding with primary database Status information.Therefore, receiving unit 810 can preset waiting time (for example, 24 seconds), as when 810 nothing of receiving unit Receiving unit 810 when method receives the running state information of primary database from management server proxy module corresponding with primary database The time to be waited.When receiving unit 810 can not still be acted on behalf of from management server corresponding with primary database within the waiting time When module receives the running state information of primary database, deployment primary database and management corresponding with primary database clothes can be determined Failure has occurred in the node of business device proxy module, then receiving unit 810 can be by the fortune for receiving primary database from database Row status information.Conversely, when within the waiting time receiving unit 810 from management server proxy module corresponding with primary database When having received the running state information of primary database, receiving unit 810 need not receive primary database by from database Running state information.
Be described below receiving unit 810 by from database come receive primary database running state information example. According to the disclosure example, receiving unit 810 can from at least two from least one of database from database Corresponding management server proxy module receives the running state information of primary database.In this example, receiving unit 810 can be with Periodically received from at least two from least one of database from the corresponding management server proxy module of database The running state information of primary database.Alternatively, receiving unit 810 can aperiodically from at least two from database At least one of the running state information of primary database is received from the corresponding management server proxy module of database.
Receiving unit 810 periodically from at least two from least one of database from the corresponding pipe of database Manage server agent module receive primary database running state information situation in, receiving unit 810 can periodically from With at least two from least one of database from the corresponding management server proxy module of database receive at least one from The heartbeat message of database, wherein this at least one from the heartbeat message of database include primary database running state information.
For example, management server can be preset and from the heartbeat mechanism between database.Under the heartbeat mechanism, from Database can be used as the client of management server and periodically report heartbeat message from database to management server, It and should include the running state information of primary database from the heartbeat message of database.It specifically, can be periodical from database Ground detects the operating status of primary database, is then believed according to the operating status that the operating status of primary database generates primary database Breath, and the running state information of primary database is included in from the heartbeat message of database.Then, corresponding with from database Management server proxy module can send the heartbeat message from database to management server.Correspondingly, receiving unit 810 can With from the heartbeat message from database is received from the corresponding management server proxy module of database, to receive primary database Running state information.
In addition, from the heartbeat message of database can also include the running state information from database.Specifically, from data Library can periodically generate the running state information from database according to the operating status of itself, and will be from the operation of database Status information is included in from the heartbeat message of database.Then, with can from the corresponding management server proxy module of database To send the heartbeat message from database to management server.Correspondingly, receiving unit 810 can be from corresponding with from database Management server proxy module receives the heartbeat message from database, to receive the running state information from database.
In receiving unit 810 aperiodically from corresponding from least one of database from database at least two Management server proxy module receive primary database running state information situation in, receiving unit 810 can to at least Two from least one of database from the operation shape of the corresponding management server proxy module poll primary database of database State information.For example, receiving unit 810 can to at least two from least one of database from the corresponding management of database The running state information of server agent module request primary database.Then, it can be detected from database in response to the request Then the operating status of primary database generates the running state information of primary database according to the operating status of primary database.Then, Believe with the operating status that can send primary database to receiving unit 810 from the corresponding management server proxy module of database Breath.
In addition, in the disclosure, when the running state information of primary database instruction primary database does not break down, determining Unit 820 can determine that the operating status of primary database is that primary database does not break down.Alternatively, when the fortune of primary database Row status information instruction primary database is when breaking down, and determination unit 820 can determine number based on the operating status of primary database It breaks down according to library.
In addition, in the disclosure, when determination unit 820 determines that the operating status of the primary database is the primary database When breaking down, selecting unit 830 from described at least two select from database one from database as new master data Library.For example, selecting unit 830 can determine candidate slave database from least two from database, then from the candidate's Selected from database one from database as new primary database.Here " candidate from database " can be one or It is multiple from database.
Be described below selecting unit 830 determined from least two from database one of candidate slave database it is exemplary Process.
According to the disclosure example, firstly, selecting unit 830 can determine at least two from database its affairs Identify the slave database obtained by the management server.Specifically, selecting unit 830 can preset acquisition Transaction Identifier Time-out time (for example, 5 seconds).Selecting unit 830 can determine at least two from database its Transaction Identifier in the time-out The slave database obtained in time by the management server.
For example, management server has got the affairs mark from database 430 in time-out time in the example of Fig. 4 A Know and from the Transaction Identifier of database 440 without getting the Transaction Identifier from database 450, then selecting unit 830 can With determine the slave database that is obtained in the time-out time by the management server of its Transaction Identifier be from database 430 and from Database 440.
" Transaction Identifier " described above may include the identification information for the affairs that primary database executed and from data The identification information for the affairs that library executed.For example, Transaction Identifier can be global transaction identifier (Global Transaction IDentifiers, GTID).Management server can determine thing that primary database executed according to from the Transaction Identifier of database Business and the affairs executed from database, so that it is determined that should be from the consistency of the data of the data and primary database of database (or being registration).For example, when the affairs that primary database executed are identical with the affairs executed from database, pipe Reason server can determine that the data from database are identical as the data of primary database.When affairs that primary database executed and When the affairs part executed from database is identical, management server can determine the data and primary database from database Data portion is identical.
In addition, at least two from database its Transaction Identifier be not managed server acquisition slave database, Management server can delete these from database, for example, these are kicked out of data-base cluster from database from data-base cluster. For example, in the example of Fig. 4 A, management server got in time-out time from the Transaction Identifier of database 430 and from The Transaction Identifier of database 440 is without getting the Transaction Identifier from database 450, then selecting unit 830 can will be from number Data-base cluster is kicked out of according to library 450.
Selecting unit 830 determined at least two from database its Transaction Identifier obtained by the management server After database, selecting unit 830 may determine that the identified quantity from database whether be greater than described at least two from The predetermined ratio (for example, half) of the quantity of database.It is greater than described at least two from the quantity of database when identified It is a from the predetermined ratio of the quantity of database when, selecting unit 830 can by it is identified from database be determined as it is candidate from Database.When it is identified from the quantity of database be less than described at least two from the predetermined ratio of the quantity of database when, choosing Candidate slave database will not be determined as from database for identified by selecting unit 830.
It from database is from database 430 and from database determined by management server for example, in the example of Fig. 4 A 440.From the quantity of database be 2 as determined by management server, at least two from the quantity of database be 3, and institute The quantity of determining slave database is greater than the half of at least two quantity from database, then selecting unit 830 can incite somebody to action It is determined as candidate slave database from database 430 and from database 440.
It from database is from database 430 determined by management server in another example in the example of Fig. 4 A.Due to pipe Managing determined by server from the quantity of database is 1, at least two from the quantity of database be 3, and it is identified from number According to the quantity in library less than at least two from the half of the quantity of database, then selecting unit 830 will not will be from database 430 It is determined as candidate slave database.
After selecting unit 830 determines candidate slave database from least two from database, selecting unit 830 can be with Selected from the slave database of the candidate one from database as new primary database.According to the disclosure example, Each it can have its priority for serving as primary database from database.For example, management server can be in advance to each from number Its priority for serving as primary database according to lab setting.For example, management server can give in advance from data in the example of Fig. 4 A It is 1 that its priority for serving as primary database, which is arranged, in library 430, is to its priority for serving as primary database is arranged from database 440 2, and to from database 450 be arranged its priority for serving as primary database be 3.
In this example, selecting unit 830 can be according at least to each of slave database of the candidate from database Priority, selected from the slave database of the candidate one from database as new primary database.For example, selecting unit 830 can be according to each of candidate slave database from the priority and Transaction Identifier of database, from the slave number of the candidate According to selected in library one from database as new primary database.
Management server is considered when selecting new primary database from both the priority of database and Transaction Identifier, is It is necessary to.This is because, in the ideal case, the slave database with highest priority may have maximum transaction mark, That is the registration of the data of the data and primary database of the slave database with highest priority is highest.Therefore, work as management For server using the slave database with highest priority as when new primary database, other can be from highest from database The slave database back-up data of priority, to guarantee the data consistency of data-base cluster.However, under non-ideal conditions, Slave database with highest priority may not have maximum transaction and identify, i.e. the number of the slave database with highest priority Registration according to the data with primary database is not highest.Therefore, when management server is by the slave number with highest priority When according to library as new primary database, although other can be from the slave DB Backup number with highest priority from database According to, but do not ensure that the data consistency of data-base cluster.Therefore, management server can be according to the slave number of the candidate According to each of library from the priority and Transaction Identifier of database, selection has highest preferential from the slave database of the candidate The slave database of grade is as new primary database, to guarantee the data consistency of data-base cluster.
Priority and affairs of the selecting unit 830 according to each of candidate slave database from database is described below Mark, selects an exemplary flow from database as new primary database from the slave database of the candidate.
Selecting unit 830 may determine that whether the slave database in candidate slave database with highest priority has most Big Transaction Identifier.According to the disclosure example, when there is the slave database with highest priority maximum transaction to identify, Selecting unit 830 can be using the slave database with highest priority as new primary database.
For example, in the example of Fig. 4 A, it is candidate from database be from database 430 and from database 440, and from number It is 1 according to the priority that primary database is served as in library 430, the priority for serving as primary database from database 440 is 2, from database 440 With maximum transaction identify, then selecting unit 830 can by from database 440 as new primary database.
According to another example of the disclosure, when the slave database with highest priority, which does not have maximum transaction, to be identified, Selecting unit 830 can control the slave database with highest priority and identify with maximum transaction, then will have highest excellent The slave database of first grade is as new primary database, to guarantee the data consistency of data-base cluster.
Specifically, when the slave database with highest priority, which does not have maximum transaction, to be identified, selecting unit 830 can be with By management server proxy module corresponding with the slave database with highest priority, control have highest priority from Database is from the slave database back-up data identified with maximum transaction, so that the slave database with highest priority has Maximum transaction mark.For example, when the slave database with highest priority does not have maximum transaction and identifies, selecting unit 830 It can send to management server proxy module corresponding with the slave database with highest priority about with maximum transaction The information of the slave database of mark, so as to management server proxy module control corresponding with the slave database with highest priority Fixture has the slave database of highest priority from the slave database back-up data identified with maximum transaction.When preferential with highest The slave database of grade is after the slave database back-up data identified with maximum transaction, the slave database with highest priority There can be maximum transaction mark, then selecting unit 830 is using the slave database with highest priority as new primary database.
For example, in the example of Fig. 4 A, it is candidate from database be from database 430 and from database 440, and from number It is 1 according to the priority that primary database is served as in library 430, the priority for serving as primary database from database 440 is 2, from database 430 It is identified with maximum transaction, then management server can the corresponding management server proxy module 410-4 of Xiang Yucong database 440 It sends about the information from database 430, so that management server proxy module 410-4 control is from database 440 from from data 430 Backup Data of library.After from database 440 from from 430 Backup Data of database, there can be maximum from database 440 Transaction Identifier, then selecting unit 830 can be by the slave database 440 after Backup Data as new primary database.
In addition, as also described above, primary database is responsible for the write-in of data, it is responsible for the reading of data from database, And it can be from primary database replicate data from database.In order to forbid that data are written to from database, management server can be with Attribute (such as super read-only (super read only) option) is replicated to from data lab setting, is held with limitation to from database Row write operation.For example, management server 410 can give from database 430 to 450 and be respectively provided with super in the example of Fig. 4 A Read only option.
In the disclosure, when selecting unit 830 using some from database as when new primary database, can first remove From the duplication attribute of database.For example, in the example of Fig. 4 A, when selecting unit 830 by from database 440 as new master When database, the super read only option from database 440 can be first removed.
In addition, in the disclosure, transmission unit 840 is to respectively with described at least two from other in database from data The corresponding management server proxy module in library sends the information about new primary database, by with it is described other from database pair The management server proxy module control answered it is described other from database from new primary database Backup Data.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database after, hair Send unit 840 can the corresponding management server proxy module 410-3 of Xiang Yucong database 430, corresponding with from database 450 Management server proxy module 410-5 is sent about the information from database 440.Management server can pass through management server Proxy module 410-3 control is from database 430 from from 440 Backup Data of database and management server proxy module 410-5 Control is from database 450 from from 440 Backup Data of database.
" information about new primary database " described above can be the identification information of new primary database, example Such as, the static ip address (or fixed ip address) of new primary database.The quiet of new primary database can be passed through from database State IP address, from new primary database Backup Data.For example, in the example of Fig. 4 A, management server will be from database 440 After new primary database, from database 430 and from database 450 can by the static ip address from database 440, From from 440 Backup Data of database.
In addition, transmission unit 840 can be sent to management server proxy module corresponding with the new primary database Configuration information, wherein the configuration information indicate the new primary database and it is described other from the duplicator between database System, so that management server proxy module corresponding with the new primary database controls described in the new primary database use Replicanism.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database after, hair Send unit 840 can the corresponding management server proxy module 410-4 of Xiang Yucong database 440 send configuration information, wherein should Configuration information indicate as the slave database 440 of new primary database and from database 430, from the duplication between database 450 Mechanism, the slave database 440 so as to management server proxy module 410-4 control as new primary database use the duplicator System.
" replicanism " described above may include complete synchronous replicanism, asynchronous replication mechanism or partly synchronize multiple Any one of making mechanism etc..In situation of the primary database using complete synchronous replicanism, primary database can according to The write operation of family instruction execution data, and after having executed the write operation of data, it is not to return to confirm to user at once Message, but wait it is all from database after primary database Backup Data again to user return confirmation message.In master data Using in the situation of asynchronous replication mechanism, primary database can execute the write operation of data according to user instructions in library, and After the write operation for having executed data, confirmation message is returned to user at once, it is standby from database from primary database without waiting Confirmation message is returned to user again after part data.In situation of the primary database using half synchronous replicanism, primary database can It is not at once to user to execute the write operation of data according to user instructions, and after having executed the write operation of data Confirmation message is returned, but waits part from database (can be arranged by parameter ack count from the quantity of database) from master Confirmation message is returned to user again after database back-up data.
In the disclosure, in new primary database and the feelings from the replicanism between database for half synchronous replicanism In shape, new primary database can execute the write operation of data according to user instructions, and in the write-in behaviour for having executed data After work, confirmation message is not returned to user not instead of at once, one or more is waited to back up from database from new primary database Confirmation message is returned to user again after data, to guarantee the data consistency of new data-base cluster.It is synchronous by using half Replicanism, though new data-base cluster is hit again, such as the primary database delay machine in new data-base cluster, but Since the data of the slave database in new data-base cluster and primary database are consistent, in new data-base cluster Slave database still ensure that the High Availabitity of database.Therefore, by using half synchronous replicanism, data base set can be assigned The ability of the anti-two-hit of group.
In addition, in the disclosure, management server can be to each data base set group configuration dynamic IP (for example, floating IP), externally to provide the unified IP of service using the dynamic IP as data-base cluster.User can be accessed by the dynamic IP Data-base cluster, such as data are written to data-base cluster by the dynamic IP.In this case, management server can incite somebody to action The dynamic IP of data-base cluster is tied to new primary database.In this way, user can be by dynamic IP to database Data are written in cluster, without knowing which database in data-base cluster is primary database, to improve the body of user Degree of testing.
For example, in the example of Fig. 4 A, management server by from database 440 as new primary database before, pipe The Floating IP address of data-base cluster can be tied to primary database 410 by reason server.It will make from database 440 in management server After new primary database, in step S506, the Floating IP address of data-base cluster can be tied to from number by management server According to library 440.
By the above-mentioned method executed by management server, after the primary database delay machine in data-base cluster, management clothes Some can be promoted to new primary database from database by business device, so that data-base cluster, which reverts to service, can use shape State provides service to continue as user.However, the present disclosure is not limited thereto.Management server can also repair the master data of delay machine Library.According to the disclosure example, transmission unit 840 can act on behalf of mould to management server corresponding with the primary database Block sends restoration information, so that management server proxy module corresponding with the primary database repairs the primary database.This In " restoration information " may include the instruction of restarting of database and the information about new primary database.
For example, in the example of Fig. 4 A, after 420 delay machine of primary database, management server can to primary database 420 corresponding management server proxy module 410-2 send restoration information, so that management server proxy module 410-2 is controlled Primary database 420 processed closes and restarts and control the primary database after restarting successfully 420 from new primary database Backup Data, So that management server proxy module 410-2 repairs primary database 420.
In this example, data-base cluster can be added in the primary database after reparation by management server.For example, management clothes Be engaged in device can by the primary database 420 after reparation as the slave database from database 440 (being promoted to primary database) and Data-base cluster is added.Alternatively, management server can delete the primary database after reparation from data-base cluster.
In addition, in this example, management server can carry out the verification of data consistency to the primary database after reparation, Quadratic search is carried out, to guarantee the data consistency of data-base cluster.In addition, management server can also be by database instance It is set as available mode, in order to provide database service.
In addition, in the disclosure, management server can also include notification unit (not shown), with to management service The operator of device shows notification information, so that the operator of management server knows the operating status of data-base cluster.For example, In the example of Fig. 4 A, when 420 delay machine of primary database, notification unit can show alarm signal to the operator of management server Breath, so that the operator of management server knows 420 delay machine of primary database.In another example when the primary database in data-base cluster Delay machine and when management server can not be new primary database be promoted to from database, notification unit can be to management server Operator's display alarm information, so that master-slave swap can not be carried out to the operator of management server notice, thus by database Cluster is set as maintenance state.In another example in the example of Fig. 4 A, after 420 delay machine of primary database and after being repaired, notification sheet Member can be to operator's display alarm information of management server, so that the operator of management server knows primary database 420 It has been repaired.
It, can be from multiple from database when primary database breaks down by the management server of the embodiment of the present disclosure It is middle to select one as new primary database, to ensure the High Availabitity of database service.In addition, the side for passing through the embodiment of the present disclosure Method, management server operate database by management server proxy module, avoid relying on SSH and carry out to database Operation meets the compliance requirement of financial scenario.In addition, by the method for the embodiment of the present disclosure, realize to from database Extension, thus provide preferably read extended capability.
In addition, can also be by means of the framework shown in Fig. 9 for calculating equipment according to the management server of the embodiment of the present disclosure To realize.Fig. 9 shows the framework of the calculating equipment.As shown in figure 9, calculate equipment 900 may include bus 910, one or Multiple CPU 920, read-only memory (ROM) 930, random access memory (RAM) 940, the communication port for being connected to network 950, input output assembly 960, hard disk 970 etc..The storage equipment in equipment 900 is calculated, such as ROM 930 or hard disk 970 can To store computer disposal and/or communicate program instruction performed by the various data used or file and CPU.Calculate equipment 900 can also include user interface 980.Certainly, framework shown in Fig. 9 is only exemplary, when realizing different equipment, root According to actual needs, it is convenient to omit one or more components in calculating equipment shown in Fig. 9.
Embodiment of the disclosure also may be implemented as computer readable storage medium.According to the calculating of the embodiment of the present disclosure Computer-readable instruction is stored on machine readable storage medium storing program for executing.It, can be with when the computer-readable instruction is run by processor Execute the method according to the embodiment of the present disclosure referring to the figures above description.The computer readable storage medium includes but unlimited In such as volatile memory and/or nonvolatile memory.The volatile memory for example may include that arbitrary access is deposited Reservoir (RAM) and/or cache memory (cache) etc..The nonvolatile memory for example may include read-only storage Device (ROM), hard disk, flash memory etc..
It will be appreciated by those skilled in the art that a variety of variations and modifications can occur in content disclosed by the disclosure.For example, Various equipment described above or component can also pass through one in software, firmware or three by hardware realization A little or whole combinations is realized.
In addition, as shown in the disclosure and claims, unless context clearly prompts exceptional situation, " one ", " one It is a ", the words such as "an" and/or "the" not refer in particular to odd number, may also comprise plural number." first ", " second " used in the disclosure And similar word is not offered as any sequence, quantity or importance, and be used only to distinguish different component parts.Together The similar word such as sample, " comprising " or "comprising" means to occur after element or object before the word cover and appear in the word The element that face is enumerated perhaps object and its equivalent and be not excluded for other elements or object." connection " or " connected " etc. are similar Word be not limited to physics or mechanical connection, but may include electrical connection, either it is direct still Indirectly.
In addition, flow chart has been used to be used to illustrate behaviour performed by system according to an embodiment of the present disclosure in the disclosure Make.It should be understood that front or following operate not necessarily accurately carry out in sequence.On the contrary, can according to inverted order or Various steps are handled simultaneously.It is also possible to during other operations are added to these, or from these processes remove a certain step Or number step operation.
Unless otherwise defined, all terms (including technical and scientific term) used herein have leads with belonging to the present invention The identical meanings that the those of ordinary skill in domain is commonly understood by.It is also understood that those of definition term such as in usual dictionary The meaning consistent with their meanings in the context of the relevant technologies should be interpreted as having, without application idealization or The meaning of extremely formalization explains, unless being clearly defined herein.
The disclosure is described in detail above, but it will be apparent to a person skilled in the art that the disclosure not limits The fixed embodiment illustrated in this manual.The disclosure is not departing from the disclosure determined by the record of claims Under the premise of objective and range, modifications and changes mode can be used as to implement.Therefore, the record of this specification is said with example For the purpose of bright, for purposes of this disclosure not with the meaning of any restrictions.

Claims (15)

1. a kind of method for managing database, which comprises
Receive the running state information of primary database;
The operating status of the primary database is determined according to the running state information of the primary database;
When the operating status for determining the primary database is that the primary database breaks down, from least two from database Select one from database as new primary database;And
To being sent respectively from other in database from the corresponding management server proxy module of database with described at least two About the information of new primary database, by with it is described other from described in the corresponding management server proxy module control of database Other are from database from new primary database Backup Data.
2. the method as described in claim 1, wherein the running state information for receiving primary database includes:
The running state information of the primary database is received from management server proxy module corresponding with the primary database.
3. the method as described in claim 1, wherein the running state information for receiving primary database includes:
It is received from described at least two from least one of database from the corresponding management server proxy module of database The running state information of the primary database.
4. method as described in any one of claims 1 to 3, wherein it is described selected from database from least two one from number Include: as new primary database according to library
Determine described at least two from database its Transaction Identifier be managed server acquisition slave database, wherein the pipe Reason server is for managing the primary database and described at least two from database;
The identified predetermined ratio for whether being greater than described at least two quantity from database from the quantity of database of judgement;
When it is identified from the quantity of database be greater than described at least two from the predetermined ratio of the quantity of database when, by really Fixed slave database is determined as candidate slave database;And
Selected from the slave database of the candidate one from database as new primary database.
5. method as claimed in claim 4, wherein
Each there is its priority for serving as primary database from database;
One is selected from the slave database of the candidate includes: as new primary database from database
Each of slave database according at least to the candidate is from the priority of database, from the slave database of the candidate Select one from database as new primary database.
6. method as claimed in claim 5, wherein it is described according at least to each of slave database of the candidate from data The priority in library, one is selected from the slave database of the candidate includes: as new primary database from database
Each of slave database according to the candidate is from the priority and Transaction Identifier of database, from the slave number of the candidate According to selected in library one from database as new primary database.
7. method as claimed in claim 6, wherein according to each of slave database of the candidate from the preferential of database Grade and Transaction Identifier, one is selected from the slave database of the candidate includes: as new primary database from database
Judge whether the slave database in the slave database of the candidate with highest priority has maximum transaction mark;And
When there is the slave database with highest priority maximum transaction to identify, the slave database with highest priority is made For new primary database.
8. the method for claim 7, wherein according to each of slave database of the candidate from the preferential of database Grade and Transaction Identifier, one is selected from the slave database of the candidate includes: as new primary database from database
When the slave database with highest priority do not have maximum transaction identify when, by with the slave number with highest priority According to the corresponding management server proxy module in library, the slave database with highest priority is controlled from identifying with maximum transaction From database back-up data, so that the slave database with highest priority is identified with maximum transaction;And
Using the slave database with highest priority as new primary database.
9. method as described in any one of claims 1 to 3, further includes:
Configuration information is sent to management server proxy module corresponding with the new primary database, wherein the configuration information Indicate the new primary database and it is described other from the replicanism between database, so as to the new primary database pair The management server proxy module answered controls the new primary database using the replicanism.
10. method as described in any one of claims 1 to 3, further includes:
To management server proxy module corresponding with the primary database send restoration information, so as to the primary database pair The management server proxy module answered repairs the primary database.
11. a kind of for managing the device of database, comprising:
Receiving unit is configured as receiving the running state information of primary database;
Determination unit is configured as determining the operation shape of the primary database according to the running state information of the primary database State;
Selecting unit is configured as determining the operating status of the primary database for primary database hair when the determination unit When raw failure, from least two select from database one from database as new primary database;And
Transmission unit is configured as to taking respectively from other in database from the corresponding management of database with described at least two Device proxy module of being engaged in sends information about new primary database, by with it is described other from the corresponding management server of database Proxy module control it is described other from database from new primary database Backup Data.
12. device as claimed in claim 11, wherein the receiving unit is configured as from corresponding with the primary database Management server proxy module receives the running state information of the primary database.
13. device as claimed in claim 11, wherein the selecting unit is configured to determine that described at least two from data Its Transaction Identifier is managed the slave database of server acquisition in library, wherein the management server is for managing the master data Library and described at least two is from database;Whether it is greater than described at least two from data from the quantity of database determined by judgement The predetermined ratio of the quantity in library;It is greater than described at least two from the pre- of the quantity of database from the quantity of database when identified When certainty ratio, it is determined as candidate slave database from database for identified;And it is selected from the slave database of the candidate One is selected from database as new primary database.
14. a kind of for managing the device of database, comprising:
Processor;And
Memory, wherein computer-readable code is stored in the memory, the computer-readable code is when by described When managing device operation, perform claim requires method described in any one of 1-11.
15. a kind of computer readable storage medium is stored thereon with instruction, described instruction by processor when being run, so that institute It states processor and executes such as method of any of claims 1-11.
CN201910353959.6A 2019-04-26 2019-04-26 Method for managing database and corresponding device, computer readable storage medium Active CN110069365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910353959.6A CN110069365B (en) 2019-04-26 2019-04-26 Method for managing database and corresponding device, computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910353959.6A CN110069365B (en) 2019-04-26 2019-04-26 Method for managing database and corresponding device, computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110069365A true CN110069365A (en) 2019-07-30
CN110069365B CN110069365B (en) 2023-07-04

Family

ID=67369589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910353959.6A Active CN110069365B (en) 2019-04-26 2019-04-26 Method for managing database and corresponding device, computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110069365B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460039A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Relational database processing system, client, server and method
CN112199356A (en) * 2020-12-09 2021-01-08 北京顺达同行科技有限公司 Fault processing method, device, server and storage medium
CN114676118A (en) * 2022-05-30 2022-06-28 深圳市科力锐科技有限公司 Database switching method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020194015A1 (en) * 2001-05-29 2002-12-19 Incepto Ltd. Distributed database clustering using asynchronous transactional replication
US20060222162A1 (en) * 2005-03-31 2006-10-05 Marcel Bank Computer network system for building, synchronising and/or operating second database from/with a first database, and procedures for it
EP2171619A1 (en) * 2007-07-23 2010-04-07 Telefonaktiebolaget LM Ericsson (PUBL) Database system with multiple layer distribution
JP2014026587A (en) * 2012-07-30 2014-02-06 Nippon Telegr & Teleph Corp <Ntt> Distributed database system, first database device of distributed database system, second database device of distributed database system and computer program
CN103914354A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Method and system for database fault recovery
US20150278030A1 (en) * 2012-12-28 2015-10-01 Huawei Technologies Co., Ltd. Distributed Database Synchronization Method and System
US20170103000A1 (en) * 2015-10-07 2017-04-13 International Business Machines Corporation Backup capability for object store used as primary storage
CN108932295A (en) * 2018-05-31 2018-12-04 康键信息技术(深圳)有限公司 Primary database method for handover control, device, computer equipment and storage medium
CN108984569A (en) * 2017-06-05 2018-12-11 中兴通讯股份有限公司 Database switching method, system and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020194015A1 (en) * 2001-05-29 2002-12-19 Incepto Ltd. Distributed database clustering using asynchronous transactional replication
US20060222162A1 (en) * 2005-03-31 2006-10-05 Marcel Bank Computer network system for building, synchronising and/or operating second database from/with a first database, and procedures for it
EP2171619A1 (en) * 2007-07-23 2010-04-07 Telefonaktiebolaget LM Ericsson (PUBL) Database system with multiple layer distribution
JP2014026587A (en) * 2012-07-30 2014-02-06 Nippon Telegr & Teleph Corp <Ntt> Distributed database system, first database device of distributed database system, second database device of distributed database system and computer program
US20150278030A1 (en) * 2012-12-28 2015-10-01 Huawei Technologies Co., Ltd. Distributed Database Synchronization Method and System
CN103914354A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Method and system for database fault recovery
US20170103000A1 (en) * 2015-10-07 2017-04-13 International Business Machines Corporation Backup capability for object store used as primary storage
CN108984569A (en) * 2017-06-05 2018-12-11 中兴通讯股份有限公司 Database switching method, system and computer readable storage medium
CN108932295A (en) * 2018-05-31 2018-12-04 康键信息技术(深圳)有限公司 Primary database method for handover control, device, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460039A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Relational database processing system, client, server and method
CN112199356A (en) * 2020-12-09 2021-01-08 北京顺达同行科技有限公司 Fault processing method, device, server and storage medium
CN114676118A (en) * 2022-05-30 2022-06-28 深圳市科力锐科技有限公司 Database switching method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110069365B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN110311831B (en) Container cloud-based system resource monitoring method and related equipment
CN107391294B (en) Method and device for establishing IPSAN disaster recovery system
CN104679611B (en) Data resource clone method and device
CN110069365A (en) Manage the method and corresponding device, computer readable storage medium of database
CN109729129A (en) Configuration modification method, storage cluster and the computer system of storage cluster
CN109788055B (en) Service management system and method based on micro-service architecture
CN104036043B (en) High availability method of MYSQL and managing node
CN108897658B (en) Method and device for monitoring master database, computer equipment and storage medium
CN107666493B (en) Database configuration method and equipment thereof
CN112583648B (en) Intelligent service fault processing method based on DNS
CN108306760A (en) For making the self-healing method and apparatus of managerial ability in a distributed system
CN116107828A (en) Main node selection method, distributed database and storage medium
US20230004465A1 (en) Distributed database system and data disaster backup drilling method
CN105323271B (en) Cloud computing system and processing method and device thereof
CN116185697B (en) Container cluster management method, device and system, electronic equipment and storage medium
CN115314361B (en) Server cluster management method and related components thereof
JP3870174B2 (en) Method for managing remotely accessible resources
CN115794769B (en) Method for managing high-availability database, electronic equipment and storage medium
CN114297182A (en) Industrial model data management method, device, equipment and readable storage medium
CN115878361A (en) Node management method and device for database cluster and electronic equipment
CN108984356A (en) A kind of IT product test method and device
CN112486718A (en) Database fault automatic switching method and device and computer storage medium
CN114020279A (en) Application software distributed deployment method, system, terminal and storage medium
CN114722029B (en) Method, system, equipment and storage medium for repairing monitor database
CN115905270B (en) Method and device for determining active data nodes in database and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant