WO2024103898A1 - Database cluster management method and apparatus - Google Patents

Database cluster management method and apparatus Download PDF

Info

Publication number
WO2024103898A1
WO2024103898A1 PCT/CN2023/115359 CN2023115359W WO2024103898A1 WO 2024103898 A1 WO2024103898 A1 WO 2024103898A1 CN 2023115359 W CN2023115359 W CN 2023115359W WO 2024103898 A1 WO2024103898 A1 WO 2024103898A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
response
group
slave
data
Prior art date
Application number
PCT/CN2023/115359
Other languages
French (fr)
Chinese (zh)
Inventor
高新刚
Original Assignee
京东科技信息技术有限公司
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 京东科技信息技术有限公司 filed Critical 京东科技信息技术有限公司
Publication of WO2024103898A1 publication Critical patent/WO2024103898A1/en

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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a method and device for database cluster management.
  • the data consistency disaster recovery method currently commonly used in the database field is the master-slave replication method, which includes a master database and multiple slave databases.
  • the master database is responsible for providing read and write access services to the outside world, and the slave databases synchronously replicate the operation logs of the master database to back up the data in the master database in real time.
  • Network jitter or excessive slave database downtime will block the data synchronization process and the response message return process of the slave database, resulting in low data writing efficiency in the master database.
  • the embodiments of the present disclosure provide a method and device for database cluster management, which can improve transaction processing efficiency, avoid the impact of network jitter and database node failure on transaction processing, provide flexible data consistency disaster recovery services, and dynamically adjust disaster recovery strategies.
  • a method for managing a database cluster including:
  • the data to be written is written into a master database in the database cluster, and transmitted from the master database to a plurality of slave databases in the database cluster;
  • determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
  • the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
  • the method further includes:
  • the slave database group configuration information of the database cluster is obtained, and the slave database group configuration information includes: slave databases included in each slave data group in the database cluster, and their group response strategies.
  • the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
  • the method further includes:
  • the wake-up response strategy configuration information of the database cluster is obtained, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
  • the method further includes:
  • a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
  • a database cluster management device including:
  • a data writing and transmission module used for writing the data to be written into a master database in the database cluster in response to a data writing transaction, and transmitting the data from the master database to a plurality of slave databases in the database cluster;
  • a response result determination module used to determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
  • the response message generating module is used to generate a response message corresponding to the data writing transaction according to the response results of each slave database group in the database cluster.
  • determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
  • the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
  • the device also includes: a group configuration information acquisition module, which is used to obtain the slave database group configuration information of the database cluster before determining the response results of each slave database group in the database cluster, and the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
  • a group configuration information acquisition module which is used to obtain the slave database group configuration information of the database cluster before determining the response results of each slave database group in the database cluster
  • the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
  • the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
  • the device also includes: a wake-up response strategy configuration information acquisition module, which is used to obtain the wake-up response strategy configuration information of the database cluster before generating a response message corresponding to the data write transaction, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
  • a wake-up response strategy configuration information acquisition module which is used to obtain the wake-up response strategy configuration information of the database cluster before generating a response message corresponding to the data write transaction
  • the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
  • the apparatus further includes: a data replication mode configuration information scanning module, configured to scan the data replication mode configuration information of the database cluster before determining the response result of each slave database group in the database cluster to confirm that the group response strategy is in an on state;
  • a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
  • a database cluster system including:
  • a master database a plurality of slave databases, and a database cluster management device configured on the master database;
  • the database cluster management device writes the data to be written into a master database in the database cluster in response to the data writing transaction, and transmits the data from the master database to multiple slave databases in the database cluster;
  • the database cluster management device determines the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
  • the database cluster management device generates a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
  • an electronic device including:
  • processors one or more processors
  • a storage device for storing one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.
  • An embodiment of the above invention has the following advantages or beneficial effects: by grouping the slave databases and generating a reply message according to the response result of the slave database group, the influence of the slave database node failure and network jitter on the master database receiving the response message can be avoided, and the processing efficiency of the database write service can be improved; by configuring the database group configuration information, different slave databases and group response strategies can be obtained, so as to meet different data consistency disaster recovery strategies; by configuring the wake-up response strategy configuration information of the database cluster, the wake-up response strategy of the database cluster can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the data replication mode configuration information of the database cluster, the latest data replication mode can be obtained and made effective, and by modifying the data replication mode configuration information, the Adjust the database's data consistency disaster recovery strategy without restarting the database cluster service.
  • FIG1 is a schematic diagram of the main process of a method for managing a database cluster according to an embodiment of the present disclosure
  • FIG2 is a schematic diagram of a process of database cluster management according to an embodiment of the present disclosure
  • FIG3 is a schematic diagram of a single group working principle of a method for managing a database cluster according to a reference embodiment of the present disclosure
  • FIG4 is a schematic diagram of grouping slave databases according to different disaster recovery requirements
  • FIG5 is a schematic diagram of the overall working principle of a method for managing a database cluster according to another reference embodiment of the present disclosure
  • FIG6 is a schematic diagram of a process of database cluster management summarized according to the prior art
  • FIG7 is a schematic diagram of main modules of a device for database cluster management according to an embodiment of the present disclosure.
  • FIG8 is a schematic diagram of a database cluster system according to an embodiment of the present disclosure.
  • FIG9 is a diagram of an exemplary system architecture in which embodiments of the present disclosure may be applied.
  • FIG. 10 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present disclosure.
  • Database-related products and technologies have been widely used in many industries such as finance, transportation, medical care, and education, becoming the cornerstone products of digital construction. Database failures are inevitable, so the data consistency disaster recovery capability of database products is a core issue of concern to users.
  • the disaster recovery method commonly used by database products is the master-slave replication method.
  • the master database is responsible for providing services to the outside world, and the slave database will synchronize the operations of the master database and back up the data in the master database in real time.
  • a slave database is selected as the new master database to continue to provide database services.
  • the disaster recovery strategy of the master-slave replication method is single and cannot meet the personalized needs of users in different industries for data consistency disaster recovery strategies; when adjusting the disaster recovery strategy, the database cluster service needs to be restarted, affecting business continuity; and network jitter and slave database failures will also affect the data synchronization of the master database, resulting in low transaction processing efficiency.
  • a method for managing a database cluster is provided.
  • Fig. 1 is a schematic diagram of the main process of the method for managing a database cluster according to an embodiment of the present disclosure. As shown in Fig. 1 , the method for managing a database cluster according to an embodiment of the present disclosure mainly includes the following steps S101 to S103.
  • Step S101 in response to a data writing transaction, write the data to be written into a master database in a database cluster, and transmit the data from the master database to a plurality of slave databases in the database cluster.
  • data write transactions usually come from transaction requests issued by various applications on the computer, and the transaction requests are received by the database cluster.
  • the database cluster includes a The master database of the database cluster is responsible for providing external read and write access services, and the slave database of the database cluster is responsible for real-time synchronization of the operation log in the master database, so that the data in the slave database is consistent with that in the master database, so as to serve as a backup of the master database.
  • a master database and multiple slave databases are used to obtain a sufficient number of data backups to ensure that when the master database fails, there is a slave database with complete data backup, and it also prepares for providing multiple data consistency disaster recovery strategies.
  • FIG. 2 is a flow chart of database cluster management according to an embodiment of the present disclosure.
  • the database cluster includes a master database 202 and multiple slave databases, wherein the slave database 205 is marked as an example.
  • various applications 201 on the computer send data write requests to the master database 202 in the database cluster, and the master database writes the corresponding transaction operation to the binary log 203.
  • the master database By monitoring the relevant log parameters of the master database 202, it can be identified that the data of the master database 202 and the multiple slave databases are inconsistent, and then the multiple slave databases will send a communication request to the master database 202 to read the newly added log information on the master database.
  • the slave database 205 saves the received log information to the relay log 204, and subsequently transmits the data to be written from the master database 202 to the slave database 205 according to the log information, and writes the transaction operation of the slave database 205 to the binary log 206.
  • Step S102 determining the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that has successfully written the data to be written.
  • the slave database After the data to be written is successfully written to the slave database, the slave database will send a corresponding response message to the master database to indicate that the slave database has completed the data writing operation.
  • the content of the response message received by the master database includes: the slave database number, the name of the log file read on the master database and the specific reading position in the log, the timestamp of receiving the response message, etc.
  • Slave database grouping is to group slave databases in the database cluster according to the preset group response strategy.
  • the group response strategy can be determined according to the disaster recovery requirements that meet security regulations or the disaster recovery requirements set by the user.
  • the response information received by the master database can determine the slave database that sends the response message, and then determine the slave database group to which the slave database belongs, and divide the response message into each slave database group, so as to determine the response result of each slave database group in the database cluster.
  • the slave databases with unstable network or prone to downtime can be grouped with the slave databases with stable network, and the response message is generated according to the response result of the slave database group, which can avoid the influence of slave database node failure and network jitter on the master database receiving the response message, and improve the processing efficiency of the database write service.
  • determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
  • the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the group response strategy, a group response message of any slave database group is generated to obtain the response result of any slave database group.
  • the slave database that sends the response message can be determined, and the slave database group to which the slave database is located can be determined according to the slave database, and then the slave database group to which the response message belongs can be determined.
  • the completion of the data write transaction of the slave database in each slave database group can be known.
  • Each slave database group has a corresponding group response strategy, and whether the group response strategy is met is determined according to the response message of the slave database group. When the slave database meets its corresponding group response strategy, a group response message of the slave database group will be generated.
  • the slave database group determines the slave database group to which the response message belongs based on the slave database. For example, slave database 205 belongs to slave database group 1. Then, based on the response message sent by slave database 205 to the main database, the number of response messages of slave database group 1 should be increased; the group response strategy can be to set a response message number threshold. When the number of response messages of the slave database group satisfies the group response strategy, that is, the number of response messages of the slave database group reaches the response message number threshold, the response result of the slave database group is obtained.
  • FIG3 is a schematic diagram of the working principle of a single group of a method for database cluster management according to a reference embodiment of the present disclosure. As shown in FIG3, it is a state change process of a slave database group, and the group response strategy of the slave database group is: when the response message of the slave database group is 2, a group response message of the slave database group is generated.
  • the slave database group has two states. In the slave database group state 301, the main database receives a response message from the group member 1 of the slave database group.
  • the number of response messages of the slave database group is 1, and the group response strategy of the slave database group is not met, so the group response message of the slave database group cannot be generated; after a period of waiting for the response message, the main database receives a response message from the group member 2 of the slave database group, so the slave database group state 301 changes to the slave database group state 302.
  • the number of response messages of the slave database group is 2 at this time, which meets the group response strategy of the slave database group, that is, the number of response messages reaches the response message number threshold, so the slave database group will generate a group response message of the slave database group, and then obtain the response result of the slave database group.
  • the slave database group configuration information of the database cluster can be obtained.
  • the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
  • the database cluster has slave database group configuration information, which is obtained based on the user's disaster recovery requirements, including: slave databases contained in each slave data group in the database cluster, and their group response strategies.
  • slave database group configuration information When grouping the database, you can group them according to the data security regulations of different industries, or you can group the slave databases according to the personalized disaster recovery needs of users.
  • the slave database group configuration information you can obtain the latest slave database grouping and group response strategy to meet the latest disaster recovery needs and avoid the new slave database grouping and group response strategy not taking effect in time.
  • FIG4 is a schematic diagram of grouping slave databases according to different disaster recovery requirements. As shown in FIG4, the slave databases in the three computer rooms in the two cities (i.e., two locations and three centers) are grouped, and the corresponding slave database grouping configuration information is obtained according to different disaster recovery requirements, so that different slave database groups can be obtained.
  • each computer room has a slave database, and the disaster recovery requirement is that the data replication of at least one slave database is consistent, then all slave databases can be grouped together, and when the master database receives a response message, it means that at least one slave database has successfully completed data replication, and the disaster recovery requirement of slave database group 401 can be met; in slave database group 402, each computer room has a slave database, and the disaster recovery requirement is that the data replication of any remote computer room is consistent, and the remote computer room refers to other computer rooms other than the computer room where the master database is located, namely computer room B and computer room C.
  • the slave databases in computer room B and computer room C can be grouped together, and computer room A where the master database is located can be grouped together separately.
  • the master database receives a group response message from the slave database group where computer rooms B and computer room C are located, , indicating that any slave database in a remote computer room has successfully completed data replication, that is, the disaster recovery requirement of slave database group 402 is met; in slave database group 403, the disaster recovery requirement is that the remote data replication is consistent, then the slave databases in computer room C that are not in the same city as the master database can be grouped together, and when the master database receives the group response message of the slave database group in other cities, it indicates that the remote slave databases have successfully completed data replication, that is, the disaster recovery requirement of slave database group 403 is met; in slave database group 404, the disaster recovery requirement is that the data replication of the three computer rooms is consistent, then the slave databases in different computer rooms can be grouped together respectively, and when the master database receives the group response message of different slave database groups, it
  • the slave database grouping configuration information of the database cluster it is possible to obtain which slave databases are included in each slave database group and the preset grouping response strategy; and according to the user's disaster recovery needs, the slave database grouping configuration information is adjusted to obtain different slave database groups and different grouping response strategies.
  • the slave database grouping method is very flexible and can fully consider the situation of multiple regions and multiple computer rooms.
  • the number of slave database groups can be one or more, and the number of slave databases in a slave database group can be one or more.
  • Step S103 Generate a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
  • Each slave database group has a response result, and different response messages corresponding to the data write transaction can be generated according to different response results.
  • Figure 5 is a schematic diagram of the overall working principle of the method for database cluster management according to another reference embodiment of the present disclosure. As shown in Figure 5, each slave database group will generate a group response message to indicate the response result, and the group response messages of each slave database group can be collected together for easy analysis and processing. According to the response result indicated by the group response message, a response message corresponding to the data write transaction is generated. By generating a response message based on the response result, the response strategy can be flexibly set to meet various disaster recovery requirements and improve the transaction processing efficiency of the database cluster.
  • the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
  • the response results can be divided into generating a group response message and not generating a group response message.
  • the database group will issue a response result of not generating a group response message; when the number of response messages from the database group meets the group response strategy, the database group will issue a response result of generating a group response message.
  • the database cluster is preset with a wake-up response strategy, as shown in Figure 5.
  • the group response messages are aggregated through the group response message set to determine whether the number of group response messages meets the preset wake-up response strategy. If the wake-up response strategy is met, a wake-up response message is issued. If the wake-up response strategy is not met, an abnormal response message is issued.
  • the response status of each group can be clearly known.
  • Setting the wake-up response strategy can meet different disaster recovery requirements.
  • Setting different response messages can understand the data writing status of the data to be written. Even if the wake-up response strategy is not met, corresponding processing can be made according to the abnormal response message, thereby further improving the transaction processing efficiency of the database cluster.
  • wake-up response strategy configuration information of a database cluster is obtained, and the wake-up response strategy configuration information includes: a wake-up response strategy of the database cluster.
  • the database cluster has wake-up response strategy configuration information, including the wake-up response strategy of the database cluster.
  • the wake-up response strategy may be related to the reply message.
  • a reply message number threshold is set in the wake-up response strategy. When the number of reply messages reaches the reply message number threshold, it is judged that the wake-up response strategy is satisfied; otherwise, when the number of reply messages reaches the reply message number threshold, it is judged that the wake-up response strategy is not satisfied.
  • the latest wake-up response strategy can be obtained to meet the latest disaster recovery requirements and avoid the new wake-up response strategy not taking effect in time.
  • FIG6 is a schematic diagram of the process of database cluster management summarized according to the prior art.
  • each slave database will return its own response message to the master database, and the database cluster will set a response message number threshold, which is usually greater than the value of the slave database.
  • the wake-up response message is generated only when the number of response messages returned by the slave databases received by the master database reaches the threshold of the number of response messages. For example, there are 10 slave databases in the database cluster.
  • slave databases in the same region (i.e., local) as the master database and slave databases in other different regions (i.e., remote) can be divided into a slave database group, and the group response strategy of the slave database group can be set as follows: when the number of response messages from the slave database group is a value X, a group response message of the slave database group is generated, where the value X is a value not greater than the number of local slave databases.
  • a group response message and a wake-up reply message can be generated when a response message is returned from a local slave database, thereby avoiding long waits for group response messages from remote slave database groups, and avoiding the impact of network jitter or failure of a slave database on the generation of group response messages and wake-up reply messages, thereby improving the number of responses.
  • Transaction processing efficiency of database clusters can be generated when a response message is returned from a local slave database, thereby avoiding long waits for group response messages from remote slave database groups, and avoiding the impact of network jitter or failure of a slave database on the generation of group response messages and wake-up reply messages, thereby improving the number of responses.
  • a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
  • the database cluster has data replication mode configuration information, and the data replication mode of the slave database can be configured according to the data replication mode configuration information.
  • the data replication mode set in the data replication mode configuration information is used; when the group response strategy is in the off state, the default data replication mode is used.
  • a system table can be set in the master database to save the data replication mode configuration information in the system table.
  • the data replication mode configuration information may include: the number of the group response strategy, that is, multiple group response strategies can be saved in the system table; the name of the group response strategy; the specific group response strategy, which can be a string, by setting the string matching mode, different group response strategies are matched according to different strings obtained from the system table; the default group response strategy; the creator, modifier and corresponding timestamp of each group response strategy, etc.
  • the default data replication mode can be set, and the consistency of data replication can still be guaranteed when the group response strategy is not enabled.
  • the latest data replication mode can be obtained, including: how to group from the database, the group response strategy of each group, and the wake-up response strategy.
  • the data consistency disaster recovery strategy of the database can be adjusted in real time without restarting the database cluster service.
  • a device for managing a database cluster is provided.
  • FIG. 7 is a schematic diagram of main modules of a device for managing a database cluster according to an embodiment of the present disclosure.
  • the device 700 for managing a database cluster mainly includes:
  • the data writing and transmission module 701 is used to write the data to be written into the master database in the database cluster in response to the data writing transaction, and transmit the data from the master database to multiple slave databases in the database cluster;
  • a response result determination module 702 is used to determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
  • the response message generating module 703 is used to generate a response message corresponding to the data writing transaction according to the response results of each slave database group in the database cluster.
  • determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
  • the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
  • the device 700 for managing a database cluster also includes: a group configuration information acquisition module, which is used to obtain the slave database group configuration information of the database cluster before determining the response results of each slave database group in the database cluster, and the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
  • the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
  • the device 700 for database cluster management also includes: a wake-up response strategy configuration information acquisition module, which is used to obtain the wake-up response strategy configuration information of the database cluster before generating a response message corresponding to the data write transaction, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
  • the database cluster management apparatus 700 further includes: a data replication mode configuration information scanning module, which is used to scan the data replication mode configuration information of the database cluster before determining the response result of each slave database group in the database cluster to confirm that the group response strategy is in an on state;
  • a response message corresponding to the data write transaction is generated according to the preset response strategy and the response message received by the primary database.
  • a database cluster system is provided.
  • FIG8 is a schematic diagram of a database cluster system according to an embodiment of the present disclosure.
  • the database cluster system 800 mainly includes: a master database 801, multiple slave databases, and a database cluster management device 802 configured on the master database 801, wherein the multiple slave databases can be distributed in different computer rooms in different cities, and the database cluster management device 802 can manage the slave databases in the database cluster system 800 across computer rooms and regions;
  • the database cluster management device 802 configured on the master database 801 writes the data to be written into the master database 801 in the database cluster in response to the data writing transaction, and transmits the data from the master database 801 to the multiple slave databases in the database cluster;
  • the database cluster management device 802 configured on the master database 801 determines the response of each slave database group in the database cluster according to the response message received by the master database 801. Result; A response message is sent from the slave database that successfully writes the data to be written;
  • the database cluster management device 802 configured on the master database 801 generates a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
  • the influence of the slave database node failure and network jitter on the reception of the response message of the master database can be avoided, thereby improving the processing efficiency of the database write service; by configuring the database group configuration information, different slave databases and group response strategies can be obtained to meet different data consistency disaster recovery strategies; by configuring the wake-up response strategy configuration information of the database cluster, the wake-up response strategy of the database cluster can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the data replication mode configuration information of the database cluster, the latest data replication mode can be obtained and made effective, and by modifying the data replication mode configuration information, the data consistency disaster recovery strategy of the database can be adjusted in real time without restarting the database cluster service.
  • an electronic device for database cluster management comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect of the embodiment of the present disclosure.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present disclosure is implemented.
  • FIG. 9 shows an exemplary system architecture 900 to which the method or apparatus for managing a database cluster according to an embodiment of the present disclosure can be applied.
  • system architecture 900 may include terminal devices 901, 902, 903, a network 904, and a server 905.
  • Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905.
  • Network 904 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
  • terminal devices 901, 902, 903 Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages, etc.
  • Various communication client applications can be installed on terminal devices 901, 902, 903, such as database cluster management applications, database cluster status display applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
  • the terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
  • the server 905 may be a server that provides various services, such as a background management server (only as an example) that provides support for data write requests sent from upstream terminal devices 901, 902, and 903.
  • the background management server may write the data to be written into the master database in the database cluster, and transmit the data from the master database to multiple slave databases in the database cluster; determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written; generate a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster; and feed back the response result of the data write transaction (only as an example) to the terminal device.
  • the method for billing management provided in the embodiment of the present disclosure is generally
  • the method for managing a database cluster provided in the embodiment of the present disclosure may also be performed by the terminal devices 901, 902, and 903, and the apparatus for managing a database cluster may be provided in the terminal devices 901, 902, and 903 accordingly.
  • FIG 10 a schematic diagram of the structure of a computer system 1000 suitable for implementing a terminal device of an embodiment of the present disclosure is shown.
  • the terminal device shown in Figure 10 is only an example and should not limit the functions and scope of use of the embodiment of the present disclosure.
  • the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for the operation of the system 1000 are also stored.
  • the CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004.
  • An input/output (I/O) interface 1005 is also connected to the bus 1004.
  • the following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc.
  • the communication section 1009 performs communication processing via a network such as the Internet.
  • a drive 1010 is also connected to the I/O interface 1005 as needed.
  • a removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
  • an embodiment of the present disclosure includes a computer program
  • the computer program includes a computer program carried on a computer readable medium, and the computer program includes a program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication part 1009, and/or installed from the removable medium 1011.
  • the central processing unit (CPU) 1001 the above functions defined in the system of the embodiment of the present disclosure are executed.
  • the computer-readable medium shown in the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
  • the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
  • the program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • each box in the flowchart or block diagram may represent a module, program segment, or a portion of the code.
  • the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function.
  • the functions marked in the box can also occur in an order different from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed basically in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
  • each box in the block diagram or flow chart, and the combination of boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
  • the modules described may also be set in a processor, for example, it may be described as: a processor includes a data writing and transmission module, a response result determination module and a reply message generation module, wherein the names of these modules do not constitute a limitation on the modules themselves under certain circumstances, for example, the response result determination module may also be described as "a module for determining a response result according to a response message returned from a database".
  • the disclosed embodiment also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device.
  • the above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: in response to a data write transaction, the data to be written is written to a master database in a database cluster, and the master database is transmitted to multiple slave databases in the database cluster; according to the response message received by the master database, the response result of each slave database group in the database cluster is determined; the response message is sent by the slave database that successfully writes the data to be written; according to the response result of each slave database group in the database cluster, a reply message corresponding to the data write transaction is generated.
  • the influence of slave database node failures and network jitter on the master database receiving the response message can be avoided, thereby improving the database write service efficiency.
  • the database grouping configuration information By configuring the database grouping configuration information, different slave databases and grouping response strategies can be obtained to meet different data consistency disaster recovery strategies; by configuring the database cluster wake-up response strategy configuration information, the database cluster wake-up response strategy can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the database cluster data replication mode configuration information, the latest data replication mode can be obtained and made effective; by modifying the data replication mode configuration information, the database data consistency disaster recovery strategy can be adjusted in real time without restarting the database cluster service.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure relates to the technical field of computers, and provides a database cluster management method and apparatus. A specific embodiment of the database cluster management method comprises: in response to a data write transaction, writing data to be written into a master database in a database cluster, and transmitting said data from the master database to a plurality of slave databases in the database cluster; according to a response message received by the master database, determining a response result of each slave database group in the database cluster, the response message being sent by a slave database which said data is successfully written into; and according to the response result of each slave database group in the database cluster, generating a reply message corresponding to the data write transaction. According to the embodiment, the efficiency of transaction processing can be improved, the influence of network jitter and database node failure on transaction processing can be avoided, a flexible disaster recovery service for data consistency can be provided, and the disaster recovery strategy can be dynamically adjusted.

Description

数据库集群管理的方法和装置Database cluster management method and device
本申请要求于2022年11月14日提交的题为“一种数据库集群管理的方法和装置”的中国专利申请No.202211421245.2的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。This application claims priority to Chinese Patent Application No. 202211421245.2, filed on November 14, 2022, entitled “A Method and Apparatus for Database Cluster Management”, and the contents disclosed in the above-mentioned Chinese patent application are hereby cited in their entirety as a part of this application.
技术领域Technical Field
本公开涉及计算机技术领域,尤其涉及一种数据库集群管理的方法和装置。The present disclosure relates to the field of computer technology, and in particular to a method and device for database cluster management.
背景技术Background technique
不同行业对数据库的数据一致性容灾服务有着不同的要求。目前数据库领域普遍使用的数据一致性容灾方式是主从复制方式,包括一个主数据库和多个从数据库,主数据库负责对外提供读写访问服务,从数据库同步复制主数据库的操作日志,以实时备份主数据库中的数据。Different industries have different requirements for database data consistency disaster recovery services. The data consistency disaster recovery method currently commonly used in the database field is the master-slave replication method, which includes a master database and multiple slave databases. The master database is responsible for providing read and write access services to the outside world, and the slave databases synchronously replicate the operation logs of the master database to back up the data in the master database in real time.
在实现本公开过程中,发明人发现现有技术中至少存在如下问题:In the process of implementing the present disclosure, the inventors found that there are at least the following problems in the prior art:
网络抖动或从数据库宕机数量过多会阻塞数据同步过程以及从数据库的响应消息返回过程,导致主数据库数据写入效率低。Network jitter or excessive slave database downtime will block the data synchronization process and the response message return process of the slave database, resulting in low data writing efficiency in the master database.
发明内容Summary of the invention
有鉴于此,本公开实施例提供一种数据库集群管理的方法和装置,能够提高事务处理效率,避免网络抖动与数据库节点故障对事务处理的影响,能够提供灵活的数据一致性容灾服务,动态调整容灾策略。In view of this, the embodiments of the present disclosure provide a method and device for database cluster management, which can improve transaction processing efficiency, avoid the impact of network jitter and database node failure on transaction processing, provide flexible data consistency disaster recovery services, and dynamically adjust disaster recovery strategies.
为实现上述目的,根据本公开实施例的一个方面,提供了一种数据库集群管理的方法,包括:To achieve the above objective, according to one aspect of an embodiment of the present disclosure, a method for managing a database cluster is provided, including:
响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输; In response to a data write transaction, the data to be written is written into a master database in the database cluster, and transmitted from the master database to a plurality of slave databases in the database cluster;
根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;Determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。A response message corresponding to the data write transaction is generated according to the response results of each slave database group in the database cluster.
根据本公开的一个或多个实施例,根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果,包括:According to one or more embodiments of the present disclosure, determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
根据所述主数据库接收到的响应消息,更新发出所述响应消息的从数据库分组的响应消息数量;在所述数据库集群中任一从数据库分组的响应消息数量满足预设分组响应策略的情况下,生成所述任一从数据库分组的分组响应消息,从而得到所述任一从数据库分组的响应结果。According to the response message received by the master database, the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
根据本公开的一个或多个实施例,所述方法还包括:According to one or more embodiments of the present disclosure, the method further includes:
在确定所述数据库集群中各个从数据库分组的响应结果之前,获取所述数据库集群的从数据库分组配置信息,所述从数据库分组配置信息包括:所述数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。Before determining the response results of each slave database group in the database cluster, the slave database group configuration information of the database cluster is obtained, and the slave database group configuration information includes: slave databases included in each slave data group in the database cluster, and their group response strategies.
根据本公开的一个或多个实施例,所述响应结果为:生成分组响应消息或不生成分组响应消息;根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息,包括:According to one or more embodiments of the present disclosure, the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
判断所述数据库集群中分组响应消息的数量是否满足预设唤醒响应策略;若是,则生成与所述数据写入事务对应的唤醒应答消息,以指示所述待写入数据成功写入所述数据库集群;否则,生成与所述数据写入事务对应的异常应答消息,以指示所述待写入数据未成功写入所述数据库集群。Determine whether the number of group response messages in the database cluster meets the preset wake-up response strategy; if so, generate a wake-up response message corresponding to the data write transaction to indicate that the data to be written is successfully written to the database cluster; otherwise, generate an exception response message corresponding to the data write transaction to indicate that the data to be written is not successfully written to the database cluster.
根据本公开的一个或多个实施例,所述方法还包括: According to one or more embodiments of the present disclosure, the method further includes:
在生成与所述数据写入事务对应的应答消息之前,获取所述数据库集群的唤醒响应策略配置信息,所述唤醒响应策略配置信息包括:所述数据库集群的唤醒响应策略。Before generating a response message corresponding to the data write transaction, the wake-up response strategy configuration information of the database cluster is obtained, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
根据本公开的一个或多个实施例,所述方法还包括:According to one or more embodiments of the present disclosure, the method further includes:
在确定所述数据库集群中各个从数据库分组的响应结果之前,扫描所述数据库集群的数据复制模式配置信息,以确认分组应答策略处于开启状态;Before determining the response results of each slave database group in the database cluster, scanning the data replication mode configuration information of the database cluster to confirm that the group response strategy is in an enabled state;
在分组应答策略处于关闭状态的情况下,根据预设应答策略、以及所述主数据库接收的响应消息,生成与所述数据写入事务对应的应答消息。When the group response strategy is in a closed state, a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
根据本公开实施例的第二方面,提供一种数据库集群管理的装置,包括:According to a second aspect of an embodiment of the present disclosure, a database cluster management device is provided, including:
数据写入及传输模块,用于响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;A data writing and transmission module, used for writing the data to be written into a master database in the database cluster in response to a data writing transaction, and transmitting the data from the master database to a plurality of slave databases in the database cluster;
响应结果确定模块,用于根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;A response result determination module, used to determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
应答消息生成模块,用于根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。The response message generating module is used to generate a response message corresponding to the data writing transaction according to the response results of each slave database group in the database cluster.
根据本公开的一个或多个实施例,根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果,包括:According to one or more embodiments of the present disclosure, determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
根据所述主数据库接收到的响应消息,更新发出所述响应消息的从数据库分组的响应消息数量;在所述数据库集群中任一从数据库分组的响应消息数量满足预设分组响应策略的情况下,生成所述任一从数据库分组的分组响应消息,从而得到所述任一从数据库分组的响应结果。 According to the response message received by the master database, the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
根据本公开的一个或多个实施例,所述装置还包括:分组配置信息获取模块,用于在确定所述数据库集群中各个从数据库分组的响应结果之前,获取所述数据库集群的从数据库分组配置信息,所述从数据库分组配置信息包括:所述数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。According to one or more embodiments of the present disclosure, the device also includes: a group configuration information acquisition module, which is used to obtain the slave database group configuration information of the database cluster before determining the response results of each slave database group in the database cluster, and the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
根据本公开的一个或多个实施例,所述响应结果为:生成分组响应消息或不生成分组响应消息;根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息,包括:According to one or more embodiments of the present disclosure, the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
判断所述数据库集群中分组响应消息的数量是否满足预设唤醒响应策略;若是,则生成与所述数据写入事务对应的唤醒应答消息,以指示所述待写入数据成功写入所述数据库集群;否则,生成与所述数据写入事务对应的异常应答消息,以指示所述待写入数据未成功写入所述数据库集群。Determine whether the number of group response messages in the database cluster meets the preset wake-up response strategy; if so, generate a wake-up response message corresponding to the data write transaction to indicate that the data to be written is successfully written to the database cluster; otherwise, generate an exception response message corresponding to the data write transaction to indicate that the data to be written is not successfully written to the database cluster.
根据本公开的一个或多个实施例,所述装置还包括:唤醒响应策略配置信息获取模块,用于在生成与所述数据写入事务对应的应答消息之前,获取所述数据库集群的唤醒响应策略配置信息,所述唤醒响应策略配置信息包括:所述数据库集群的唤醒响应策略。According to one or more embodiments of the present disclosure, the device also includes: a wake-up response strategy configuration information acquisition module, which is used to obtain the wake-up response strategy configuration information of the database cluster before generating a response message corresponding to the data write transaction, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
根据本公开的一个或多个实施例,所述装置还包括:数据复制模式配置信息扫描模块,用于在确定所述数据库集群中各个从数据库分组的响应结果之前,扫描所述数据库集群的数据复制模式配置信息,以确认分组应答策略处于开启状态;According to one or more embodiments of the present disclosure, the apparatus further includes: a data replication mode configuration information scanning module, configured to scan the data replication mode configuration information of the database cluster before determining the response result of each slave database group in the database cluster to confirm that the group response strategy is in an on state;
在分组应答策略处于关闭状态的情况下,根据预设应答策略、以及所述主数据库接收的响应消息,生成与所述数据写入事务对应的应答消息。When the group response strategy is in a closed state, a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
根据本公开实施例的第三方面,提供一种数据库集群系统,包括: According to a third aspect of an embodiment of the present disclosure, a database cluster system is provided, including:
主数据库,多个从数据库,以及配置在所述主数据库上的数据库集群管理的装置;A master database, a plurality of slave databases, and a database cluster management device configured on the master database;
所述数据库集群管理的装置响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;The database cluster management device writes the data to be written into a master database in the database cluster in response to the data writing transaction, and transmits the data from the master database to multiple slave databases in the database cluster;
所述数据库集群管理的装置根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;The database cluster management device determines the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
所述数据库集群管理的装置根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。The database cluster management device generates a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
根据本公开实施例的第四方面,提供一种电子设备,包括:According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
一个或多个处理器;one or more processors;
存储装置,用于存储一个或多个程序,a storage device for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行时,所述一个或多个处理器实现上述任一实施例所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.
根据本公开实施例的第五方面,提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现上述任一实施例所述的方法。According to a fifth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.
上述发明中的一个实施例具有如下优点或有益效果:通过对从数据库进行分组,并根据从数据库分组的响应结果生成应答消息,能够避免从数据库节点故障以及网络抖动对主数据库接收响应消息的影响,提高数据库写入服务的处理效率;配置数据库分组配置信息,能够获得不同的从数据库以及分组响应策略,从而满足不同的数据一致性容灾策略;配置数据库集群的唤醒响应策略配置信息,能够灵活调整数据库集群的唤醒响应策略,进一步提高数据库集群的事务处理效率;通过扫描数据库集群的数据复制模式配置信息,能够获取到最新的数据复制模式并使其生效,通过修改数据复制模式配置信息,可以实时 调整数据库的数据一致性容灾策略,无需重启数据库集群服务。An embodiment of the above invention has the following advantages or beneficial effects: by grouping the slave databases and generating a reply message according to the response result of the slave database group, the influence of the slave database node failure and network jitter on the master database receiving the response message can be avoided, and the processing efficiency of the database write service can be improved; by configuring the database group configuration information, different slave databases and group response strategies can be obtained, so as to meet different data consistency disaster recovery strategies; by configuring the wake-up response strategy configuration information of the database cluster, the wake-up response strategy of the database cluster can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the data replication mode configuration information of the database cluster, the latest data replication mode can be obtained and made effective, and by modifying the data replication mode configuration information, the Adjust the database's data consistency disaster recovery strategy without restarting the database cluster service.
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
附图用于更好地理解本公开,不构成对本公开的不当限定。其中:The accompanying drawings are used to better understand the present disclosure and do not constitute an improper limitation on the present disclosure.
图1是根据本公开实施例的数据库集群管理的方法的主要流程的示意图;FIG1 is a schematic diagram of the main process of a method for managing a database cluster according to an embodiment of the present disclosure;
图2是根据本公开实施例的数据库集群管理的流程示意图;FIG2 is a schematic diagram of a process of database cluster management according to an embodiment of the present disclosure;
图3是根据本公开一个可参考实施例的数据库集群管理的方法的单个分组工作原理示意图;FIG3 is a schematic diagram of a single group working principle of a method for managing a database cluster according to a reference embodiment of the present disclosure;
图4是根据不同容灾需求对从数据库进行分组的示意图;FIG4 is a schematic diagram of grouping slave databases according to different disaster recovery requirements;
图5是根据本公开另一个可参考实施例的数据库集群管理的方法的整体工作原理示意图;FIG5 is a schematic diagram of the overall working principle of a method for managing a database cluster according to another reference embodiment of the present disclosure;
图6是根据现有技术归纳的数据库集群管理的流程示意图;FIG6 is a schematic diagram of a process of database cluster management summarized according to the prior art;
图7是根据本公开实施例的数据库集群管理的装置的主要模块的示意图;FIG7 is a schematic diagram of main modules of a device for database cluster management according to an embodiment of the present disclosure;
图8是根据本公开实施例的数据库集群系统的示意图;FIG8 is a schematic diagram of a database cluster system according to an embodiment of the present disclosure;
图9是本公开实施例可以应用于其中的示例性系统架构图;FIG9 is a diagram of an exemplary system architecture in which embodiments of the present disclosure may be applied;
图10是适于用来实现本公开实施例的终端设备或服务器的计算机系统的结构示意图。FIG. 10 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。 The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
需要说明的是,在不冲突的情况下,本公开实施例及实施例中的特征可以相互组合;在本公开的技术方案中,所涉及的用户个人信息的获取、存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。It should be noted that, in the absence of conflict, the embodiments of the present disclosure and the features therein may be combined with each other; in the technical solution of the present disclosure, the acquisition, storage and application of user personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
数据库相关产品及技术已经广泛应用于金融、交通、医疗、教育等众多行业,成为数字化建设的基石产品。数据库难免会发生故障,因此数据库产品的数据一致性容灾能力是用户关注的核心问题。目前,数据库产品普遍使用的容灾方式是主从复制方式,主数据库负责对外提供服务,从数据库会同步主数据库的操作,实时备份主数据库中的数据;当主数据库发生故障,选择一个从数据库作为新主数据库继续提供数据库服务。Database-related products and technologies have been widely used in many industries such as finance, transportation, medical care, and education, becoming the cornerstone products of digital construction. Database failures are inevitable, so the data consistency disaster recovery capability of database products is a core issue of concern to users. At present, the disaster recovery method commonly used by database products is the master-slave replication method. The master database is responsible for providing services to the outside world, and the slave database will synchronize the operations of the master database and back up the data in the master database in real time. When the master database fails, a slave database is selected as the new master database to continue to provide database services.
但是主从复制方式的容灾策略单一,不能满足不同行业的用户对数据一致性容灾策略的个性化需求;在调整容灾策略时需要重启数据库集群服务,影响业务连续性;并且网络抖动与从数据库故障也会影响主数据库的数据同步,进而导致事务处理效率低。However, the disaster recovery strategy of the master-slave replication method is single and cannot meet the personalized needs of users in different industries for data consistency disaster recovery strategies; when adjusting the disaster recovery strategy, the database cluster service needs to be restarted, affecting business continuity; and network jitter and slave database failures will also affect the data synchronization of the master database, resulting in low transaction processing efficiency.
有鉴于此,根据本公开实施例的一个方面,提供了一种数据库集群管理的方法。In view of this, according to one aspect of an embodiment of the present disclosure, a method for managing a database cluster is provided.
图1是根据本公开实施例的数据库集群管理的方法的主要流程的示意图。如图1所示,根据本公开实施例的数据库集群管理的方法主要包括如下的步骤S101至步骤S103。Fig. 1 is a schematic diagram of the main process of the method for managing a database cluster according to an embodiment of the present disclosure. As shown in Fig. 1 , the method for managing a database cluster according to an embodiment of the present disclosure mainly includes the following steps S101 to S103.
步骤S101,响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由主数据库向数据库集群中的多个从数据库传输。Step S101 , in response to a data writing transaction, write the data to be written into a master database in a database cluster, and transmit the data from the master database to a plurality of slave databases in the database cluster.
在本公开实施例中,数据写入事务通常来自计算机上的各类应用发出的事务请求,该事务请求被数据库集群接收。数据库集群包括一 个主数据库和多个从数据库,数据库集群的主数据库负责对外提供读写访问服务,数据库集群的从数据库负责实时同步主数据库中的操作日志,从而使得从数据库与主数据库中的数据保持一致,以作为主数据库的备份。在数据复制过程中,使用一个主数据库与多个从数据库以得到充足的数据备份数量,确保在主数据库发生故障时,存在数据完整备份的从数据库,同时也为提供多种数据一致性容灾策略做准备。In the embodiment of the present disclosure, data write transactions usually come from transaction requests issued by various applications on the computer, and the transaction requests are received by the database cluster. The database cluster includes a The master database of the database cluster is responsible for providing external read and write access services, and the slave database of the database cluster is responsible for real-time synchronization of the operation log in the master database, so that the data in the slave database is consistent with that in the master database, so as to serve as a backup of the master database. In the data replication process, a master database and multiple slave databases are used to obtain a sufficient number of data backups to ensure that when the master database fails, there is a slave database with complete data backup, and it also prepares for providing multiple data consistency disaster recovery strategies.
图2是根据本公开实施例的数据库集群管理的流程示意图。如图2所示,数据库集群包括主数据库202和多个从数据库,其中从数据库205作为示例被标出。首先由计算机上的各类应用201向数据库集群中的主数据库202发出数据写入请求,主数据库会将对应的事务操作写到二进制日志203中。通过监测主数据库202相关日志参数,可以识别出主数据库202与多个从数据库的数据不一致,然后多个从数据库会向主数据库202发出通信请求,读取主数据库上新增的日志信息。以从数据库205作为示例,从数据库205将接收到的日志信息保存至中继日志204中,后续会根据日志信息将待写入数据由主数据库202向从数据库205传输,并将从数据库205的事务操作写到二进制日志206中。FIG. 2 is a flow chart of database cluster management according to an embodiment of the present disclosure. As shown in FIG. 2 , the database cluster includes a master database 202 and multiple slave databases, wherein the slave database 205 is marked as an example. First, various applications 201 on the computer send data write requests to the master database 202 in the database cluster, and the master database writes the corresponding transaction operation to the binary log 203. By monitoring the relevant log parameters of the master database 202, it can be identified that the data of the master database 202 and the multiple slave databases are inconsistent, and then the multiple slave databases will send a communication request to the master database 202 to read the newly added log information on the master database. Taking the slave database 205 as an example, the slave database 205 saves the received log information to the relay log 204, and subsequently transmits the data to be written from the master database 202 to the slave database 205 according to the log information, and writes the transaction operation of the slave database 205 to the binary log 206.
步骤S102,根据主数据库接收的响应消息,确定数据库集群中各个从数据库分组的响应结果;响应消息由成功写入待写入数据的从数据库发出。Step S102, determining the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that has successfully written the data to be written.
在将待写入数据成功写入从数据库之后,从数据库会向主数据库发送对应的响应消息,以指示该从数据库已经完成数据写入操作。主数据库接收到的响应消息的内容包括:从数据库编号、读取的主数据库上的日志文件名称以及该日志中的具体读取位置、接收响应消息的时间戳等等。After the data to be written is successfully written to the slave database, the slave database will send a corresponding response message to the master database to indicate that the slave database has completed the data writing operation. The content of the response message received by the master database includes: the slave database number, the name of the log file read on the master database and the specific reading position in the log, the timestamp of receiving the response message, etc.
从数据库分组是按照预设的分组响应策略对数据库集群中的从数 据库进行划分得到的,分组响应策略可以依据符合安全规定的容灾需求或者用户制定的容灾需求而确定。通过主数据库接收到的响应信息可以确定发出响应消息的从数据库,进而确定从数据库所属的从数据库分组,并将响应消息划分至各个从数据库分组中,从而确定数据库集群中各个从数据库分组的响应结果。通过对从数据库进行分组,可以将网络不稳定的从数据库或者容易宕机的从数据库与网络稳定的从数据库分为一组,并根据从数据库分组的响应结果生成应答消息,能够避免从数据库节点故障以及网络抖动对主数据库接收响应消息的影响,提高数据库写入服务的处理效率。Slave database grouping is to group slave databases in the database cluster according to the preset group response strategy. The group response strategy can be determined according to the disaster recovery requirements that meet security regulations or the disaster recovery requirements set by the user. The response information received by the master database can determine the slave database that sends the response message, and then determine the slave database group to which the slave database belongs, and divide the response message into each slave database group, so as to determine the response result of each slave database group in the database cluster. By grouping the slave databases, the slave databases with unstable network or prone to downtime can be grouped with the slave databases with stable network, and the response message is generated according to the response result of the slave database group, which can avoid the influence of slave database node failure and network jitter on the master database receiving the response message, and improve the processing efficiency of the database write service.
根据本公开一个可参考的实施例,根据主数据库接收的响应消息,确定数据库集群中各个从数据库分组的响应结果,包括:According to a reference embodiment of the present disclosure, determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
根据主数据库接收到的响应消息,更新发出响应消息的从数据库分组的响应消息数量;在数据库集群中任一从数据库分组的响应消息数量满足分组响应策略的情况下,生成该任一从数据库分组的分组响应消息,从而得到该任一从数据库分组的响应结果。According to the response message received by the main database, the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the group response strategy, a group response message of any slave database group is generated to obtain the response result of any slave database group.
根据接收到的响应消息的内容,可以确定发出响应消息的从数据库,根据从数据库可以确定该从数据库所在的从数据库分组,进而确定响应消息所属的从数据库分组。通过记录从数据库分组的响应消息数量,可以知道各个从数据库分组内的从数据库的数据写入事务的完成情况。每个从数据库分组具有对应的分组响应策略,是否满足分组响应策略是根据从数据库分组的响应消息确定的。在从数据库满足其对应的分组响应策略的情况下,会生成该从数据库分组的分组响应消息。通过从数据库分组以及分组响应策略,能够避免长时间等待处于不稳定的网络中的从数据库返回响应消息,以及避免从数据库故障无法返回响应消息而难以确定响应结果的问题,从而提高数据库集群的事务处理效率。According to the content of the received response message, the slave database that sends the response message can be determined, and the slave database group to which the slave database is located can be determined according to the slave database, and then the slave database group to which the response message belongs can be determined. By recording the number of response messages of the slave database group, the completion of the data write transaction of the slave database in each slave database group can be known. Each slave database group has a corresponding group response strategy, and whether the group response strategy is met is determined according to the response message of the slave database group. When the slave database meets its corresponding group response strategy, a group response message of the slave database group will be generated. By using the slave database group and the group response strategy, it is possible to avoid waiting for a long time for a slave database in an unstable network to return a response message, and to avoid the problem that a slave database failure cannot return a response message and it is difficult to determine the response result, thereby improving the transaction processing efficiency of the database cluster.
如图2所示,从数据库发出的响应消息被主数据库接收后,会首 先根据从数据库确定该响应消息所属的从数据库分组,示例性地,从数据库205属于从数据库分组1,则根据从数据库205向主数据库发出的响应消息,应增加从数据库分组1的响应消息数量;分组响应策略可以是设定一个响应消息数量阈值,在从数据库分组的响应消息数量满足分组响应策略,即从数据库分组的响应消息数量到达响应消息数量阈值的情况下,得到该从数据库分组的响应结果。As shown in Figure 2, after the response message sent by the slave database is received by the master database, First, determine the slave database group to which the response message belongs based on the slave database. For example, slave database 205 belongs to slave database group 1. Then, based on the response message sent by slave database 205 to the main database, the number of response messages of slave database group 1 should be increased; the group response strategy can be to set a response message number threshold. When the number of response messages of the slave database group satisfies the group response strategy, that is, the number of response messages of the slave database group reaches the response message number threshold, the response result of the slave database group is obtained.
图3是根据本公开一个可参考实施例的数据库集群管理的方法的单个分组工作原理示意图。如图3所示,是一个从数据库分组的状态变化过程,该从数据库分组的分组响应策略为:从数据库分组的响应消息为2时,生成从数据库分组的分组响应消息。该从数据库分组具有两个状态,在从数据库分组状态301中,主数据库接收到了该从数据库分组的分组成员1发来的响应消息,此时该从数据库分组的响应消息数量为1,没有满足该从数据库分组的分组响应策略,所以不能生成该从数据库分组的分组响应消息;在经过一段时间等待响应消息之后,主数据库接收到了该从数据库分组的分组成员2发来的响应消息,因此从数据库分组状态301变为从数据库分组状态302,在从数据库分组状态302中,此时从数据库分组的响应消息数量为2,满足了该从数据库分组的分组响应策略,即响应消息数量到达响应消息数量阈值,因此该从数据库分组会生成从数据库分组的分组响应消息,进而得到该从数据库分组的响应结果。FIG3 is a schematic diagram of the working principle of a single group of a method for database cluster management according to a reference embodiment of the present disclosure. As shown in FIG3, it is a state change process of a slave database group, and the group response strategy of the slave database group is: when the response message of the slave database group is 2, a group response message of the slave database group is generated. The slave database group has two states. In the slave database group state 301, the main database receives a response message from the group member 1 of the slave database group. At this time, the number of response messages of the slave database group is 1, and the group response strategy of the slave database group is not met, so the group response message of the slave database group cannot be generated; after a period of waiting for the response message, the main database receives a response message from the group member 2 of the slave database group, so the slave database group state 301 changes to the slave database group state 302. In the slave database group state 302, the number of response messages of the slave database group is 2 at this time, which meets the group response strategy of the slave database group, that is, the number of response messages reaches the response message number threshold, so the slave database group will generate a group response message of the slave database group, and then obtain the response result of the slave database group.
根据本公开另一个可参考的实施例,在确定数据库集群中各个从数据库分组的响应结果之前,可以获取该数据库集群的从数据库分组配置信息,该从数据库分组配置信息包括:数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。According to another reference embodiment of the present disclosure, before determining the response results of each slave database group in the database cluster, the slave database group configuration information of the database cluster can be obtained. The slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
数据库集群具有从数据库分组配置信息,从数据库分组配置信息是根据用户的容灾需求得到的,包括:数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。对数据库集群中的从数据 库分组时,可以根据不同行业的数据安全规定来分组,也可以根据用户的个性化容灾需求对从数据库进行分组。通过从数据库分组配置信息,能够获得最新的从数据库分组以及分组响应策略,以满足最新的容灾需求,避免新的从数据库分组以及分组响应策略没有及时生效。并且通过配置从数据库分组配置信息,能够灵活地对从数据库进行分组,针对不同的从数据库分组能够实现不同的分组响应策略,从而满足不同用户的容灾需求,也可以提高数据库集群的事务处理效率。The database cluster has slave database group configuration information, which is obtained based on the user's disaster recovery requirements, including: slave databases contained in each slave data group in the database cluster, and their group response strategies. When grouping the database, you can group them according to the data security regulations of different industries, or you can group the slave databases according to the personalized disaster recovery needs of users. Through the slave database group configuration information, you can obtain the latest slave database grouping and group response strategy to meet the latest disaster recovery needs and avoid the new slave database grouping and group response strategy not taking effect in time. And by configuring the slave database group configuration information, you can flexibly group the slave databases, and implement different group response strategies for different slave database groups, thereby meeting the disaster recovery needs of different users and improving the transaction processing efficiency of the database cluster.
图4是根据不同容灾需求对从数据库进行分组的示意图。如图4所示,对两个城市的三个机房(即两地三中心)中的从数据库进行分组,根据不同的容灾需求,获取对应的从数据库分组配置信息,能够得到不同的从数据库分组。示例性地,在从数据库分组401中,每个机房具有一个从数据库,容灾需求为至少一个从数据库的数据复制一致,则可以将所有从数据库分为一组,当主数据库接收到一个响应消息时,说明至少有一个从数据库成功完成数据复制后,即可满足从数据库分组401的容灾需求;在从数据库分组402中,每个机房具有一个从数据库,容灾需求为任一异地机房的数据复制一致,异地机房指的是主数据库所在机房以外的其他机房,即机房B和机房C,根据上述分组策略可以将机房B与机房C中的从数据库分为一组,主数据库所在机房A单独分为一组,当主数据库接收到来自机房B和机房C所在从数据库分组的分组响应消息时,说明任一异地机房的从数据库成功完成数据复制,即满足从数据库分组402的容灾需求;在从数据库分组403中,容灾需求为异地数据复制一致,则可以将与主数据库不在一个城市的机房C中的从数据库分为一组,当主数据库接收到其他城市的从数据库分组的分组响应消息时,说明异地的从数据库成功完成数据复制,即满足从数据库分组403的容灾需求;在从数据库分组404中,容灾需求为是三个机房的数据复制一致,则可以将不同机房的从数据库分别分为一组,当主数据库接收到不同从数据库分组的分组响应消息时,说明不同机房内的从数据库均成功完成数据复制,即满足从数据库分组404的容灾需求。 FIG4 is a schematic diagram of grouping slave databases according to different disaster recovery requirements. As shown in FIG4, the slave databases in the three computer rooms in the two cities (i.e., two locations and three centers) are grouped, and the corresponding slave database grouping configuration information is obtained according to different disaster recovery requirements, so that different slave database groups can be obtained. Exemplarily, in slave database group 401, each computer room has a slave database, and the disaster recovery requirement is that the data replication of at least one slave database is consistent, then all slave databases can be grouped together, and when the master database receives a response message, it means that at least one slave database has successfully completed data replication, and the disaster recovery requirement of slave database group 401 can be met; in slave database group 402, each computer room has a slave database, and the disaster recovery requirement is that the data replication of any remote computer room is consistent, and the remote computer room refers to other computer rooms other than the computer room where the master database is located, namely computer room B and computer room C. According to the above grouping strategy, the slave databases in computer room B and computer room C can be grouped together, and computer room A where the master database is located can be grouped together separately. When the master database receives a group response message from the slave database group where computer rooms B and computer room C are located, , indicating that any slave database in a remote computer room has successfully completed data replication, that is, the disaster recovery requirement of slave database group 402 is met; in slave database group 403, the disaster recovery requirement is that the remote data replication is consistent, then the slave databases in computer room C that are not in the same city as the master database can be grouped together, and when the master database receives the group response message of the slave database group in other cities, it indicates that the remote slave databases have successfully completed data replication, that is, the disaster recovery requirement of slave database group 403 is met; in slave database group 404, the disaster recovery requirement is that the data replication of the three computer rooms is consistent, then the slave databases in different computer rooms can be grouped together respectively, and when the master database receives the group response message of different slave database groups, it indicates that the slave databases in different computer rooms have successfully completed data replication, that is, the disaster recovery requirement of slave database group 404 is met.
由图4可知,根据数据库集群的从数据库分组配置信息,能够得到每个从数据库分组包含哪些从数据库以及预设的分组响应策略;并且,根据用户的容灾需求,调整从数据库分组配置信息,从而得到不同的从数据库分组以及不同的分组响应策略。从数据库的分组方式十分灵活,可以充分考虑到多个地域多个机房的情况,从数据库分组的数量可以是一个或者多个,从数据库分组中的从数据库的数量可以是一个或者多个。As shown in Figure 4, according to the slave database grouping configuration information of the database cluster, it is possible to obtain which slave databases are included in each slave database group and the preset grouping response strategy; and according to the user's disaster recovery needs, the slave database grouping configuration information is adjusted to obtain different slave database groups and different grouping response strategies. The slave database grouping method is very flexible and can fully consider the situation of multiple regions and multiple computer rooms. The number of slave database groups can be one or more, and the number of slave databases in a slave database group can be one or more.
步骤S103,根据数据库集群中各个从数据库分组的响应结果,生成与数据写入事务对应的应答消息。Step S103: Generate a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
各个从数据库分组都具有响应结果,根据响应结果的不同,可以生成不同的与数据写入事务对应的应答消息。图5是根据本公开另一个可参考实施例的数据库集群管理的方法的整体工作原理示意图。如图5所示,每个从数据库分组会生成分组响应消息,以指示响应结果,可以将各个从数据库分组的分组响应消息集合在一起,便于分析处理。根据分组响应消息所指示的响应结果,生成与数据写入事务对应的应答消息。根据响应结果生成应答消息,能够灵活地设置应答策略,满足多样的容灾需求,并提高数据库集群的事务处理效率。Each slave database group has a response result, and different response messages corresponding to the data write transaction can be generated according to different response results. Figure 5 is a schematic diagram of the overall working principle of the method for database cluster management according to another reference embodiment of the present disclosure. As shown in Figure 5, each slave database group will generate a group response message to indicate the response result, and the group response messages of each slave database group can be collected together for easy analysis and processing. According to the response result indicated by the group response message, a response message corresponding to the data write transaction is generated. By generating a response message based on the response result, the response strategy can be flexibly set to meet various disaster recovery requirements and improve the transaction processing efficiency of the database cluster.
根据本公开一个可参考的实施例,响应结果为:生成分组响应消息或不生成分组响应消息;根据数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息,包括:According to a reference embodiment of the present disclosure, the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
判断数据库集群中分组响应消息的数量是否满足预设唤醒响应策略;若是,则生成与数据写入事务对应的唤醒应答消息,以指示待写入数据成功写入数据库集群;否则,生成与数据写入事务对应的异常应答消息,以指示待写入数据未成功写入所述数据库集群。Determine whether the number of group response messages in the database cluster meets the preset wake-up response strategy; if so, generate a wake-up response message corresponding to the data write transaction to indicate that the data to be written is successfully written to the database cluster; otherwise, generate an exception response message corresponding to the data write transaction to indicate that the data to be written is not successfully written to the database cluster.
响应结果可以分为生成分组响应消息和不生成分组响应消息。在 从数据库分组的响应消息数量不满足分组响应策略的情况下,该从数据库分组会发出不生成分组响应消息的响应结果;在从数据库分组的响应消息数量满足分组响应策略的情况下,该从数据库分组会发出生成分组响应消息的响应结果。数据库集群预设有唤醒响应策略,如图5所示,通过分组响应消息集合将分组响应消息聚集,判断分组响应消息的数量是否满足预设的唤醒响应策略,如果满足唤醒响应策略则发出唤醒应答消息,如果不满足唤醒响应策略则发出异常应答消息。通过响应结果,能够清楚地知道每个分组的响应情况,设置唤醒响应策略,可以满足不同的容灾需求,设置不同的应答消息,能够了解待写入数据的数据写入情况,即使未满足唤醒响应策略,也能够根据异常应答消息作出相应的处理,从而进一步提高数据库集群的事务处理效率。The response results can be divided into generating a group response message and not generating a group response message. When the number of response messages from the database group does not meet the group response strategy, the database group will issue a response result of not generating a group response message; when the number of response messages from the database group meets the group response strategy, the database group will issue a response result of generating a group response message. The database cluster is preset with a wake-up response strategy, as shown in Figure 5. The group response messages are aggregated through the group response message set to determine whether the number of group response messages meets the preset wake-up response strategy. If the wake-up response strategy is met, a wake-up response message is issued. If the wake-up response strategy is not met, an abnormal response message is issued. Through the response result, the response status of each group can be clearly known. Setting the wake-up response strategy can meet different disaster recovery requirements. Setting different response messages can understand the data writing status of the data to be written. Even if the wake-up response strategy is not met, corresponding processing can be made according to the abnormal response message, thereby further improving the transaction processing efficiency of the database cluster.
根据本公开另一个可参考的实施例,在生成与数据写入事务对应的应答消息之前,获取数据库集群的唤醒响应策略配置信息,唤醒响应策略配置信息包括:数据库集群的唤醒响应策略。According to another reference embodiment of the present disclosure, before generating a response message corresponding to a data write transaction, wake-up response strategy configuration information of a database cluster is obtained, and the wake-up response strategy configuration information includes: a wake-up response strategy of the database cluster.
数据库集群具有唤醒响应策略配置信息,其中包括数据库集群的唤醒响应策略。具体地,唤醒响应策略可以与应答消息有关。示例性地,在唤醒响应策略中设定应答消息数量阈值,在应答消息的数量到达应答消息数量阈值的情况下,判断为满足唤醒响应策略;否则,在应答消息的数量为到达应答消息数量阈值的情况下,判断为不满足唤醒响应策略。通过获取唤醒响应策略配置信息,能够获得最新的唤醒响应策略,以满足最新的容灾需求,避免新的唤醒响应策略没有及时生效。The database cluster has wake-up response strategy configuration information, including the wake-up response strategy of the database cluster. Specifically, the wake-up response strategy may be related to the reply message. Exemplarily, a reply message number threshold is set in the wake-up response strategy. When the number of reply messages reaches the reply message number threshold, it is judged that the wake-up response strategy is satisfied; otherwise, when the number of reply messages reaches the reply message number threshold, it is judged that the wake-up response strategy is not satisfied. By obtaining the wake-up response strategy configuration information, the latest wake-up response strategy can be obtained to meet the latest disaster recovery requirements and avoid the new wake-up response strategy not taking effect in time.
图6是根据现有技术归纳的数据库集群管理的流程示意图。如图6所示,在从数据库完成数据写入事务并返回响应消息的时候,每个从数据库会向主数据库返回自己的响应消息,数据库集群会设置一个响应消息数量阈值,通常这个响应消息数量阈值的取值是大于从数据库 数量的一半的,在主数据库接收到的从数据库返回的响应消息的数量到达响应消息数量阈值的情况下,才会生成唤醒应答消息。示例性地,数据库集群中存在10个从数据库,按照现有技术的应答策略,主数据库需要接收到至少6个从数据库发出的响应消息才会发出唤醒应答消息;而根据本公开实施例的技术方案,根据从数据库分组配置信息可以将10个从数据库分为两个从数据库分组,每个从数据库分组内有5个从数据库,并设置分组响应策略为在从数据库分组的响应消息数量为1的情况下,生成该从数据库分组的分组响应消息;由于有两个从数据库分组,设置唤醒响应策略配置信息,将唤醒响应策略设置为获得两个分组响应消息的情况下,生成与数据写入事务对应的唤醒应答消息,否则生成异常应答消息。在上述分组响应策略下,主数据库只需要等待两个从数据库的响应消息,就可以生成两个分组响应消息,从而得到与数据写入事务对应的唤醒应答消息,由于能够灵活地配置从数据库分组配置信息,甚至可以将所有从数据库分入一个从数据库分组,这样主数据库只需要等待一个从数据库的响应消息,即可得到数据写入事务对应的唤醒应答消息。与现有技术相比,本公开实施例的技术方案等待的响应消息数量远远小于现有技术中等待的响应消息数量,因此能够在满足容灾需求的情况下,大幅提升事务处理效率。FIG6 is a schematic diagram of the process of database cluster management summarized according to the prior art. As shown in FIG6, when the slave database completes the data write transaction and returns the response message, each slave database will return its own response message to the master database, and the database cluster will set a response message number threshold, which is usually greater than the value of the slave database. The wake-up response message is generated only when the number of response messages returned by the slave databases received by the master database reaches the threshold of the number of response messages. For example, there are 10 slave databases in the database cluster. According to the response strategy of the prior art, the master database needs to receive at least 6 response messages sent by the slave databases before sending a wake-up response message; and according to the technical solution of the embodiment of the present disclosure, the 10 slave databases can be divided into two slave database groups according to the slave database group configuration information, each slave database group has 5 slave databases, and the group response strategy is set to generate a group response message of the slave database group when the number of response messages of the slave database group is 1; because there are two slave database groups, the wake-up response strategy configuration information is set, and the wake-up response strategy is set to generate a wake-up response message corresponding to the data write transaction when two group response messages are obtained, otherwise an abnormal response message is generated. Under the above-mentioned group response strategy, the master database only needs to wait for the response messages of two slave databases to generate two group response messages, thereby obtaining the wake-up response message corresponding to the data write transaction. Since the slave database group configuration information can be flexibly configured, all slave databases can even be divided into one slave database group, so that the master database only needs to wait for the response message of one slave database to obtain the wake-up response message corresponding to the data write transaction. Compared with the prior art, the number of response messages waited by the technical solution of the embodiment of the present disclosure is much smaller than the number of response messages waited in the prior art, so it can greatly improve the transaction processing efficiency while meeting the disaster recovery requirements.
又示例性地,在多个地域多个机房的数据库集群架构下,使用现有技术等待从数据库的响应消息经常会受到网络抖动的影响,与主数据库不在同一个地域的从数据库的响应效率很低。根据本公开实施例的技术方案,可以将与主数据库同一地域(即本地)的从数据库和其他不同地域(即异地)的从数据库分入一个从数据库分组中,并设置该从数据库分组的分组响应策略为:在从数据库分组的响应消息数量为数值X的情况下,生成该从数据库分组的分组响应消息,其中数值X是不大于本地从数据库数量的数值。由此可以在本地从数据库返回响应消息的情况下即可生成分组响应消息和唤醒应答消息,避免长时间等待异地从数据库分组的分组响应消息,能够避免网络抖动或者从数据库发生故障对生成分组响应消息和唤醒应答消息的影响,提高数 据库集群的事务处理效率。As another example, in a database cluster architecture with multiple computer rooms in multiple regions, using existing technologies to wait for response messages from a slave database is often affected by network jitter, and the response efficiency of a slave database that is not in the same region as the master database is very low. According to the technical solution of the embodiment of the present disclosure, slave databases in the same region (i.e., local) as the master database and slave databases in other different regions (i.e., remote) can be divided into a slave database group, and the group response strategy of the slave database group can be set as follows: when the number of response messages from the slave database group is a value X, a group response message of the slave database group is generated, where the value X is a value not greater than the number of local slave databases. In this way, a group response message and a wake-up reply message can be generated when a response message is returned from a local slave database, thereby avoiding long waits for group response messages from remote slave database groups, and avoiding the impact of network jitter or failure of a slave database on the generation of group response messages and wake-up reply messages, thereby improving the number of responses. Transaction processing efficiency of database clusters.
根据本公开又一个可参考的实施例,在确定数据库集群中各个从数据库分组的响应结果之前,扫描数据库集群的数据复制模式配置信息,以确认分组应答策略处于开启状态;According to another referenceable embodiment of the present disclosure, before determining the response results of each slave database group in the database cluster, scan the data replication mode configuration information of the database cluster to confirm that the group response strategy is in the enabled state;
在分组应答策略处于关闭状态的情况下,根据预设应答策略、以及所述主数据库接收的响应消息,生成与所述数据写入事务对应的应答消息。When the group response strategy is in a closed state, a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
数据库集群具有数据复制模式配置信息,根据数据复制模式配置信息可以对从数据库的数据复制模式进行配置,在分组应答策略处于开启的状态的情况下,使用数据复制模式配置信息中设置的数据复制模式;在分组应答策略处于关闭状态的情况下,使用默认的数据复制模式。具体地,可以在主数据库中设置一个系统表,将数据复制模式配置信息保存至该系统表中,数据复制模式配置信息可以包括:分组应答策略的编号,即系统表中可以保存多个分组应答策略;分组应答策略的名称;具体的分组应答策略,可以是一个字符串,通过设置字符串匹配模式,根据从系统表中获取到的不同字符串来匹配不同的分组应答策略;默认的分组应答策略;各个分组应答策略的创建者、修改者以及对应的时间戳等等。The database cluster has data replication mode configuration information, and the data replication mode of the slave database can be configured according to the data replication mode configuration information. When the group response strategy is in the on state, the data replication mode set in the data replication mode configuration information is used; when the group response strategy is in the off state, the default data replication mode is used. Specifically, a system table can be set in the master database to save the data replication mode configuration information in the system table. The data replication mode configuration information may include: the number of the group response strategy, that is, multiple group response strategies can be saved in the system table; the name of the group response strategy; the specific group response strategy, which can be a string, by setting the string matching mode, different group response strategies are matched according to different strings obtained from the system table; the default group response strategy; the creator, modifier and corresponding timestamp of each group response strategy, etc.
通过数据复制模式配置信息,可以设置默认的数据复制模式,在未开启分组应答策略的情况下,依然能够保证数据复制的一致性。并且通过扫描数据库集群的数据复制模式配置信息,能够获取到最新的数据复制模式,包括:从数据库如何分组、每个分组的分组响应策略以及唤醒响应策略。通过修改系统表中的具体内容,可以实时调整数据库的数据一致性容灾策略,无需重启数据库集群服务。Through the data replication mode configuration information, the default data replication mode can be set, and the consistency of data replication can still be guaranteed when the group response strategy is not enabled. And by scanning the data replication mode configuration information of the database cluster, the latest data replication mode can be obtained, including: how to group from the database, the group response strategy of each group, and the wake-up response strategy. By modifying the specific content in the system table, the data consistency disaster recovery strategy of the database can be adjusted in real time without restarting the database cluster service.
根据本公开实施例的第二方面,提供一种数据库集群管理的装置。 According to a second aspect of an embodiment of the present disclosure, a device for managing a database cluster is provided.
图7是根据本公开实施例的数据库集群管理的装置的主要模块示意图,如图7所示,所述数据库集群管理的装置700主要包括:FIG. 7 is a schematic diagram of main modules of a device for managing a database cluster according to an embodiment of the present disclosure. As shown in FIG. 7 , the device 700 for managing a database cluster mainly includes:
数据写入与传输模块701,用于响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;The data writing and transmission module 701 is used to write the data to be written into the master database in the database cluster in response to the data writing transaction, and transmit the data from the master database to multiple slave databases in the database cluster;
响应结果确定模块702,用于根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;A response result determination module 702 is used to determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
应答消息生成模块703,用于根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。The response message generating module 703 is used to generate a response message corresponding to the data writing transaction according to the response results of each slave database group in the database cluster.
根据本公开一个可参考的实施例,根据主数据库接收的响应消息,确定数据库集群中各个从数据库分组的响应结果,包括:According to a reference embodiment of the present disclosure, determining the response results of each slave database group in the database cluster according to the response message received by the master database includes:
根据主数据库接收到的响应消息,更新发出响应消息的从数据库分组的响应消息数量;在数据库集群中任一从数据库分组的响应消息数量满足预设分组响应策略的情况下,生成任一从数据库分组的分组响应消息,从而得到任一从数据库分组的响应结果。According to the response message received by the main database, the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
根据本公开一个可参考的实施例,数据库集群管理的装置700还包括:分组配置信息获取模块,用于在确定数据库集群中各个从数据库分组的响应结果之前,获取数据库集群的从数据库分组配置信息,从数据库分组配置信息包括:数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。According to a reference embodiment of the present disclosure, the device 700 for managing a database cluster also includes: a group configuration information acquisition module, which is used to obtain the slave database group configuration information of the database cluster before determining the response results of each slave database group in the database cluster, and the slave database group configuration information includes: the slave databases contained in each slave data group in the database cluster, and their group response strategies.
根据本公开另一个可参考的实施例,响应结果为:生成分组响应消息或不生成分组响应消息;根据数据库集群中各个从数据库分组的响应结果,生成与数据写入事务对应的应答消息,包括:According to another referenceable embodiment of the present disclosure, the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, including:
判断数据库集群中分组响应消息的数量是否满足预设唤醒响应策略;若是,则生成与数据写入事务对应的唤醒应答消息,以指示待写入数据成功写入数据库集群;否则,生成与数据写入事务对应的异常 应答消息,以指示待写入数据未成功写入数据库集群。Determine whether the number of group response messages in the database cluster meets the preset wake-up response strategy; if so, generate a wake-up response message corresponding to the data write transaction to indicate that the data to be written is successfully written to the database cluster; otherwise, generate an exception corresponding to the data write transaction A response message indicating that the data to be written was not successfully written to the database cluster.
根据本公开又一个可参考的实施例,数据库集群管理的装置700还包括:唤醒响应策略配置信息获取模块,用于在生成与数据写入事务对应的应答消息之前,获取数据库集群的唤醒响应策略配置信息,唤醒响应策略配置信息包括:数据库集群的唤醒响应策略。According to another reference embodiment of the present disclosure, the device 700 for database cluster management also includes: a wake-up response strategy configuration information acquisition module, which is used to obtain the wake-up response strategy configuration information of the database cluster before generating a response message corresponding to the data write transaction, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
根据本公开还一个可参考的实施例,数据库集群管理的装置700还包括:数据复制模式配置信息扫描模块,用于在确定数据库集群中各个从数据库分组的响应结果之前,扫描数据库集群的数据复制模式配置信息,以确认分组应答策略处于开启状态;According to another referenceable embodiment of the present disclosure, the database cluster management apparatus 700 further includes: a data replication mode configuration information scanning module, which is used to scan the data replication mode configuration information of the database cluster before determining the response result of each slave database group in the database cluster to confirm that the group response strategy is in an on state;
在分组应答策略处于关闭状态的情况下,根据预设应答策略、以及主数据库接收的响应消息,生成与数据写入事务对应的应答消息。When the group response strategy is in the closed state, a response message corresponding to the data write transaction is generated according to the preset response strategy and the response message received by the primary database.
需要说明的是,在本公开实施例所述数据库集群管理的装置的具体实施内容,在上面所述数据库集群管理的方法中已经详细说明了,故在此重复内容不再说明。It should be noted that the specific implementation content of the device for managing a database cluster described in the embodiment of the present disclosure has been described in detail in the method for managing a database cluster described above, so the repeated content will not be described here.
根据本公开实施例的第三方面,提供一种数据库集群系统。According to a third aspect of an embodiment of the present disclosure, a database cluster system is provided.
图8是根据本公开实施例的数据库集群系统的示意图。如图8所示,数据库集群系统800主要包括:主数据库801,多个从数据库,以及配置在主数据库801上的数据库集群管理的装置802,其中多个从数据库可以分布在不同城市的不同机房中,数据库集群管理装置802可以跨机房地、跨地域地管理数据库集群系统800中的从数据库;FIG8 is a schematic diagram of a database cluster system according to an embodiment of the present disclosure. As shown in FIG8 , the database cluster system 800 mainly includes: a master database 801, multiple slave databases, and a database cluster management device 802 configured on the master database 801, wherein the multiple slave databases can be distributed in different computer rooms in different cities, and the database cluster management device 802 can manage the slave databases in the database cluster system 800 across computer rooms and regions;
配置在主数据库801上的数据库集群管理的装置802响应于数据写入事务,将待写入数据写入数据库集群中的主数据库801、以及由主数据库801向所述数据库集群中的多个从数据库传输;The database cluster management device 802 configured on the master database 801 writes the data to be written into the master database 801 in the database cluster in response to the data writing transaction, and transmits the data from the master database 801 to the multiple slave databases in the database cluster;
配置在主数据库801上的数据库集群管理的装置802根据主数据库801接收的响应消息,确定数据库集群中各个从数据库分组的响应 结果;响应消息由成功写入待写入数据的从数据库发出;The database cluster management device 802 configured on the master database 801 determines the response of each slave database group in the database cluster according to the response message received by the master database 801. Result; A response message is sent from the slave database that successfully writes the data to be written;
配置在主数据库801上的数据库集群管理的装置802根据数据库集群中各个从数据库分组的响应结果,生成与数据写入事务对应的应答消息。The database cluster management device 802 configured on the master database 801 generates a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
需要说明的是,本公开实施例所述数据库集群系统800的具体实施内容,在上面所述数据库集群管理的方法和数据库集群管理的装置中已经详细说明了,故在此重复内容不再说明。配置在主数据库801上的数据库集群管理的装置802的相关内容,参见本公开实施例第二方面的介绍,此处不再赘述。It should be noted that the specific implementation content of the database cluster system 800 described in the embodiment of the present disclosure has been described in detail in the method and device for database cluster management described above, so the repeated content will not be described here. The relevant content of the device 802 for database cluster management configured on the main database 801 can be found in the introduction of the second aspect of the embodiment of the present disclosure, and will not be repeated here.
根据本公开实施例的技术方案,通过对从数据库进行分组,并根据从数据库分组的响应结果生成应答消息,能够避免从数据库节点故障以及网络抖动对主数据库接收响应消息的影响,提高数据库写入服务的处理效率;配置数据库分组配置信息,能够获得不同的从数据库以及分组响应策略,从而满足不同的数据一致性容灾策略;配置数据库集群的唤醒响应策略配置信息,能够灵活调整数据库集群的唤醒响应策略,进一步提高数据库集群的事务处理效率;通过扫描数据库集群的数据复制模式配置信息,能够获取到最新的数据复制模式并使其生效,通过修改数据复制模式配置信息,可以实时调整数据库的数据一致性容灾策略,无需重启数据库集群服务。According to the technical solution of the embodiment of the present disclosure, by grouping the slave databases and generating a reply message according to the response result of the slave database group, the influence of the slave database node failure and network jitter on the reception of the response message of the master database can be avoided, thereby improving the processing efficiency of the database write service; by configuring the database group configuration information, different slave databases and group response strategies can be obtained to meet different data consistency disaster recovery strategies; by configuring the wake-up response strategy configuration information of the database cluster, the wake-up response strategy of the database cluster can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the data replication mode configuration information of the database cluster, the latest data replication mode can be obtained and made effective, and by modifying the data replication mode configuration information, the data consistency disaster recovery strategy of the database can be adjusted in real time without restarting the database cluster service.
根据本公开实施例的第四方面,提供一种数据库集群管理的电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本公开实施例第一方面提供的方法。According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device for database cluster management, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect of the embodiment of the present disclosure.
根据本公开实施例的第五方面,提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现本公开实施例第一方面提供的方法。 According to a fifth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present disclosure is implemented.
图9示出了可以应用本公开实施例的数据库集群管理的方法或者数据库集群管理的装置的示例性系统架构900。FIG. 9 shows an exemplary system architecture 900 to which the method or apparatus for managing a database cluster according to an embodiment of the present disclosure can be applied.
如图9所示,系统架构900可以包括终端设备901、902、903,网络904和服务器905。网络904用以在终端设备901、902、903和服务器905之间提供通信链路的介质。网络904可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Fig. 9, system architecture 900 may include terminal devices 901, 902, 903, a network 904, and a server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
用户可以使用终端设备901、902、903通过网络904与服务器905交互,以接收或发送消息等。终端设备901、902、903上可以安装有各种通讯客户端应用,例如数据库集群管理类应用、数据库集群状态展示类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 901, 902, 903, such as database cluster management applications, database cluster status display applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
终端设备901、902、903可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
服务器905可以是提供各种服务的服务器,例如对上游利用终端设备901、902、903所发来的数据写入请求提供支持的后台管理服务器(仅为示例)。后台管理服务器可以响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息;并将数据写入事务的应答结果(仅为示例)反馈给终端设备。The server 905 may be a server that provides various services, such as a background management server (only as an example) that provides support for data write requests sent from upstream terminal devices 901, 902, and 903. In response to the data write transaction, the background management server may write the data to be written into the master database in the database cluster, and transmit the data from the master database to multiple slave databases in the database cluster; determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written; generate a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster; and feed back the response result of the data write transaction (only as an example) to the terminal device.
需要说明的是,本公开实施例所提供的单据计费管理的方法一般 由服务器905执行,相应地,所述数据库集群管理的装置一般设置在服务器905中。本公开实施例所提供的数据库集群管理的方法也可以由终端设备901、902、903执行,相应地,所述数据库集群管理的装置可以设置在终端设备901、902、903中。It should be noted that the method for billing management provided in the embodiment of the present disclosure is generally The method for managing a database cluster provided in the embodiment of the present disclosure may also be performed by the terminal devices 901, 902, and 903, and the apparatus for managing a database cluster may be provided in the terminal devices 901, 902, and 903 accordingly.
应该理解,图9中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks and servers in Figure 9 is only for illustration purposes and any number of terminal devices, networks and servers may be provided as required.
下面参考图10,其示出了适于用来实现本公开实施例的终端设备的计算机系统1000的结构示意图。图10示出的终端设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to Figure 10, a schematic diagram of the structure of a computer system 1000 suitable for implementing a terminal device of an embodiment of the present disclosure is shown. The terminal device shown in Figure 10 is only an example and should not limit the functions and scope of use of the embodiment of the present disclosure.
如图10所示,计算机系统1000包括中央处理单元(CPU)1001,其可以根据存储在只读存储器(ROM)1002中的程序或者从存储部分1008加载到随机访问存储器(RAM)1003中的程序而执行各种适当的动作和处理。在RAM 1003中,还存储有系统1000操作所需的各种程序和数据。CPU 1001、ROM1002以及RAM1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。As shown in FIG. 10 , the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to the bus 1004.
以下部件连接至I/O接口1005:包括键盘、鼠标等的输入部分1006;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1007;包括硬盘等的存储部分1008;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1009。通信部分1009经由诸如因特网的网络执行通信处理。驱动器1010也根据需要连接至I/O接口1005。可拆卸介质1011,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1010上,以便于从其上读出的计算机程序根据需要被安装入存储部分1008。The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程 序,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1009从网络上被下载和安装,和/或从可拆卸介质1011被安装。在该计算机程序被中央处理单元(CPU)1001执行时,执行本公开实施例的系统中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program The computer program includes a computer program carried on a computer readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and/or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above functions defined in the system of the embodiment of the present disclosure are executed.
需要说明的是,本公开实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开实施例中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the embodiment of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一 部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer programs according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, program segment, or a portion of the code. Part, the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed basically in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of boxes in the block diagram or flow chart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括数据写入及传输模块、响应结果确定模块和应答消息生成模块,其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,响应结果确定模块还可以被描述为“根据从数据库返回的响应消息确定响应结果的模块”。The modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a data writing and transmission module, a response result determination module and a reply message generation module, wherein the names of these modules do not constitute a limitation on the modules themselves under certain circumstances, for example, the response result determination module may also be described as "a module for determining a response result according to a response message returned from a database".
作为另一方面,本公开实施例还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,该设备实现如下方法:响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。As another aspect, the disclosed embodiment also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: in response to a data write transaction, the data to be written is written to a master database in a database cluster, and the master database is transmitted to multiple slave databases in the database cluster; according to the response message received by the master database, the response result of each slave database group in the database cluster is determined; the response message is sent by the slave database that successfully writes the data to be written; according to the response result of each slave database group in the database cluster, a reply message corresponding to the data write transaction is generated.
根据本公开实施例的技术方案,通过对从数据库进行分组,并根据从数据库分组的响应结果生成应答消息,能够避免从数据库节点故障以及网络抖动对主数据库接收响应消息的影响,提高数据库写入服 务的处理效率;配置数据库分组配置信息,能够获得不同的从数据库以及分组响应策略,从而满足不同的数据一致性容灾策略;配置数据库集群的唤醒响应策略配置信息,能够灵活调整数据库集群的唤醒响应策略,进一步提高数据库集群的事务处理效率;通过扫描数据库集群的数据复制模式配置信息,能够获取到最新的数据复制模式并使其生效,通过修改数据复制模式配置信息,可以实时调整数据库的数据一致性容灾策略,无需重启数据库集群服务。According to the technical solution of the embodiment of the present disclosure, by grouping the slave databases and generating a reply message according to the response results of the slave database groups, the influence of slave database node failures and network jitter on the master database receiving the response message can be avoided, thereby improving the database write service efficiency. By configuring the database grouping configuration information, different slave databases and grouping response strategies can be obtained to meet different data consistency disaster recovery strategies; by configuring the database cluster wake-up response strategy configuration information, the database cluster wake-up response strategy can be flexibly adjusted to further improve the transaction processing efficiency of the database cluster; by scanning the database cluster data replication mode configuration information, the latest data replication mode can be obtained and made effective; by modifying the data replication mode configuration information, the database data consistency disaster recovery strategy can be adjusted in real time without restarting the database cluster service.
上述具体实施方式,并不构成对本公开实施例保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本公开实施例的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开实施例保护范围之内。 The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present disclosure shall be included in the protection scope of the embodiments of the present disclosure.

Claims (10)

  1. 一种数据库集群管理的方法,包括:A method for managing a database cluster, comprising:
    响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;In response to a data write transaction, the data to be written is written into a master database in the database cluster, and transmitted from the master database to a plurality of slave databases in the database cluster;
    根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;Determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
    根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。A response message corresponding to the data write transaction is generated according to the response results of each slave database group in the database cluster.
  2. 根据权利要求1所述的方法,其中,根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果,包括:The method according to claim 1, wherein determining the response results of each slave database group in the database cluster according to the response message received by the master database comprises:
    根据所述主数据库接收到的响应消息,更新发出所述响应消息的从数据库分组的响应消息数量;在所述数据库集群中任一从数据库分组的响应消息数量满足预设分组响应策略的情况下,生成所述任一从数据库分组的分组响应消息,从而得到所述任一从数据库分组的响应结果。According to the response message received by the master database, the number of response messages of the slave database group that sends the response message is updated; when the number of response messages of any slave database group in the database cluster meets the preset group response strategy, a group response message of any slave database group is generated, thereby obtaining the response result of any slave database group.
  3. 根据权利要求2所述的方法,其中,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    在确定所述数据库集群中各个从数据库分组的响应结果之前,获取所述数据库集群的从数据库分组配置信息,所述从数据库分组配置信息包括:所述数据库集群中每个从数据分组所包含的从数据库、以及其分组响应策略。Before determining the response results of each slave database group in the database cluster, slave database group configuration information of the database cluster is obtained, and the slave database group configuration information includes: slave databases included in each slave data group in the database cluster, and their group response strategies.
  4. 根据权利要求1所述的方法,其中,所述响应结果为:生成分组响应消息或不生成分组响应消息;根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息,包括: The method according to claim 1, wherein the response result is: generating a group response message or not generating a group response message; generating a reply message corresponding to the data write transaction according to the response results of each slave database group in the database cluster, comprising:
    判断所述数据库集群中分组响应消息的数量是否满足预设唤醒响应策略;若是,则生成与所述数据写入事务对应的唤醒应答消息,以指示所述待写入数据成功写入所述数据库集群;否则,生成与所述数据写入事务对应的异常应答消息,以指示所述待写入数据未成功写入所述数据库集群。Determine whether the number of group response messages in the database cluster meets the preset wake-up response strategy; if so, generate a wake-up response message corresponding to the data write transaction to indicate that the data to be written is successfully written to the database cluster; otherwise, generate an exception response message corresponding to the data write transaction to indicate that the data to be written is not successfully written to the database cluster.
  5. 根据权利要求4所述的方法,其中,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    在生成与所述数据写入事务对应的应答消息之前,获取所述数据库集群的唤醒响应策略配置信息,所述唤醒响应策略配置信息包括:所述数据库集群的唤醒响应策略。Before generating a response message corresponding to the data write transaction, the wake-up response strategy configuration information of the database cluster is obtained, and the wake-up response strategy configuration information includes: the wake-up response strategy of the database cluster.
  6. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    在确定所述数据库集群中各个从数据库分组的响应结果之前,扫描所述数据库集群的数据复制模式配置信息,以确认分组应答策略处于开启状态;Before determining the response results of each slave database group in the database cluster, scanning the data replication mode configuration information of the database cluster to confirm that the group response strategy is in an enabled state;
    在分组应答策略处于关闭状态的情况下,根据预设应答策略、以及所述主数据库接收的响应消息,生成与所述数据写入事务对应的应答消息。When the group response strategy is in a closed state, a response message corresponding to the data write transaction is generated according to a preset response strategy and a response message received by the primary database.
  7. 一种数据库集群管理的装置,包括:A database cluster management device, comprising:
    数据写入及传输模块,用于响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;A data writing and transmission module, used for writing the data to be written into a master database in the database cluster in response to a data writing transaction, and transmitting the data from the master database to a plurality of slave databases in the database cluster;
    响应结果确定模块,用于根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;A response result determination module, used to determine the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
    应答消息生成模块,用于根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。The response message generating module is used to generate a response message corresponding to the data writing transaction according to the response results of each slave database group in the database cluster.
  8. 一种数据库集群系统,包括: A database cluster system, comprising:
    主数据库,多个从数据库,以及配置在所述主数据库上的数据库集群管理的装置;A master database, a plurality of slave databases, and a database cluster management device configured on the master database;
    所述数据库集群管理的装置响应于数据写入事务,将待写入数据写入数据库集群中的主数据库、以及由所述主数据库向所述数据库集群中的多个从数据库传输;The database cluster management device writes the data to be written into a master database in the database cluster in response to the data writing transaction, and transmits the data from the master database to multiple slave databases in the database cluster;
    所述数据库集群管理的装置根据所述主数据库接收的响应消息,确定所述数据库集群中各个从数据库分组的响应结果;所述响应消息由成功写入所述待写入数据的从数据库发出;The database cluster management device determines the response results of each slave database group in the database cluster according to the response message received by the master database; the response message is sent by the slave database that successfully writes the data to be written;
    所述数据库集群管理的装置根据所述数据库集群中各个从数据库分组的响应结果,生成与所述数据写入事务对应的应答消息。The database cluster management device generates a response message corresponding to the data write transaction according to the response results of each slave database group in the database cluster.
  9. 一种电子设备,包括:An electronic device, comprising:
    一个或者多个处理器;One or more processors;
    存储装置,用于存储一个或者多个程序,A storage device for storing one or more programs,
    当所述一个或者多个程序被所述一个或者多个处理器执行时,所述一个或者多个处理器实现如权利要求1-6中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
  10. 一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现如权利要求1-6中任一所述的方法。 A computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 6.
PCT/CN2023/115359 2022-11-14 2023-08-29 Database cluster management method and apparatus WO2024103898A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211421245.2 2022-11-14
CN202211421245.2A CN115964436A (en) 2022-11-14 2022-11-14 Method and device for managing database cluster

Publications (1)

Publication Number Publication Date
WO2024103898A1 true WO2024103898A1 (en) 2024-05-23

Family

ID=87358711

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/115359 WO2024103898A1 (en) 2022-11-14 2023-08-29 Database cluster management method and apparatus

Country Status (2)

Country Link
CN (1) CN115964436A (en)
WO (1) WO2024103898A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115964436A (en) * 2022-11-14 2023-04-14 京东科技信息技术有限公司 Method and device for managing database cluster

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569257A (en) * 2019-09-16 2019-12-13 上海达梦数据库有限公司 data processing method, corresponding device, equipment and storage medium
CN111309732A (en) * 2020-02-19 2020-06-19 杭州朗和科技有限公司 Data processing method, device, medium and computing equipment
US20210182246A1 (en) * 2019-12-11 2021-06-17 Western Digital Technologies, Inc. Efficient transaction log and database processing
CN115964436A (en) * 2022-11-14 2023-04-14 京东科技信息技术有限公司 Method and device for managing database cluster

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569257A (en) * 2019-09-16 2019-12-13 上海达梦数据库有限公司 data processing method, corresponding device, equipment and storage medium
US20210182246A1 (en) * 2019-12-11 2021-06-17 Western Digital Technologies, Inc. Efficient transaction log and database processing
CN111309732A (en) * 2020-02-19 2020-06-19 杭州朗和科技有限公司 Data processing method, device, medium and computing equipment
CN115964436A (en) * 2022-11-14 2023-04-14 京东科技信息技术有限公司 Method and device for managing database cluster

Also Published As

Publication number Publication date
CN115964436A (en) 2023-04-14

Similar Documents

Publication Publication Date Title
CN112069265B (en) Synchronization method of configuration data, business data system, computer system and medium
WO2022126974A1 (en) Kafka-based incremental data synchronization method and apparatus, device, and medium
US8930309B2 (en) Interval-controlled replication
CN111143382B (en) Data processing method, system and computer readable storage medium
WO2019218510A1 (en) Multi-service system interaction method and apparatus, storage medium, and electronic terminal
CN109245908B (en) Method and device for switching master cluster and slave cluster
CN114363407B (en) Message service method and device, readable storage medium and electronic equipment
WO2024103898A1 (en) Database cluster management method and apparatus
US20230052935A1 (en) Asynchronous accounting method and apparatus for blockchain, medium and electronic device
JPWO2004063928A1 (en) Database load reduction system and load reduction program
US20200104404A1 (en) Seamless migration of distributed systems
WO2021036684A1 (en) Distributed data synchronization method, apparatus and device and readable storage medium
CN109614439A (en) Method of data synchronization, device, electronic equipment and storage medium
CN112685499A (en) Method, device and equipment for synchronizing process data of work service flow
WO2024077802A1 (en) Cross-region data synchronization method and system, and computer readable medium
CN111144926A (en) Service request processing method, device, system, electronic equipment and readable medium
CN114676199A (en) Synchronization method, synchronization system, computer equipment and storage medium
CN110852701A (en) Product demand management method, device and system
CN115757642A (en) Data synchronization method and device based on filing log file
CN115454666A (en) Data synchronization method and device among message queue clusters
CN115640280A (en) Data migration method and device
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN110288309B (en) Data interaction method, device, system, computer equipment and storage medium
CN108664503A (en) A kind of data archiving method and device
CN111522688B (en) Data backup method and device for distributed system