CN110347658A - Database instance switching method and device - Google Patents

Database instance switching method and device Download PDF

Info

Publication number
CN110347658A
CN110347658A CN201910502581.1A CN201910502581A CN110347658A CN 110347658 A CN110347658 A CN 110347658A CN 201910502581 A CN201910502581 A CN 201910502581A CN 110347658 A CN110347658 A CN 110347658A
Authority
CN
China
Prior art keywords
database
database instance
instance
information
target application
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.)
Pending
Application number
CN201910502581.1A
Other languages
Chinese (zh)
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.)
WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd
Original Assignee
WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY 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 WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd filed Critical WIRELESS LIFE (HANGZHOU) INFORMATION TECHNOLOGY Co Ltd
Priority to CN201910502581.1A priority Critical patent/CN110347658A/en
Publication of CN110347658A publication Critical patent/CN110347658A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/21Design, administration or maintenance of databases
    • 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/25Integrating or interfacing systems involving database management systems
    • 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

The disclosure is directed to database instance switching method and devices.This method comprises: receiving the example information for the database instance being deployed on each database server that at least two database servers are sent;According to the example information of each database instance, example handoff relation is determined;Wherein, example handoff relation is used to be characterized in role's corresponding relationship of primary database instance and standby database example in each database instance;When detecting the first database example configured extremely in each database instance, the example information of the second spare database instance corresponding with first database example is obtained according to example handoff relation;Switch indicating information is sent to target application corresponding with first database example, includes the example information of the second database instance in switch indicating information, is used to indicate the address that the second database instance is revised as in database access address by target application.The disclosure can effectively solve the problem that the problem of handover information mistake.

Description

Database instance switching method and device
Technical field
This disclosure relates to technical field of intelligent equipment more particularly to database instance switching method and device.
Background technique
With the fast development of Internet enterprises business, the data for needing to store are more and more.Internet enterprises are generally adopted Very more examples is needed to promote the handling capacity of website using library technology is divided with MySQL.In order to improve database service Reliability generally uses active and standby example, and is aided with high-availability system to ensure that database service is available.With the development of business, Data-base capacity-enlarging, migration operation are very frequent.Requirement to database administrator (DBA, Database Administrator) It is very high, it is ensured that the database of variation has configuration High Availabitity, and is verified.However, before fast-changing service surface, meeting The configuration of some High Availabitities is failure state, cannot usually be found, but is then caused when a problem occurs due to not configuring not pair Handover failure.
In the related technology, it using main high availability (MHA, Master High Availability) scheme, needs to switch Configuration SSH between database server trusts, and configures switch data library information in management node manually.
Summary of the invention
To overcome the problems in correlation technique, the embodiment of the present disclosure provides a kind of database instance switching method and dress It sets.The technical solution is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of database instance switching method is provided, comprising:
Receive the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, the example handoff relation For being characterized in role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, cut according to the example Change the example information of Relation acquisition the second spare database instance corresponding with the first database example;
Switch indicating information, the switch indicating information are sent to target application corresponding with the first database example In include second database instance example information, be used to indicate the target application and be revised as database access address The address of second database instance.
The technical scheme provided by this disclosed embodiment can include the following benefits: the technical solution passes through acquisition unit It is deployed on the example information of the database instance on each database server, it is automatic to construct example handoff relation, and real-time monitoring number It is whether abnormal according to the configuration of library example, to ensure the real-time and correctness of handover information, efficiently solve handover information mistake Accidentally the problem of, the safety and reliability of database instance switching is improved, and can reduce human cost, improves Automated water It is flat.
In one embodiment, the example information include: the internet address IP of database server, instance port, Example Copy Info, active and standby heartbeat message and database role.
In one embodiment, switching instruction is sent to target application corresponding with the first database example described Before message, the method also includes:
Detect whether the first database example breaks down;
It is described to send switch indicating information to target application corresponding with the first database example, comprising:
When detecting that the first database example breaks down, to target corresponding with the first database example Using transmission switch indicating information.
According to the second aspect of an embodiment of the present disclosure, a kind of database instance switching method is provided, comprising:
Detect the database instance being deployed on database server;
Obtain the example information of detected database instance;
The example information of acquired database instance is sent to control server.
According to the third aspect of an embodiment of the present disclosure, a kind of database instance switching device is provided, comprising:
Receiving module, for receive at least two database servers transmission be deployed in each database server Database instance example information;
Determining module determines example handoff relation for the example information according to each database instance;Wherein, institute Example handoff relation is stated for being characterized in the angle of primary database instance and standby database example in each database instance Color corresponding relationship;
First obtains module, and the first database example configured extremely is detected in each database instance for working as When, the reality of the second spare database instance corresponding with the first database example is obtained according to the example handoff relation Example information;
First sending module disappears for sending switching instruction to target application corresponding with the first database example It ceases, includes the example information of second database instance in the switch indicating information, being used to indicate the target application will It is revised as the address of second database instance in database access address.
In one embodiment, the example information include: the internet address IP of database server, instance port, Example Copy Info, active and standby heartbeat message and database role.
In one embodiment, described device further include:
First detection module, for detecting whether the first database example breaks down;
First sending module when detecting that the first database example breaks down, to first data Example corresponding target application in library sends switch indicating information.
According to a fourth aspect of embodiments of the present disclosure, a kind of database instance switching device is provided, comprising:
Second detection module, for detecting the database instance being deployed on database server;
Second obtains module, for obtaining the example information of detected database instance;
Second sending module, for sending the example information of acquired database instance to control server.
According to a fifth aspect of the embodiments of the present disclosure, a kind of database instance switching device is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Receive the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, the example handoff relation For being characterized in role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, cut according to the example Change the example information of Relation acquisition the second spare database instance corresponding with the first database example;
Switch indicating information, the switch indicating information are sent to target application corresponding with the first database example In include second database instance example information, be used to indicate the target application and be revised as database access address The address of second database instance.
According to a sixth aspect of an embodiment of the present disclosure, a kind of database instance switching device is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Detect the database instance being deployed on database server;
Obtain the example information of detected database instance;
The example information of acquired database instance is sent to control server.
According to the 7th of the embodiment of the present disclosure the aspect, a kind of computer readable storage medium is provided, calculating is stored thereon with The step of machine instruction, which realizes above-mentioned first aspect the method when being executed by processor.
According to the eighth aspect of the embodiment of the present disclosure, a kind of computer readable storage medium is provided, is stored thereon with calculating The step of machine instruction, which realizes above-mentioned second aspect the method when being executed by processor.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is the flow chart of database instance switching method shown according to an exemplary embodiment.
Fig. 2 is the flow chart of database instance switching method shown according to an exemplary embodiment.
Fig. 3 is the flow chart of database instance switching method shown according to an exemplary embodiment.
Fig. 4 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Fig. 5 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Fig. 6 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Fig. 7 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Fig. 8 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Fig. 9 is the block diagram of database instance switching device shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
In the related technology, it using MHA scheme, needs the configuration SSH between the server of switch data library to trust, is managing manually Node configures switch data library information.But the defect of this scheme is to need to carry out manual configuration before new library is online, verifying; Database change after as migrated, need to be configured and verified again, due to being that the cost verified in line service is huge It greatly, is a huge challenge to DBA, also, in view of the operations frequency such as Internet service fast development and data-base capacity-enlarging migration It is numerous, so that this implementation is very risky, often because the reasons such as leakage, mispairing make handover information mistake, cause to cut It changes unsuccessfully, service is unavailable, and reliability is poor.
To solve the above-mentioned problems, the embodiment of the present disclosure provides a kind of database instance switching method, this method comprises: Receive the example information for the database instance of at least two database servers transmission being deployed on each database server;Root According to the example information of each database instance, example handoff relation is determined;Wherein, example handoff relation is for being characterized in each database Role's corresponding relationship of primary database instance and standby database example in example;It is different when being detected in each database instance When the first database example often configured, corresponding with first database example spare second is obtained according to example handoff relation The example information of database instance;Switch indicating information is sent to target application corresponding with first database example, switching refers to Show include in message the second database instance example information, be used to indicate target application for database access address and be revised as the The address of two database instances.The database instance switching method that the embodiment of the present disclosure provides is deployed in each data by obtaining The example information of database instance on the server of library, automatic building example handoff relation, and Real-time Monitoring Data library example Whether configuration is abnormal, to ensure the real-time and correctness of handover information, efficiently solves the problems, such as handover information mistake, mentions The safety and reliability of high database instance switching, and can reduce human cost, improve automatization level.
Based on above-mentioned analysis, following specific embodiment is proposed.
Fig. 1 is a kind of flow chart of database instance switching method shown according to an exemplary embodiment, this method Executing subject can be control server, and control server is independently of database server;As shown in Figure 1, this method include with Lower step 101-104:
In a step 101, the number being deployed on each database server that at least two database servers are sent is received According to the example information of library example.
It is exemplary, in distributed data base system, in the multiple database instances of database server top heat For, different applications or business use different database instances.It is installed on every database server and long-range control The corresponding control client of control server, wherein the host process for controlling client for real-time detection and finds to be deployed in data Database instance on the server of library, it can be found that the database instance of addition disposed and rear;It is each for controlling client Database instance distributes special example and monitors process, for acquiring the example information of corresponding database instance in real time, and on Offer control server.Example information of the control server by the database instance on each database server of analysis, construction Example handoff relation.
Exemplary, example information includes: internet address (IP), instance port, the example duplication letter of database server Breath, active and standby heartbeat message and database role.
Exemplary, each database instance is equivalent to a nodal information, with the database server of database instance IP and instance port are as keyword, with database role, example Copy Info, active and standby heartbeat message, delayed data and node Renewal time etc. is as value building surviving node.
In a step 102, according to the example information of each database instance, example handoff relation is determined;Wherein, example switches Relationship is used to be characterized in role's corresponding relationship of primary database instance and standby database example in each database instance.
In step 103, when detecting the first database example configured extremely in each database instance, according to reality Example handoff relation obtains the example information of the second spare database instance corresponding with first database example.
Exemplary, abnormal configuration is for example including any one following situation or combination: 1) leakage: primary database instance is not It is configured standby database example;2) primary database instance and the database role of corresponding standby database example are abnormal, For example primary database instance and corresponding standby database example are all set to main (Master) or from (slave);3) number The database role recorded according to database role and the configuration center of library example is inconsistent, such as database instance a, data The database instance role of library example a is Master, but the database role of the database instance a of configuration center record is not Master;4) Data writing time of database instance or delay are more than given threshold.
Exemplary, control server needs the example information of each database instance of real-time detection, judges each database instance Configuration when it is whether abnormal.When detecting the first database example configured extremely in each database instance, according to reality Example handoff relation obtains the example information of the second spare database instance corresponding with first database example.
At step 104, switch indicating information, switching instruction are sent to target application corresponding with first database example Include the example information of the second database instance in message, is used to indicate target application for database access address and is revised as second The address of database instance.
It is exemplary, when detecting the first database example configured extremely in each database instance, counted to first Switch indicating information is sent according to the corresponding target application of library example, and database access address is revised as and the by instruction target application The address of corresponding the second spare database instance of one database instance.The address of second database instance can be the second number According to the port of the second database instance of IP+ of database server where the example of library.
The technical solution that the embodiment of the present disclosure provides, by obtaining the database instance being deployed on each database server Example information, it is automatic to construct example handoff relation, and whether the configuration of Real-time Monitoring Data library example abnormal, cuts to ensure The real-time and correctness for changing information efficiently solve the problems, such as handover information mistake, improve the safety of database instance switching Property and reliability, and can reduce human cost, improve automatization level.
Fig. 2 is a kind of flow chart of database instance switching method shown according to an exemplary embodiment.This method Executing subject can be control server, as shown in Fig. 2, on the basis of embodiment shown in Fig. 1, this disclosure relates to database Example switching method may comprise steps of 201-205:
In step 201, the number being deployed on each database server that at least two database servers are sent is received According to the example information of library example.
In step 202, according to the example information of each database instance, example handoff relation is determined;Wherein, example switches Relationship is used to be characterized in role's corresponding relationship of primary database instance and standby database example in each database instance.
In step 203, when detecting the first database example configured extremely in each database instance, according to reality Example handoff relation obtains the example information of the second spare database instance corresponding with first database example.
In step 204, whether detection first database example breaks down.
It is exemplary, it is straight by control server in order to avoid erroneous judgement when determining that first database example configures for exception Connect whether detection first database example breaks down, if confirmation first database example breaks down, such as first database Example has occurred to migrate or fail, then carries out example switching.
In step 205, when detecting that first database example breaks down, to corresponding with first database example Target application sends switch indicating information, includes the example information of the second database instance in switch indicating information, is used to indicate The address of the second database instance is revised as in database access address by target application.
The technical solution that the embodiment of the present disclosure provides guarantees the reality of handover information by constructing example handoff relation automatically When property and correctness, can reduce human cost.
Fig. 3 is a kind of flow chart of database instance switching method shown according to an exemplary embodiment.This method by Control server and database server cooperation execute, as shown in figure 3, on the basis of embodiment shown in Fig. 1, this disclosure relates to Database instance switching method may comprise steps of 301-306:
In step 301, database server detects the database instance being deployed on database server.
In step 302, database server obtains the example information of detected database instance.
In step 303, database server sends the example information of acquired database instance to control server; Control server receives the database instance being deployed on each database server that at least two database servers are sent Example information.
In step 304, control server determines example handoff relation according to the example information of each database instance;Its In, example handoff relation is used to be characterized in the role couple of primary database instance and standby database example in each database instance It should be related to;
In step 305, control server is worked as detects that the first database configured extremely is real in each database instance When example, believed according to the example that example handoff relation obtains the second spare database instance corresponding with first database example Breath;
Within step 306, control server sends switching instruction to target application corresponding with first database example and disappears It ceases, includes the example information of the second database instance in switch indicating information, be used to indicate target application by database access It is revised as the address of the second database instance in location.
The technical solution that the embodiment of the present disclosure provides, by constructing example handoff relation, and Test database example automatically Configuration it is whether abnormal, guarantee the real-time and correctness of handover information, without human intervention, reduce human cost.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.
Fig. 4 is a kind of block diagram of database instance switching device shown according to an exemplary embodiment, which can be with Adopt and implement in various manners, for example, in control server implementing device all components, alternatively, control server side with Component in the mode implementing device of coupling;The device can be implemented in combination with above-mentioned public affairs by software, hardware or both The method being related to is opened, as shown in figure 4, the database instance switching device includes: receiving module 401, determining module 402, first Obtain module 403 and the first sending module 404, in which:
Receiving module 401 be configured as receive at least two database servers send be deployed in each database server On database instance example information;
Determining module 402 is configured as the example information according to each database instance, determines example handoff relation;Wherein, Example handoff relation is corresponding for being characterized in the role of primary database instance and standby database example in each database instance Relationship;
First acquisition module 403 is configured as working as detects that the first database configured extremely is real in each database instance When example, believed according to the example that example handoff relation obtains the second spare database instance corresponding with first database example Breath;
First sending module 404 is configured as sending to switch to target application corresponding with first database example indicating to disappear It ceases, includes the example information of the second database instance in switch indicating information, be used to indicate target application by database access It is revised as the address of the second database instance in location.
The device that the embodiment of the present disclosure provides can be used in executing the technical solution of embodiment illustrated in fig. 1, executive mode Similar with beneficial effect, details are not described herein again.
In a kind of possible embodiment, example information includes: the internet address IP of database server, example end Mouth, example Copy Info, active and standby heartbeat message and database role.
In a kind of possible embodiment, as shown in figure 5, the database instance switching device shown in Fig. 4 can also wrap Include: first detection module 501 is configured as whether detection first database example breaks down;
First sending module 404 when detecting that first database example breaks down, to first database example pair The target application answered sends switch indicating information.
Fig. 6 is a kind of block diagram of database instance switching device shown according to an exemplary embodiment, which can be with Adopt and implement in various manners, for example, in database server implementing device all components, alternatively, in database server The side component in implementing device in a coupled manner;The device can be above-mentioned by being implemented in combination with for software, hardware or both This disclosure relates to method, as shown in fig. 6, the database instance switching device include: the second detection module 601, second obtain Module 602 and the second sending module 603, in which:
Second detection module 601 is configured as the database instance that detection is deployed on database server;
Second acquisition module 602 is configured as obtaining the example information of detected database instance;
Second sending module 603 is configured as sending the example information of acquired database instance to control server.
Fig. 7 is a kind of block diagram of database instance switching device 700 shown according to an exemplary embodiment, and database is real Example switching device 700 is suitable for control server, and database instance switching device 700 includes:
Processor 701;
Memory 702 for storage processor executable instruction;
Wherein, processor 701 is configured as:
Receive the reality for the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, example handoff relation is for characterizing Role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, obtained according to example handoff relation Take the example information of the second spare database instance corresponding with first database example;
Switch indicating information is sent to target application corresponding with first database example, includes the in switch indicating information The example information of two database instances is used to indicate target application for database access address and is revised as the second database instance Address.
In one embodiment, example information includes: the internet address IP of database server, instance port, example Copy Info, active and standby heartbeat message and database role.
In one embodiment, above-mentioned processor 701 is also configured to: to mesh corresponding with first database example Before mark application sends switch indicating information, whether detection first database example breaks down;
Switch indicating information is sent to target application corresponding with first database example, comprising:
When detecting that first database example breaks down, sent to target application corresponding with first database example Switch indicating information.
Fig. 8 is a kind of block diagram of database instance switching device 800 shown according to an exemplary embodiment, and database is real Example switching device 800 is suitable for database server, and database instance switching device 800 includes:
Processor 801;
Memory 802 for storage processor executable instruction;
Wherein, processor 801 is configured as:
Detect the database instance being deployed on database server;
Obtain the example information of detected database instance;
The example information of acquired database instance is sent to control server.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 9 is a kind of block diagram of database instance switching device shown according to an exemplary embodiment.For example, database Example switching device 900 may be provided as a control server.Database instance switching device 900 includes processing component 902, It further comprises one or more processors, and the memory resource as representated by memory 903, can be by for storing Manage the instruction of the execution of component 902, such as application program.The application program stored in memory 903 may include one or one Each more than a corresponds to the module of one group of instruction.In addition, processing component 902 is configured as executing instruction, on executing State method.
Database instance switching device 900 can also include that a power supply module 906 is configured as executing database instance The power management of switching device 900, a wired or wireless network interface 905 are configured as device 900 being connected to network, and One input and output (I/O) interface 908.Database instance switching device 900 can be operated based on the behaviour for being stored in memory 903 Make system, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
A kind of non-transitorycomputer readable storage medium, when the instruction in storage medium is by database instance switching device When 900 processor executes, so that database instance switching device 900 is able to carry out following method, method includes:
Receive the reality for the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, example handoff relation is for characterizing Role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, obtained according to example handoff relation Take the example information of the second spare database instance corresponding with first database example;
Switch indicating information is sent to target application corresponding with first database example, includes the in switch indicating information The example information of two database instances is used to indicate target application for database access address and is revised as the second database instance Address.
In one embodiment, example information includes: the internet address IP of database server, instance port, example Copy Info, active and standby heartbeat message and database role.
In one embodiment, to target application corresponding with first database example send switch indicating information it Before, method further include:
Whether detection first database example breaks down;
Switch indicating information is sent to target application corresponding with first database example, comprising:
When detecting that first database example breaks down, sent to target application corresponding with first database example Switch indicating information.
Those skilled in the art will readily occur to its of the disclosure after considering specification and practicing disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (12)

1. a kind of database instance switching method, which is characterized in that the described method includes:
Receive the reality for the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, the example handoff relation is used for It is characterized in role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, is switched according to the example and closed System obtains the example information of the second spare database instance corresponding with the first database example;
Switch indicating information is sent to target application corresponding with the first database example, is wrapped in the switch indicating information The example information for including second database instance, be used to indicate the target application database access address is revised as it is described The address of second database instance.
2. the method according to claim 1, wherein the example information includes: the interconnection of database server Net address IP, instance port, example Copy Info, active and standby heartbeat message and database role.
3. the method according to claim 1, wherein described to mesh corresponding with the first database example Before mark application sends switch indicating information, the method also includes:
Detect whether the first database example breaks down;
It is described to send switch indicating information to target application corresponding with the first database example, comprising:
When detecting that the first database example breaks down, to target application corresponding with the first database example Send switch indicating information.
4. a kind of database instance switching method, which is characterized in that the described method includes:
Detect the database instance being deployed on database server;
Obtain the example information of detected database instance;
The example information of acquired database instance is sent to control server.
5. a kind of database instance switching device characterized by comprising
Receiving module, for receiving the number of at least two database servers transmission being deployed on each database server According to the example information of library example;
Determining module determines example handoff relation for the example information according to each database instance;Wherein, the reality Example handoff relation is used to be characterized in the role couple of primary database instance and standby database example in each database instance It should be related to;
First obtains module, for when detecting the first database example configured extremely in each database instance, The example for obtaining the second spare database instance corresponding with the first database example according to the example handoff relation Information;
First sending module, for sending switch indicating information, institute to target application corresponding with the first database example The example information in switch indicating information including second database instance is stated, is used to indicate the target application for database Access address is revised as the address of second database instance.
6. device according to claim 5, which is characterized in that the example information includes: the interconnection of database server Net address IP, instance port, example Copy Info, active and standby heartbeat message and database role.
7. device according to claim 5, which is characterized in that described device further include:
First detection module, for detecting whether the first database example breaks down;
First sending module is when detecting that the first database example breaks down, to real with the first database The corresponding target application of example sends switch indicating information.
8. a kind of database instance switching device characterized by comprising
Second detection module, for detecting the database instance being deployed on database server;
Second obtains module, for obtaining the example information of detected database instance;
Second sending module, for sending the example information of acquired database instance to control server.
9. a kind of database instance switching device characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Receive the reality for the database instance of at least two database servers transmission being deployed on each database server Example information;
According to the example information of each database instance, example handoff relation is determined;Wherein, the example handoff relation is used for It is characterized in role's corresponding relationship of primary database instance and standby database example in each database instance;
When detecting the first database example configured extremely in each database instance, is switched according to the example and closed System obtains the example information of the second spare database instance corresponding with the first database example;
Switch indicating information is sent to target application corresponding with the first database example, is wrapped in the switch indicating information The example information for including second database instance, be used to indicate the target application database access address is revised as it is described The address of second database instance.
10. a kind of database instance switching device characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Detect the database instance being deployed on database server;
Obtain the example information of detected database instance;
The example information of acquired database instance is sent to control server.
11. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor The step of any one of claim 1-3 the method is realized when execution.
12. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor The step of any one of claim 4 the method is realized when execution.
CN201910502581.1A 2019-06-11 2019-06-11 Database instance switching method and device Pending CN110347658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910502581.1A CN110347658A (en) 2019-06-11 2019-06-11 Database instance switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910502581.1A CN110347658A (en) 2019-06-11 2019-06-11 Database instance switching method and device

Publications (1)

Publication Number Publication Date
CN110347658A true CN110347658A (en) 2019-10-18

Family

ID=68181810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910502581.1A Pending CN110347658A (en) 2019-06-11 2019-06-11 Database instance switching method and device

Country Status (1)

Country Link
CN (1) CN110347658A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597192A (en) * 2020-04-10 2020-08-28 北京百度网讯科技有限公司 Database switching control method and device and electronic equipment
CN113452766A (en) * 2021-06-22 2021-09-28 青岛海尔科技有限公司 Node switching method and device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955851A (en) * 2012-10-30 2013-03-06 北京奇虎科技有限公司 Database switching method and device
CN104252500A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Method and device for carrying out fault repairing on database management platform
CN105069160A (en) * 2015-08-26 2015-11-18 国家电网公司 Autonomous controllable database based high-availability method and architecture
CN106126652A (en) * 2016-06-24 2016-11-16 武汉斗鱼网络科技有限公司 Mishap Database changing method and system for distributed experiment & measurement system
US20190026321A1 (en) * 2017-07-20 2019-01-24 Vmware, Inc. Updating schema of a database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955851A (en) * 2012-10-30 2013-03-06 北京奇虎科技有限公司 Database switching method and device
CN104252500A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Method and device for carrying out fault repairing on database management platform
CN105069160A (en) * 2015-08-26 2015-11-18 国家电网公司 Autonomous controllable database based high-availability method and architecture
CN106126652A (en) * 2016-06-24 2016-11-16 武汉斗鱼网络科技有限公司 Mishap Database changing method and system for distributed experiment & measurement system
US20190026321A1 (en) * 2017-07-20 2019-01-24 Vmware, Inc. Updating schema of a database

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597192A (en) * 2020-04-10 2020-08-28 北京百度网讯科技有限公司 Database switching control method and device and electronic equipment
CN111597192B (en) * 2020-04-10 2023-10-03 北京百度网讯科技有限公司 Database switching control method and device and electronic equipment
CN113452766A (en) * 2021-06-22 2021-09-28 青岛海尔科技有限公司 Node switching method and device, storage medium and electronic device
CN113452766B (en) * 2021-06-22 2023-10-24 青岛海尔科技有限公司 Node switching method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
US7961594B2 (en) Methods and systems for history analysis for access paths in networks
US9071535B2 (en) Comparing node states to detect anomalies
US7451175B2 (en) System and method for managing computer networks
US10320604B1 (en) Sending alerts from cloud computing systems
JP2017084333A (en) Method and system for monitoring virtual machine cluster
US9736046B1 (en) Path analytics using codebook correlation
CN103812699A (en) Monitoring management system based on cloud computing
JP2014112400A (en) Method and apparatus for generating configuration rules for computing entities within computing environment by using association rule mining
US7681088B2 (en) Apparatus expressing high availability cluster demand based on probability of breach
US20070168201A1 (en) Formula for automatic prioritization of the business impact based on a failure on a service in a loosely coupled application
US11706080B2 (en) Providing dynamic serviceability for software-defined data centers
WO2020073821A1 (en) Cluster management method, apparatus and system
CN108984349A (en) Host node electoral machinery and device, medium and calculating equipment
CN110347658A (en) Database instance switching method and device
CN108388433B (en) Management platform deployment method of super-fusion system
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN104579717B (en) DCN Fault Locating Method and device
CN105490847B (en) A kind of private cloud storage system interior joint failure real-time detection and processing method
CN111988169B (en) Method, system, equipment and medium for cleaning and repairing abnormal disk of cloud platform
CN110750425A (en) Database monitoring method, device and system and storage medium
JPH0728667A (en) Fault-tolerant computer system
CN110287066B (en) Server partition migration method and related device
JP2010009127A (en) Management program and management device
TWI698741B (en) Method for remotely clearing abnormal status of racks applied in data center
US9137121B1 (en) Managing networks utilizing network simulation

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191018

RJ01 Rejection of invention patent application after publication