Database configuration method and device, equipment, medium and program product

By introducing Learn nodes into the cloud platform, determining the communication status, and setting them to read-only, the issues of data consistency and reliability in different availability zones of the cloud platform are resolved, achieving data stability and consistency during network partitioning.

CN121614460APending Publication Date: 2026-03-06CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511769521.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

When different availability zones on a cloud platform are isolated from each other, if an availability zone loses connection with the management node, the database instance will still receive read and write traffic, leading to data inconsistency and reliability issues.

Method used

By introducing Learn nodes, the communication status between the cloud platform management node is determined, and when communication is interrupted, local faults and global network partitions are distinguished and read-only settings are applied to avoid data conflicts.

Benefits of technology

It improves the data consistency and reliability of the database cluster, avoids the risk of data inconsistency during network partitioning, and ensures the stability of the database service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614460A_ABST
    Figure CN121614460A_ABST
Patent Text Reader

Abstract

The invention relates to a database configuration method and device, equipment, a medium and a program product. The method comprises the following steps: determining a communication state with a management node of a cloud platform; under the condition that the communication state represents communication interruption, determining network connectivity between the target database available area and other database available areas except the target database available area in the cloud platform; and performing read-only setting processing on the database instance in the target database available region under the condition that the network connectivity with other database available regions all represents that the database instance is not connected. By adopting the method, the data consistency and reliability of the database cluster can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database configuration technology, and in particular to a database configuration method, apparatus, device, medium, and program product. Background Technology

[0002] With the development of cloud computing and database technologies, cloud platforms have become the core infrastructure for deploying various applications and services. To improve service availability, disaster recovery capabilities, and resource isolation, different availability zones are typically set up and isolated from each other, so that if one availability zone fails, the other availability zones can still operate normally.

[0003] However, in this approach, if an availability zone not only loses connection with the management node but also disconnects from other availability zones, the database instances that should be isolated will continue to receive read and write traffic from applications within the current availability zone. These write operations will cause data discrepancies, which can easily lead to data inconsistency in the database cluster, affecting data consistency and reliability. Summary of the Invention

[0004] Therefore, it is necessary to provide a database configuration method, apparatus, device, medium, and program product to address the aforementioned technical problems, thereby improving the data consistency and reliability of database clusters.

[0005] Firstly, this application provides a database configuration method applied to a target node corresponding to a target database availability zone in a cloud platform, wherein a database instance is running in the target database availability zone. The method includes:

[0006] Determine the communication status with the management node of the cloud platform;

[0007] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0008] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0009] In one embodiment, the communication state is the communication state between the target node and the management node based on the distributed consensus Raft protocol; correspondingly, determining the network connectivity between the target database availability zone and other database availability zones in the cloud platform, excluding the target database availability zone, includes: determining the network connectivity between the target database availability zone and the databases in the database availability zone based on the connection status between the target node and the databases in the database availability zone.

[0010] In one embodiment, determining the network connectivity between the target database availability zone and the database in the database availability zone based on the connection status between the target node and the database in the database availability zone includes: sending a database connection request to the database corresponding to the database availability zone; if a response to the database connection request is received within a preset time period, determining that the network connectivity with the database availability zone is in a connected state; if no response to the database connection request is received within the preset time period, determining that the network connectivity of the database availability zone is in a disconnected state.

[0011] In one embodiment, the management node is deployed in the arbitration availability zone of the cloud platform, and no database instance is running in the arbitration availability zone.

[0012] In one embodiment, the method further includes: responding to an inquiry request from a management node, feeding back database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information when it identifies a database anomaly based on the database association data; wherein the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules for the database access traffic corresponding to the target database availability zone.

[0013] In one embodiment, the method further includes: in response to a data backup request from the management node, sending the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform; wherein the data backup request is generated when the management node identifies that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0014] Secondly, this application also provides a database configuration device, configured on a target node corresponding to a target database availability zone in a cloud platform, wherein a database instance is running in the target database availability zone, and the device includes:

[0015] The first determining module is used to determine the communication status with the management node of the cloud platform;

[0016] The second determining module is used to determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform, excluding the target database availability zone, when the communication status indicates a communication interruption.

[0017] The processing module is used to perform read-only settings on database instances in the target database availability zone when network connectivity with other database availability zones indicates that they are not connected.

[0018] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0019] Determine the communication status with the management node of the cloud platform;

[0020] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0021] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0023] Determine the communication status with the management node of the cloud platform;

[0024] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0025] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0026] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0027] Determine the communication status with the management node of the cloud platform;

[0028] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0029] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0030] The aforementioned database configuration methods, devices, equipment, media, and program products, by determining the communication status with the cloud platform's management node, can promptly detect connection anomalies between the target node and the management node, providing a data foundation for subsequent refined network diagnostics. By determining the network connectivity between the target database availability zone and other database availability zones in the cloud platform when communication status indicates an interruption, it is possible to effectively distinguish between a localized failure limited to the management node and a global network partition where the target database availability zone is completely isolated, thus improving the accuracy of subsequent database instance configuration decisions. By configuring the database instance in the target database availability zone as read-only when network connectivity with other database availability zones indicates a complete loss of connectivity, the risk of data conflicts or inconsistencies during network partitioning or subsequent recovery is avoided. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart illustrating a database configuration method in one embodiment;

[0033] Figure 2 This is a flowchart illustrating the data backup steps in one embodiment;

[0034] Figure 3A This is an overall architecture diagram of the availability zone in one embodiment;

[0035] Figure 3B A flowchart for configuring nodes in an availability zone in one embodiment;

[0036] Figure 4 A flowchart illustrating the database configuration method in another embodiment;

[0037] Figure 5 This is a structural block diagram of a database configuration device in one embodiment;

[0038] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] The database configuration method provided in this application can be applied to cross-availability zone (Availability Zone) scenarios, which aim to achieve continuous availability of database services by distributing database instances across multiple Availability Zones (i.e., data centers) and utilizing technologies such as data replication and failover. Even if one Availability Zone fails, the system can quickly switch to another Availability Zone, ensuring uninterrupted data access, thereby improving user experience and preventing business downtime. For example, a cloud platform can provide highly available services by deploying multiple Availability Zones (AZs). Each Availability Zone is an independent area within a data center, with its own power, network, and cooling systems. Each Availability Zone can constitute a region, and each Availability Zone is isolated from others; even if one Availability Zone fails, the others can still operate.

[0041] In high-availability database architecture design, an arbitration mechanism based on the Raft consensus algorithm is typically used to manage the database cluster. In practical applications, tools such as MySQL Orchestrator (a database management component) can be used as the arbitration node. Orchestrator is an open-source tool that can automatically manage the high availability of MySQL clusters, such as failover, node election, data replication management, and security management, making the MySQL cluster more stable and reliable.

[0042] For example, Raft, as a distributed consensus algorithm, ensures system consistency by maintaining a cluster of one or more nodes. This cluster typically includes Leader nodes (i.e., management nodes, also known as leader nodes) and Follower nodes (i.e., follower nodes).

[0043] For example, an arbitration node can be based on the distributed consensus algorithm Raft, replicating data among multiple nodes and selecting a leader node through follower nodes to ensure that all nodes reach a consensus on the latest state of the data, guaranteeing data consistency and availability even in the event of node failure. Specifically, it can use log replication and election mechanisms to achieve consensus. Optionally, the arbitration node can be used to select a master database to handle all read and write traffic, and can also be used to modify the traffic configuration of the database's Layer 4 / Layer 7 proxy. The Layer 4 proxy is a network layer-based proxy, primarily responsible for forwarding network packets, such as at least one of TCP and UDP packets. The Layer 7 proxy is an application layer-based proxy used to analyze and understand packet content, such as HTTP requests and responses.

[0044] The Leader node is primarily responsible for failover decisions, database master node selection, configuration management, task scheduling, and status monitoring, ensuring the high availability and stable operation of the entire MySQL (Database Management System) cluster.

[0045] In traditional methods, if an availability zone is completely isolated as a network partition, the database agent in that availability zone cannot respond and issue configuration changes. This results in read and write traffic continuing even when the database is switched over in a completely network partitioned environment. Furthermore, the arbitrator node can only modify the database master-slave structure and downstream traffic configuration through the Leader node. If the Leader node and the database instance are in the same availability zone, this can lead to misjudgments and unnecessary database traffic switching, impacting overall high availability stability. A network partition refers to a situation where some nodes cannot communicate with each other, while others can still communicate.

[0046] Based on this, this embodiment introduces a target node, namely a Learn node, which is configured in the target database availability zone running a database instance. By determining the communication status with the management node of the cloud platform, it is possible to promptly detect connection anomalies between the target node and the management node, providing a data foundation for subsequent refined network diagnostics. By determining the network connectivity between the target database availability zone and other database availability zones in the cloud platform when the communication status indicates a communication interruption, it is possible to effectively distinguish between a local fault where only the management node is lost and a global network partition where the target database availability zone is completely isolated, which helps improve the accuracy of subsequent decisions regarding database instance settings. By configuring the database instance in the target database availability zone as read-only when the network connectivity with other database availability zones indicates no connectivity, the risk of data conflicts or inconsistencies during network partitioning or subsequent recovery is avoided.

[0047] Meanwhile, by introducing Learn nodes and deploying management nodes in the arbitration availability zone of the cloud platform, where no database instance is running, we ensure that the Leader node and the database instance are not in the same availability zone. This avoids potential misjudgments that might occur due to the Leader node and the database instance being in the same availability zone, thus improving the stability of the overall architecture.

[0048] In one embodiment, such as Figure 1 As shown, a database configuration method is provided, applied to a target node corresponding to a target database availability zone in a cloud platform. The target database availability zone runs a database instance. The method includes:

[0049] S110. Determine the communication status with the management node of the cloud platform.

[0050] The target node, also known as the Learn node, is deployed in the availability zone of the target database that is running a database instance. The Learn node can be understood as the node responsible for persisting the management node's logs. The Learn node is independent of the Follower nodes, ensuring that even if the management node fails, other nodes can still obtain log information from the Learn node, maintaining data consistency and service availability.

[0051] The management node, also known as the Leader node, is responsible for failover decisions, database master node selection, configuration management, task scheduling, and status monitoring, ensuring the high availability and stable operation of the entire MySQL (database management system) cluster.

[0052] In an optional embodiment, the management node is deployed in the arbitration availability zone of the cloud platform, and no database instance is running in the arbitration availability zone. This ensures that the leader node and the database instance are not in the same availability zone, avoiding possible misjudgments due to the leader node and the database instance being in the same availability zone, and improving the stability of the overall architecture.

[0053] For example, a Follower node can also be set up in the arbitration availability zone, and the management node can be generated in the arbitration availability zone based on the Raft voting mechanism.

[0054] In an optional embodiment, the arbitration node can be used to determine the availability zone type of the target availability zone. If the target availability zone type is a database availability zone, a learner node is generated, and the learner node is used to probe the communication status with the cloud platform's management node. If the availability zone type is not a database availability zone (i.e., an arbitration availability zone), a leader node election is initiated to generate a leader node, and the leader node is used to monitor the status of each database, which can include abnormal and normal states. Based on the above approach, it is possible to force learner nodes to be effective only in database availability zones and leader nodes to be effective only in arbitration availability zones, avoiding possible misjudgments due to leader nodes and database instances being in the same availability zone, and improving the overall stability of the architecture.

[0055] In an optional embodiment, the communication status can be the communication status between the target node and the management node based on the distributed consensus Raft protocol. The communication status can include communication interruption and communication normality.

[0056] S120. In the case of communication status indicating communication interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform other than the target database availability zone.

[0057] Referring to the foregoing, the communication status refers to the communication status between the target node and the management node based on the distributed consensus Raft protocol. Accordingly, the network connectivity between the target database availability zone and the databases in the database availability zone can be determined based on the connection status between the target node and the databases in the database availability zone.

[0058] In an optional embodiment, a database connection request is sent to the database corresponding to the database availability zone; if a response to the database connection request is received within a preset time period, the network connectivity with the database availability zone is determined to be in a connected state; if no response to the database connection request is received within the preset time period, the network connectivity with the database availability zone is determined to be in a disconnected state.

[0059] The preset time period can be set by technicians according to their needs or experience, or determined through a large number of experiments. This application does not impose any restrictions on this.

[0060] S130. If the network connectivity with other database availability zones is not indicated, perform read-only settings on the database instance in the target database availability zone.

[0061] By setting the database instance in the target database availability zone to read-only mode, data consistency can be guaranteed.

[0062] In an optional embodiment, in response to an inquiry request from the management node, database association data of the target database availability zone can be fed back to the management node, so that the management node can generate traffic configuration adjustment information if it identifies a database anomaly based on the database association data; wherein, the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules of the database access traffic corresponding to the target database availability zone.

[0063] Among them, database association data can be understood as the association data between the database instance and the availability zone of the target database.

[0064] Among them, the traffic proxy node can be understood as a database front-end proxy module, which is responsible for distributing database access traffic and can forward it according to the configuration of the arbitration node or management node.

[0065] For example, database association data may include database status data, which is used to characterize the database status type. The database status type may include at least one of the following: database downtime, database unavailability, and database normal status. A database downtime or database unavailability indicates a database anomaly.

[0066] For example, database-related data may also include operational data or log data related to the database. The management node can determine whether the database is abnormal based on the operational data or log data related to the database.

[0067] For example, the management node can periodically send query requests to target nodes in different database availability zones to monitor whether the databases in the corresponding availability zones are abnormal. In the event of a database abnormality, it generates traffic configuration adjustment information to switch the database traffic in the abnormal database availability zone and adjust the database replication topology. Optionally, the arbitration node can periodically send query requests to target nodes in different database availability zones through the management node.

[0068] The aforementioned database configuration method, by determining the communication status with the cloud platform's management node, can promptly detect connection anomalies between the target node and the management node, providing a data foundation for subsequent refined network diagnostics. By determining the network connectivity between the target database availability zone and other database availability zones in the cloud platform when communication status indicates an interruption, it can effectively distinguish between a localized failure with only the management node being disconnected and a global network partition where the target database availability zone is completely isolated, thus improving the accuracy of subsequent database instance configuration decisions. By configuring the database instance in the target database availability zone as read-only when network connectivity with other database availability zones indicates no connectivity, it avoids the risk of data conflicts or inconsistencies during network partitioning or subsequent recovery.

[0069] Based on the technical solutions of the above embodiments, this application also provides an optional embodiment in which a data backup step is added.

[0070] refer to Figure 2 The data backup steps shown include:

[0071] S210. In response to the data backup request from the management node, the stored data corresponding to the target database availability zone is sent to the backup database availability zone of the cloud platform; wherein, the data backup request is generated when the management node detects that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0072] Optionally, if the management node detects that different database availability zones in the same city are abnormal, it can send a data backup request to the target node of the corresponding database availability zone and send the stored data of the corresponding database availability zone to the backup database availability zone of the cloud platform.

[0073] Optionally, the abnormal database can be cold-backed up in a remote backup availability zone by means of data backup and Binlog synchronization.

[0074] Binlog is MySQL's binary log file, which records the operations performed on the corresponding database. It is equivalent to a history of database operations and can be used for data recovery, data replication, audit trails, etc. It is mainly divided into three types: statement level, row level, and mixed level.

[0075] For example, the backup database availability zone can call the recovery process to periodically synchronize data by spoofing the RelayLog, ensuring that the RTO (Recovery Time Objective) is less than 10 minutes.

[0076] RelayLog can be understood as a log file used by the "slave server" in MySQL to store binlog data received from the "master server". It acts as a relay station, helping the slave server to obtain changes from the master server, ensuring data consistency, and improving data synchronization efficiency and fault tolerance.

[0077] RTO refers to the maximum time required for a system to return to normal operation after an anomaly occurs, reflecting the speed at which the system recovers to normal operation after a failure.

[0078] In the above data backup steps, in response to the data backup request from the management node, the stored data corresponding to the target database availability zone is sent to the backup database availability zone of the cloud platform. The backup data availability zone performs data synchronization by periodically masquerading as the RelayLog, thereby achieving data backup, which helps to reduce data synchronization latency and thus reduce recovery time.

[0079] Based on the technical solutions of the above embodiments, the above database configuration method will be described in conjunction with the embodiments.

[0080] refer to Figure 3A The diagram shown is the overall architecture of the availability zone. Figure 3A This example uses three availability zones to illustrate the interaction process across availability zones. Data center A is the arbitration data center (i.e., the arbitration availability zone), and no database instance is configured there. Data centers B and C are both database data centers (i.e., database availability zones), and databases are configured in both data centers. In some embodiments, the database in data center B can be designated as the master database DA, and the database in data center C as the slave database DP. Data consistency between the master database DA and the slave database DP is maintained through data synchronization.

[0081] in, Figure 3A The system also introduces an Orchestrator (Orch) cluster, where Orch nodes form a cluster via the Raft protocol. For the arbitration data center, Orch nodes can elect a Leader node. For data centers B and C, learn nodes can be generated.

[0082] Taking data center B as an example, if the learn node in data center B detects a communication interruption with data center A via the Raft protocol, it determines network connectivity with other data centers (such as data center C). If communication with data center C is interrupted, it sets the database in data center B to read-only. If the leader in the arbitration data center detects an anomaly in the database in data center B, it can switch the database process through a layer 4 / 7 proxy.

[0083] Furthermore, in the event that both the databases in data centers B and C are abnormal (dual availability zones within the same city become inactive), data is sent to data center D via data backup and binlog synchronization. Data center D is a remote data center (i.e., the backup database availability zone), which can include multiple backup centers. The backup database availability zone can call the recovery process and periodically synchronize data using a fake RelayLog to achieve service recovery within 10 minutes after service degradation.

[0084] refer to Figure 3B The diagram shows the node configuration flowchart for an availability zone. The arbitration node determines whether the current availability zone is a database availability zone.

[0085] If not, the current availability zone is determined to be the arbitration availability zone (i.e., the arbitration data center). An election is initiated within the arbitration availability zone to generate a Leader node. The Leader node monitors the database status and determines whether the database is abnormal. If an abnormal database is identified, a database traffic switch is initiated, and the database traffic is switched through a traffic proxy.

[0086] If so, determine that the current availability zone is the database data center (i.e., the target database availability zone), generate a learn node in the target database availability zone; monitor whether there is a synchronization failure based on the Raft protocol. If a synchronization failure is determined, determine whether the network is not connected to other database availability zones (i.e., the gateway is unreachable). If so, set the database in the target database availability zone to read-only.

[0087] Based on the technical solutions of the above embodiments, this application also provides an optional embodiment in which the database configuration method is further refined.

[0088] refer to Figure 4 The diagram shown is a flowchart of a database configuration method in another embodiment, including:

[0089] S410. Determine the communication status between the cloud platform's management node and the Raft distributed consensus protocol.

[0090] S420. In the event of a communication interruption in the communication status, send a database connection request to the database corresponding to the database availability zone.

[0091] S430. If no response to the database connection request is received within a preset time period, determine that the network connectivity with the database availability zone is in a disconnected state.

[0092] S440. If network connectivity with other database availability zones indicates no connectivity, perform read-only settings on the database instance in the target database availability zone.

[0093] S450: In response to the query request from the management node, feed back the database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information when it identifies database anomalies based on the database association data.

[0094] S460, in response to the data backup request from the management node, sends the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform.

[0095] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0096] Based on the same inventive concept, this application also provides a database configuration apparatus for implementing the database configuration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more database configuration apparatus embodiments provided below can be found in the limitations of the database configuration method described above, and will not be repeated here.

[0097] In one exemplary embodiment, such as Figure 5 As shown, a database configuration device is provided, configured on a target node corresponding to a target database availability zone in a cloud platform. The target database availability zone runs a database instance. The device includes: a first determining module 510, a second determining module 520, and a processing module 530, wherein...

[0098] The first determining module 510 is used to determine the communication status with the management node of the cloud platform;

[0099] The second determining module 520 is used to determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform other than the target database availability zone when the communication status indicates a communication interruption.

[0100] Processing module 530 is used to perform read-only settings on database instances in the target database availability zone when network connectivity with other database availability zones indicates that they are not connected.

[0101] In one embodiment, the communication state is the communication state between the target node and the management node based on the distributed consensus Raft protocol; correspondingly, the second determining module 520 includes: a first determining unit, used to determine the network connectivity between the target database availability zone and the database of the database availability zone based on the connection status between the target node and the database of the database availability zone.

[0102] In one embodiment, the first determining unit includes: a first sending subunit, configured to send a database connection request to the database corresponding to the database availability zone; a first determining subunit, configured to determine that the network connectivity with the database availability zone is in a connected state if a request response to the database connection request is received within a preset time period; and a second determining subunit, configured to determine that the network connectivity with the database availability zone is in a disconnected state if no request response to the database connection request is received within the preset time period.

[0103] In one embodiment, the management node is deployed in the arbitration availability zone of the cloud platform, and no database instance is running in the arbitration availability zone.

[0104] In one embodiment, the above apparatus further includes: a feedback module, configured to respond to an inquiry request from a management node by providing database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information when it identifies a database anomaly based on the database association data; wherein the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules for the database access traffic corresponding to the target database availability zone.

[0105] In one embodiment, the above apparatus further includes: a sending module, configured to send the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform in response to a data backup request from the management node; wherein the data backup request is generated when the management node identifies that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0106] Each module in the aforementioned database configuration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0107] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores and accesses data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a database configuration method.

[0108] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0109] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0110] Determine the communication status with the management node of the cloud platform;

[0111] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0112] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0113] In one embodiment, the communication state is the communication state between the target node and the management node based on the distributed consensus Raft protocol; when the processor executes the computer program, it also implements the following steps: determining the network connectivity between the target database availability zone and the database availability zone based on the connection status between the target node and the database in the database availability zone.

[0114] In one embodiment, when the processor executes the computer program, it further performs the following steps: sending a database connection request to the database corresponding to the database availability zone; if a response to the database connection request is received within a preset time period, determining that the network connectivity with the database availability zone is in a connected state; if no response to the database connection request is received within the preset time period, determining that the network connectivity of the database availability zone is in a disconnected state.

[0115] In one embodiment, the management node is deployed in the arbitration availability zone of the cloud platform, and no database instance is running in the arbitration availability zone.

[0116] In one embodiment, when the processor executes the computer program, it further implements the following steps: in response to an inquiry request from the management node, it feeds back the database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information if it identifies a database anomaly based on the database association data; wherein, the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules of the database access traffic corresponding to the target database availability zone.

[0117] In one embodiment, when the processor executes the computer program, it further performs the following steps: in response to a data backup request from the management node, it sends the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform; wherein, the data backup request is generated when the management node identifies that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0119] Determine the communication status with the management node of the cloud platform;

[0120] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0121] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0122] In one embodiment, the communication state is the communication state between the target node and the management node based on the distributed consensus Raft protocol; when the processor executes the computer program, it also implements the following steps: determining the network connectivity between the target database availability zone and the database availability zone based on the connection status between the target node and the database in the database availability zone.

[0123] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: sending a database connection request to the database corresponding to the database availability zone; if a response to the database connection request is received within a preset time period, determining that the network connectivity with the database availability zone is in a connected state; if no response to the database connection request is received within the preset time period, determining that the network connectivity of the database availability zone is in a disconnected state.

[0124] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: deploying the management node in the arbitration availability zone of the cloud platform, wherein no database instance is running in the arbitration availability zone.

[0125] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: responding to an inquiry request from the management node, it feeds back the database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information if it identifies a database anomaly based on the database association data; wherein, the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules of the database access traffic corresponding to the target database availability zone.

[0126] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to a data backup request from the management node, it sends the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform; wherein, the data backup request is generated when the management node identifies that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0127] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0128] Determine the communication status with the management node of the cloud platform;

[0129] In the event of a communication status interruption, determine the network connectivity between the target database availability zone and other database availability zones in the cloud platform besides the target database availability zone.

[0130] If network connectivity with other database availability zones indicates no connectivity, the database instance in the target database availability zone is configured to be read-only.

[0131] In one embodiment, the communication state is the communication state between the target node and the management node based on the distributed consensus Raft protocol; when the processor executes the computer program, it also implements the following steps: determining the network connectivity between the target database availability zone and the database availability zone based on the connection status between the target node and the database in the database availability zone.

[0132] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: sending a database connection request to the database corresponding to the database availability zone; if a response to the database connection request is received within a preset time period, determining that the network connectivity with the database availability zone is in a connected state; if no response to the database connection request is received within the preset time period, determining that the network connectivity of the database availability zone is in a disconnected state.

[0133] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: deploying the management node in the arbitration availability zone of the cloud platform, wherein no database instance is running in the arbitration availability zone.

[0134] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: responding to an inquiry request from the management node, it feeds back the database association data of the target database availability zone to the management node, so that the management node can generate traffic configuration adjustment information if it identifies a database anomaly based on the database association data; wherein, the traffic configuration adjustment information is used to instruct the traffic proxy node to adjust the routing rules of the database access traffic corresponding to the target database availability zone.

[0135] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to a data backup request from the management node, it sends the stored data corresponding to the target database availability zone to the backup database availability zone of the cloud platform; wherein, the data backup request is generated when the management node identifies that the number of abnormal database availability zones in the cloud platform has reached a preset number; the abnormal database availability zones include the target database availability zone.

[0136] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0137] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0138] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A database configuration method characterized by, The method is applied to a target node corresponding to a target database availability zone in a cloud platform, the target database availability zone runs a database instance, and the method comprises the following steps: determining a communication state between the target node and a management node of the cloud platform; in the case that the communication state represents a communication interruption, determining network connectivity of the target database availability zone and other database availability zones in the cloud platform except the target database availability zone; in the case that the network connectivity of the other database availability zones all represents an unconnected state, performing a read-only setting processing on the database instance in the target database availability zone.

2. The method of claim 1, wherein, The communication state is a communication state between the target node and the management node based on a distributed consensus raft protocol; accordingly, the determination of the network connectivity of the target database availability zone and the other database availability zones in the cloud platform except the target database availability zone comprises: determining the network connectivity of the target database availability zone and the database availability zone according to the connection state between the target node and the database of the database availability zone.

3. The method of claim 2, wherein, The determination of the network connectivity of the target database availability zone and the database availability zone according to the connection state between the target node and the database of the database availability zone comprises: sending a database connection request to the database corresponding to the database availability zone; in the case that a request response is received within a preset time period, it is determined that the network connectivity of the database availability zone is in a connected state; in the case that no request response is received within a preset time period, it is determined that the network connectivity of the database availability zone is in an unconnected state.

4. The method according to any one of claims 1 to 3, characterized in that, The management node is deployed in an arbitration availability zone of the cloud platform, and the arbitration availability zone does not run a database instance.

5. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: in response to an inquiry request of the management node, feeding back database association data of the target database availability zone to the management node, so that the management node generates traffic configuration adjustment information in the case that a database exception is identified according to the database association data; wherein, the traffic configuration adjustment information is used to instruct a traffic proxy node to adjust the routing rules of the database access traffic corresponding to the target database availability zone.

6. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: in response to a data backup request of the management node, sending the stored data corresponding to the target database availability zone to a backup database availability zone of the cloud platform; wherein, the data backup request is generated by the management node in the case that a preset number of abnormal database availability zones in the cloud platform are identified; the abnormal database availability zones include the target database availability zone.

7. A database configuration apparatus characterized by comprising: The device is configured in a target node corresponding to a target database availability zone in a cloud platform, the target database availability zone runs a database instance, and the device comprises: a first determination module, configured to determine a communication state between the target node and a management node of the cloud platform; A second determining module is configured to determine network connectivity between the target database available zone and other database available zones in the cloud platform except the target database available zone in the case that the communication state represents a communication interruption. A processing module is configured to perform read-only setting processing on a database instance in the target database available zone in the case that the network connectivity with the other database available zones all represent no connectivity.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor, when executing the computer program, implements the steps of the method in any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method in any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method in any one of claims 1 to 6.