A database VPC network access method and device, electronic equipment and program product
By deploying network access control components and connection agent components on a container orchestration platform, and dynamically monitoring custom resources of cloud databases, the issues of POD restart and configuration update when cloud-native databases access VPC networks are resolved, thus meeting the requirements for high availability and real-time performance.
Patent Information
- Application Number
- CN202511358469.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-09-23
AI Technical Summary
Existing cloud-native databases suffer from issues when connecting to VPC networks, such as time-consuming VPC network interface creation, POD restarts, lack of support for Service mode, and poor real-time configuration updates, making it difficult to meet high availability and real-time requirements.
By deploying network access control components through a container orchestration platform and combining them with connection proxy components, the annotation information of custom resources in the cloud database can be dynamically monitored to achieve seamless access to the VPC network, real-time configuration updates, automatic switching between primary and backup databases, and reduced risks associated with manual operations.
It enables seamless access to the cloud database VPC network, avoids POD restarts, ensures the stability of existing connections, improves high availability and operational efficiency, and meets real-time requirements.
Smart Images

Figure CN120856491B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a database VPC network access method, device, electronic device, and program product. Background Technology
[0002] With the development of cloud databases, VPC networks have become the mainstream network connection method for cloud databases due to their ability to achieve network isolation and support user-defined network segments and routing policies. Currently, most cloud-native databases are deployed based on the Kubernetes container orchestration platform. Access to cloud databases via VPC networks is achieved by creating VPC network interfaces within containers, combined with cloud hosts or elastic public networks. However, VPC networks still have some issues in use. For example, when connecting cloud-native databases from existing classic networks to VPC networks, creating VPC network interfaces is time-consuming and triggers POD restarts, affecting existing connections; VPC networks do not support the Service mode, requiring users to manually modify connection information during primary / standby database switching; configuration updates suffer from poor real-time performance or require POD restarts, making it difficult to meet scenarios with high real-time requirements.
[0003] Therefore, there is an urgent need to provide a method that enables seamless access to cloud-native database VPC networks, high availability during primary / standby switching, and real-time hot updates of configurations, in order to solve various problems in the access and use of existing VPC networks. Summary of the Invention
[0004] This application provides a database VPC network access method, device, electronic device, and program product.
[0005] Firstly, this application provides a database VPC network access method, comprising the following steps:
[0006] Deploy network access control components through a container orchestration platform. These components include a configuration control unit and a cluster control unit.
[0007] The cluster control unit determines whether a cloud database instance is accessing the VPC network based on the annotation information of the custom resources of the cloud database.
[0008] When a cloud database instance is connected to the VPC network, the cluster control unit generates a connection configuration storage unit corresponding to the connection proxy component based on the connection information of the cloud database master database and deploys the connection proxy component. The connection proxy component receives VPC network requests through the first network interface card and forwards the VPC network requests to the cloud database instance through the second network interface card.
[0009] The cluster control unit monitors changes to the VPC network address of the connection agent component, dynamically updates the annotation information of custom resources in the cloud database, and binds domain name resolution or elastic public network services.
[0010] The configuration control unit detects update events of the control configuration storage unit and performs hot updates to the configuration of the cluster control unit.
[0011] In some embodiments, the annotation information of custom resources in cloud databases includes at least one of user identifier, VPC subnet parameters, security group rules, and network type identifier;
[0012] The cluster control unit verifies whether the annotation information of the custom resources of the cloud database matches the preset access rules to determine whether to enable VPC network access for the cloud database instance.
[0013] In some embodiments, the cluster control unit generates a connection configuration storage unit corresponding to the connection proxy component based on the master database connection information of the cloud database, including:
[0014] The cluster control unit queries the network address and service port of the master database of the cloud database that is in normal operation;
[0015] The cluster control unit constructs a configuration template for the connection proxy component based on the network address and service port, generates a connection configuration storage unit corresponding to the connection proxy component, and configures the connection configuration storage unit to load the configuration of the connection proxy component and initialize the parameters.
[0016] In some embodiments, the connection proxy component includes a configuration hot update unit, a configuration unit, a startup unit, and a proxy service unit. The connection proxy component triggers a configuration hot update of the proxy service unit, including:
[0017] After the configuration hot update unit detects that the configuration connected to the configuration storage unit has been updated, it writes the latest configuration to the temporary configuration file of the configuration unit.
[0018] The process of the agent service unit is terminated to trigger the startup unit. The startup unit verifies the validity of the temporary configuration file. If the verification is successful, the contents of the temporary configuration file are synchronized to the main configuration file of the configuration unit and the temporary configuration file is cleared. Then the agent service unit is restarted to complete the hot configuration update.
[0019] In some embodiments, when the proxy service unit is started for the first time, the startup unit obtains the initial configuration through the mounting configuration file of the configuration unit, writes it into the main configuration file of the configuration unit after verifying its legality, and starts the proxy service unit.
[0020] In some embodiments, the cluster control unit monitors the primary / standby switchover event of the cloud database in real time. When a primary / standby switchover of the cloud database is detected, the forwarding configuration of the connection proxy component is updated in real time so that the connection request is directed to the new primary database of the cloud database.
[0021] In some embodiments, when the cluster control unit detects a change in the VPC network address, it updates the annotation information of the VPC network address in the cloud database custom resource, rebinds the domain name resolution or elastic public network service, and writes the updated domain name or elastic public network information into the annotation of the cloud database custom resource.
[0022] In some embodiments, the cluster control unit includes a dynamic monitoring subunit, which acquires creation, update and deletion events of custom resources in the cloud database in real time, performs at least one operation on the events, including status verification, annotation comparison and tag matching, and triggers the VPC network access or unloading process when the event meets the queuing conditions.
[0023] In some embodiments, the configuration control unit monitors and obtains update events of the control configuration storage unit in real time, and dynamically updates the global configuration parameters.
[0024] Secondly, this application provides a database VPC network access device, including a network access control component and a connection proxy component;
[0025] The network access control component includes a configuration control unit and a cluster control unit. The configuration control unit is configured to monitor update events of the control configuration storage unit and realize hot updates of the cluster control unit's configuration. The monitoring control configuration storage unit is subordinate to the network access control component. The cluster control unit is configured to monitor annotation information of custom resources in the cloud database, determine whether to access the VPC network based on the annotation information, generate a connection configuration storage unit corresponding to the connection proxy component when accessing the VPC network, deploy at least two connection proxy components, monitor VPC network address events, and update annotations of custom resources in the cloud database.
[0026] The connection proxy component includes a proxy service unit, a configuration hot update unit, a compilation unit, a startup unit, and a configuration unit. The configuration hot update unit is configured to monitor update events of the connection configuration storage unit and trigger a configuration hot update for the proxy service unit. The compilation unit includes a compilation script configured to automatically compile and package the proxy service unit. The startup unit includes a startup script configured to perform at least one of the following on the configuration unit: configuration verification, loading, and service startup. The configuration unit includes a main configuration file, a mount configuration file, and a temporary configuration file. The main configuration file is configured to store valid configurations, the mount configuration file is configured to initialize configurations, and the temporary configuration file is configured to verify and update configurations.
[0027] In some embodiments, the cluster control unit includes a dynamic monitoring subunit, which monitors cloud database custom resource events and connection proxy component resource events respectively, and performs at least one of the following operations: creation, update, and deletion of the connection proxy component based on the event status check results.
[0028] In some embodiments, the connection proxy component is further configured with a first network interface card (NIC) and a second NIC;
[0029] The proxy service unit receives VPC network requests through the first network interface card (NIC); the proxy service unit forwards the VPC network requests to the cloud database instance through the second NIC.
[0030] Thirdly, this application provides an electronic device including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement any of the methods described above.
[0031] Fourthly, this application provides a computer program product, including a computer program, and a method for implementing any of the foregoing when the computer program is executed by a processor.
[0032] The above-mentioned technical solutions adopted in this application embodiment can achieve the following beneficial effects: By deploying the network access control component through the container orchestration platform and combining it with the connection proxy component, seamless access to the cloud database VPC network is achieved, avoiding the POD restart problem caused by the creation of traditional VPC network cards and ensuring the stability of existing connections. The cluster control unit dynamically judges access requirements based on custom resource annotation information and updates the forwarding configuration by monitoring the master-slave switch event in real time, ensuring that connection requests automatically point to the new master database during master-slave switch, significantly improving the high availability of database services. By verifying the temporary configuration file and synchronizing it with the main configuration file, real-time hot updates of the configuration of the connection proxy component and the cluster control unit are achieved, meeting the needs of scenarios with high real-time requirements. The automatic processing of resource events by the dynamic monitoring subunit and the automatic binding of domain names and elastic public networks when network addresses change reduce the risk of manual operation and improve the flexibility, reliability and operation and maintenance efficiency of cloud database VPC network access.
[0033] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description
[0034] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0035] Figure 1 This illustration schematically shows the overall process of VPC network access in a database VPC network access method according to an embodiment of this application;
[0036] Figure 2 This illustration schematically shows a cloud database custom resource event capture process of a database VPC network access method according to an embodiment of this application;
[0037] Figure 3 This illustration schematically shows a resource event verification process of a database VPC network access method according to an embodiment of this application;
[0038] Figure 4 This illustration schematically shows a resource event matching process of a database VPC network access method according to an embodiment of this application;
[0039] Figure 5 This illustration schematically shows a connection proxy component deployment process for a database VPC network access method according to an embodiment of this application;
[0040] Figure 6 This illustration schematically shows a configuration storage unit generation process of a database VPC network access method according to an embodiment of this application;
[0041] Figure 7 This illustration schematically shows a hot update process for the configuration of a connection proxy component in a database VPC network access method according to an embodiment of this application.
[0042] Figure 8 This illustration schematically shows a hot update process of the configuration control unit in a database VPC network access method according to an embodiment of this application;
[0043] Figure 9 This illustration schematically shows a cloud database primary / backup switching process of a database VPC network access method according to an embodiment of this application.
[0044] Figure 10 This illustration schematically shows a VPC network address change processing flow diagram of a database VPC network access method according to an embodiment of this application;
[0045] Figure 11 This illustration schematically shows an overall architecture diagram of a database VPC network access device according to an embodiment of this application;
[0046] Figure 12 This illustration schematically shows a network access control component structure of a database VPC network access device according to an embodiment of this application;
[0047] Figure 13 This illustration schematically shows a connection proxy component structure of a database VPC network access device according to an embodiment of this application;
[0048] Figure 14 An exemplary block diagram of a computer program product of a database VPC network access method according to an embodiment of this application is shown schematically.
[0049] In the diagram: 1101, Network Access Control Component; 1102, Connection Proxy Component; 1103, Configuration Control Unit; 1104, Cluster Control Unit; 1105, Control Configuration Storage Unit; 1106, Connection Configuration Storage Unit; 1107, Dynamic Monitoring Subunit; 1108, Proxy Service Unit; 1109, First Network Interface Card (NIC); 1110, Second Network Interface Card (NIC); 1111, Configuration Hot Update Unit; 1112, Configuration Unit; 1113, Startup Unit; 1114, Compilation Unit; 1115, Main Configuration File; 1116, Mount Configuration File; 1117, Temporary Configuration File; 1401, Computer Program. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application more apparent, exemplary embodiments according to this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0051] Figure 1 The illustration shows a schematic diagram of the overall process of VPC network access according to an embodiment of the present application.
[0052] like Figure 1 As shown, the steps include:
[0053] S101, Deploy network access control component 1101 based on the container orchestration platform. Network access control component 1101, deployed on the container orchestration platform, includes a configuration control unit 1103 and a cluster control unit 1104. The configuration control unit 1103 is configured to respond in real-time to updates to the control configuration storage unit 1105, ensuring that the operating parameters of the cluster control unit 1104 are always up-to-date. The cluster control unit 1104 is configured to schedule and manage the VPC network access of the cloud database.
[0054] S102, the cluster control unit 1104 determines the VPC network access requirement. The cluster control unit 1104 continuously monitors the custom resources corresponding to the cloud database instance, such as user identifiers, specific parameters of the VPC subnet, security group rules, and network type identifiers. The cluster control unit 1104 compares this annotation information with preset VPC access rules to determine whether the current cloud database instance needs to access the VPC network. If the annotation information is complete and conforms to the rules, and the cloud database POD is running normally, it is determined that access to the VPC network is required; if the annotation information is missing or mismatched, or the cloud database POD is abnormal, the VPC network access process is temporarily not initiated.
[0055] S103, the cluster control unit 1104 generates a connection configuration storage unit 1106 and deploys a connection proxy component 1102. When the cluster control unit 1104 determines that the current cloud database instance needs to access the VPC network, it queries the currently operating cloud database master database to obtain key connection information such as its network address and service port. Based on this connection information, the cluster control unit 1104 constructs a corresponding configuration template and generates the connection configuration storage unit 1106 for the connection proxy component 1102. The connection configuration storage unit 1106 is configured to store all parameters required for the operation of the proxy component, including the cloud database master database address, forwarding rules, network adaptation parameters, etc.
[0056] After completing the deployment and configuration of the connection configuration storage unit 1106, the cluster control unit 1104 deploys at least two connection proxy components 1102 to avoid single points of failure and ensure high availability. The connection proxy component 1102 is equipped with a first network interface card (NIC) 1109 and a second NIC 1110. The first NIC 1109 is configured to receive external requests from the VPC network, and the second NIC 1110 forwards external requests from the VPC network to the underlying cloud database instance.
[0057] S104, the cluster control unit 1104 monitors VPC network address changes and updates annotations. After the connection proxy component 1102 is deployed, it is assigned a VPC network address to receive external requests. The cluster control unit 1104 monitors the generation and changes of this VPC network address in real time. When the VPC network address is generated for the first time, it is written into the annotation of the cloud database custom resource. If a change to the VPC network address is detected, such as in network migration or fault recovery scenarios, the VPC network address information in the annotation is updated first, and then the domain name resolution or elastic public network service is rebound to ensure that access via domain name or public network address is not affected. After binding is completed, the updated domain name or public network information is also synchronized to the annotation of the cloud database custom resource to update the connection information.
[0058] S105, the configuration control unit 1103 performs a hot update of the configuration. The configuration control unit 1103 monitors changes to the control configuration storage unit 1105. The control configuration storage unit 1105 is configured to record global parameters required for the operation of the cluster control unit 1104, such as VPC network adaptation rules, domain name resolution policies, and elastic public network binding methods. When the global parameters in the control configuration storage unit 1105 are updated, the configuration control unit 1103 responds to the change by performing a validity check on the global parameters. If the check passes, the updated global parameters are synchronized to the operating environment of the cluster control unit 1104, achieving a non-stop hot update of the global configuration.
[0059] S106, Cluster Control Unit 1104 verifies the VPC network access status of the cloud database instance. Cluster Control Unit 1104 performs a comprehensive verification of the VPC network access status of the cloud database instance, including whether the connection proxy component 1102 is running normally, whether the VPC network address is valid, whether the domain name resolution or elastic public network service is successfully bound, and whether the forwarding function of the proxy component is normal. If all verification items pass, the VPC network access status is determined to be normal, and this process ends; if an anomaly is found, a retry mechanism is triggered, and the deployment, configuration, or binding steps are re-executed until the status returns to normal.
[0060] Figure 2 The illustration shows a schematic diagram of a cloud database custom resource event capture process according to an embodiment of the present application for a database VPC network access method.
[0061] like Figure 2 As shown, the steps include:
[0062] S201, the cluster control unit 1104 initializes the dynamic listening subunit 1107. The cluster control unit 1104 performs initialization operations on the dynamic listening subunit 1107, including loading preset listening rules, establishing a communication connection with the container orchestration platform, initializing local cache space to temporarily store event data, and configuring the event listening frequency and triggering conditions. The dynamic listening subunit 1107 uses an Informer mechanism to implement real-time listening to resource events, directly subscribing to resource change notifications from the container orchestration platform without repeatedly polling and initiating requests, thus reducing system resource consumption.
[0063] S202, the dynamic monitoring sub-unit 1107 acquires real-time full lifecycle events of custom resources in the cloud database and resource events of the connection proxy component 1102. The dynamic monitoring sub-unit 1107 continuously monitors the full lifecycle events of custom database resources, including key operations such as resource creation, updating, and deletion. Simultaneously, the dynamic monitoring sub-unit 1107 monitors resource events of the connection proxy component 1102, such as changes in the proxy component's state, configuration updates, and changes in the number of replicas.
[0064] S203, Dynamic monitoring subunit 1107 filters and preprocesses events. After acquiring events, dynamic monitoring subunit 1107 performs filtering and preprocessing. The filtering operation is used to remove irrelevant or invalid events, such as brief fluctuations in resource status, repeated transmission of the same event, etc., and only retains key events that have a real impact on VPC network access.
[0065] The preprocessing operation extracts the core information of the event, such as the event type, the associated cloud database instance ID, the occurrence time, and the specific changes, and processes it in a standardized manner according to a unified format. At the same time, it makes a preliminary judgment on the correlation between the event and the current VPC network access process.
[0066] S204, the dynamic monitoring subunit 1107 enqueues the events that pass the verification. The dynamic monitoring subunit 1107 further verifies the events, including the completeness of the event information, network parameters, the legality of the event, and the matching degree of the event with the current business scenario.
[0067] If an event passes all validations, the dynamic listening sub-unit 1107 will place it in the corresponding processing queue, waiting for the cluster control unit 1104 to process it in sequence. When enqueuing, the events will be sorted according to their priority.
[0068] S205, Dynamic Listening Subunit 1107 updates the cache and retryes events that fail validation. Dynamic Listening Subunit 1107 records processed event information in the cache to ensure that local data is consistent with the actual resource status of the container orchestration platform. For events that fail validation, Dynamic Listening Subunit 1107 retryes. First, it records the reason for the event's failure, sets a reasonable retry interval, and then performs validation again.
[0069] Figure 3 The illustration shows a resource event verification process of a database VPC network access method according to an embodiment of this application.
[0070] like Figure 3 As shown, the steps include:
[0071] S301, Dynamic monitoring subunit 1107 receives the event and performs initial context verification. After receiving the event, dynamic monitoring subunit 1107 performs initial context verification, including the event source identifier, the timestamp of the event occurrence, the event type, and the permissions of the operation subject that triggered the event.
[0072] S302, the dynamic monitoring subunit 1107 verifies the running status of the event-related resources. For events that pass the initial context verification, the dynamic monitoring subunit 1107 further verifies the current running status of its associated resources, which include the cloud database instance corresponding to the event and the connection proxy component 1102 involved in the event.
[0073] S303, the dynamic monitoring subunit 1107 compares and verifies the annotation information of custom resources in the cloud database.
[0074] Integrity check: Checks whether required fields such as user ID, VPC subnet parameters, security group rules, and network type ID are complete;
[0075] Validity verification: Verify whether the VPC subnet is a valid network segment, whether the security group rule format is valid, and whether the user identifier corresponds to a valid user;
[0076] Rule matching: Compare annotation information with preset VPC access rules to confirm compliance with access logic.
[0077] S304, Dynamic Listening Subunit 1107 performs tag matching. Based on the event type, Dynamic Listening Subunit 1107 matches the tags of associated resources with preset tag rules to avoid erroneous operations across instances and permissions.
[0078] S305, Dynamic monitoring subunit 1107 performs verification result determination. Dynamic monitoring subunit 1107 integrates the verification results and makes a determination. If all steps pass the verification, the event is sent to the corresponding processing queue to wait for cluster control unit 1104 to perform subsequent operations.
[0079] If the verification fails, the dynamic monitoring sub-unit 1107 records the specific reason for the failure and decides whether to retry based on the failure type.
[0080] Figure 4 The illustration shows a resource event matching process of a database VPC network access method according to an embodiment of this application.
[0081] like Figure 4 As shown, the steps include:
[0082] S401, the dynamic monitoring subunit 1107 identifies and classifies the types of events. After acquiring an event, the dynamic monitoring subunit 1107 identifies its specific type and classifies it by parsing the core identification information of the event. The event types are mainly divided based on operation behavior and resource object: based on operation behavior, it includes the creation, updating, deletion, and status change of resources; based on resource object, it is divided into events for custom resources of the cloud database and events for the connection proxy component 1102.
[0083] S402, Dynamic monitoring subunit 1107 verifies resource association relationships. During the verification process, dynamic monitoring subunit 1107 compares the association identifier carried by the event with the resource relationship graph recorded by the system. If it finds that the connection proxy component 1102 does not match the cloud database instance, or that the instance is not registered, the association relationship is determined to be invalid, and the event will not proceed to the subsequent matching stage.
[0084] S403, the dynamic monitoring subunit 1107 matches the tag rules. Resource tags are key information that marks resource attributes. The dynamic monitoring subunit 1107 matches the corresponding tag rules according to the event type. During matching, the dynamic monitoring subunit 1107 compares the actual tags of the resource with the required tags and optional tags in the preset rules. If the core tag is missing or the tag value does not match, the tag rule matching is determined to be unsuccessful.
[0085] S404, Dynamic monitoring subunit 1107 matches annotation rules. Annotation information records specific configuration details of resources, such as VPC subnet range, security group permissions, and connection ports. Dynamic monitoring subunit 1107 verifies whether the annotation information meets the requirements according to the service rules for VPC network access. During the matching process, dynamic monitoring subunit 1107 checks the consistency of key parameters in the annotation with preset rules one by one. If there are problems such as invalid subnet, insufficient permissions, or incorrect address, the annotation rule matching is deemed to have failed.
[0086] S405, the dynamic monitoring subunit 1107 integrates and processes the matching results. The dynamic monitoring subunit 1107 synthesizes the matching results and processes them. If the event type matches correctly, the resource association is valid, and the tags and annotations all conform to the rules, the event is added to the processing queue according to its corresponding priority, waiting for the cluster control unit 1104 to execute specific operations. If any step fails to match, it is handled according to the reason for the failure.
[0087] Figure 5 The illustration shows a schematic diagram of the deployment process of a connection proxy component in a database VPC network access method according to an embodiment of this application.
[0088] like Figure 5 As shown, the steps include:
[0089] S501, Cluster Control Unit 1104 performs a comprehensive verification of the trigger conditions for deploying the connection agent component 1102. Before initiating the deployment process of the connection agent component 1102, the Cluster Control Unit 1104 performs a full verification of the trigger conditions to ensure the necessity and feasibility of the deployment operation. This includes verifying whether the cloud database instance is running normally, whether the annotation information of the cloud database custom resources is complete and conforms to VPC access rules, and whether a valid primary database instance already exists. If all conditions are met, the deployment process proceeds to the next step; if any condition is not met, the deployment is paused, and the verification is re-performed after the status is restored.
[0090] S502, the cluster control unit 1104 obtains the connection information of the cloud database master database. After the trigger condition verification passes, the cluster control unit 1104 queries the cloud database master database instance that is in normal operation in the current cloud database cluster and extracts its core connection information, including the master database's network address, service port, and master database status identifier.
[0091] S503, Cluster Control Unit 1104 deploys Connection Agent Component 1102. Based on the acquired cloud database master database information and the VPC network configuration in the annotations, Cluster Control Unit 1104 deploys Connection Agent Component 1102. During deployment, Cluster Control Unit 1104 creates a Connection Agent Component 1102 instance in the container orchestration platform, including a first network interface card (NIC) 1109 and a second NIC 1110. The first NIC 1109 is configured to access the VPC network and receive external requests, while the second NIC 1110 is configured to communicate with the cloud database internal network and forward external requests from the VPC network to the cloud database master database. During deployment, the VPC subnet and security group rules specified in the annotations are matched to ensure that the network permissions of the agent component meet the requirements.
[0092] S504, the cluster control unit 1104 generates a connection configuration storage unit 1106. After the connection proxy component 1102 is deployed, the cluster control unit 1104 generates the connection configuration storage unit 1106 based on the connection information of the cloud database master and the VPC network parameters. The configuration storage unit includes all the configuration parameters required for the operation of the connection proxy component 1102, including the forwarding target address of the cloud database master, request forwarding rules, VPC network communication parameters, and the proxy's own operating parameters. After the connection configuration storage unit 1106 is generated, it is bound to the connection proxy component 1102 for initializing the proxy service.
[0093] S505, the dynamic monitoring subunit 1107 monitors VPC network address generation events. After the connection agent component 1102 completes deployment, it requests a dedicated network address from the VPC network to receive requests from the external VPC network. When the dynamic monitoring subunit 1107 monitors in real time that the VPC network address has been successfully allocated and taken effect, the dynamic monitoring subunit 1107 immediately triggers an event notification, feeding back the relevant information about the VPC network address generation to the cluster control unit 1104.
[0094] S506, the cluster control unit 1104 updates the custom resource annotation information of the cloud database. After the dynamic monitoring subunit 1107 confirms the generation of the VPC network address, the cluster control unit 1104 writes the VPC network address into the annotation information of the custom resource of the cloud database.
[0095] S507, the cluster control unit 1104 performs domain name resolution or elastic public network binding based on the control configuration storage unit 1105. The cluster control unit 1104 reads the preset domain name resolution rules or elastic public network configuration in the control configuration storage unit 1105 and binds the corresponding service to the generated VPC network address. After the binding is completed, the cluster control unit 1104 synchronously updates the domain name or elastic public network access information to the annotation of the cloud database custom resource.
[0096] Figure 6 The illustration shows a schematic diagram of the configuration storage unit generation process of a database VPC network access method according to an embodiment of this application.
[0097] like Figure 6 As shown, the steps include:
[0098] S601, the dynamic monitoring subunit 1107 queries and verifies the connection information of the cloud database master database. The dynamic monitoring subunit 1107 queries the core connection information of the current cloud database master database, including the master database's network address, service port, and running status identifier, and verifies this information, including checking whether the cloud database master database is in normal operating condition, verifying the legality of the network address format, and confirming whether the service port is within the allowed range. If all information passes verification, the dynamic monitoring subunit 1107 sends it to the cluster control unit 1104.
[0099] S602, Cluster Control Unit 1104 constructs a configuration template. Based on the cloud database master database connection information provided by the Dynamic Listening Subunit 1107, and combined with the requirements of VPC network access, Cluster Control Unit 1104 constructs a corresponding configuration template, including forwarding configuration, network adaptation configuration, and agent running parameters.
[0100] S603, the cluster control unit 1104 generates the connection configuration storage unit 1106. The cluster control unit 1104 generates the connection configuration storage unit 1106 based on the specific parameters in the cloud database master database connection information.
[0101] S604, the cluster control unit 1104 performs a validity check on the configuration in the connection configuration storage unit 1106. The cluster control unit 1104 performs a validity check on the generated connection configuration storage unit 1106, including checking whether there are logical conflicts in the forwarding rules, whether the network parameters match the actual configuration of the VPC subnet and security group, and whether the operating parameters meet the performance limits of the proxy component.
[0102] S605, the cluster control unit 1104 binds and initializes the connection configuration storage unit 1106 and the connection proxy component 1102. The cluster control unit 1104 binds the verified connection configuration storage unit 1106 to the corresponding connection proxy component 1102 through the container orchestration platform. After binding, the connection proxy component 1102 loads the configuration information from the connection configuration storage unit 1106, completes the initialization process, sets the request forwarding path according to the forwarding rules, initializes the dual-NIC communication mode according to network parameters, and starts the proxy service process according to the operating parameters.
[0103] Figure 7 The illustration shows a schematic diagram of the hot update process for the connection proxy component configuration of a database VPC network access method according to an embodiment of this application.
[0104] like Figure 7 As shown, the steps include:
[0105] S701, the configuration hot update unit 1111 monitors configuration update events. The configuration hot update unit 1111 continuously listens for changes in the connection configuration storage unit 1106. The connection configuration storage unit 1106 stores the operating parameters of the connection proxy component 1102, such as forwarding rules and network adaptation parameters. When these configurations are updated, the configuration hot update unit 1111 captures the corresponding change event in real time.
[0106] S702, the configuration hot update unit 1111 writes the latest configuration to a temporary file. The configuration hot update unit 1111 reads the complete latest configuration content from the connected configuration storage unit 1106 and writes it to the temporary configuration file 1117 of the configuration unit 1112. During the writing process, the hot update unit verifies the integrity of the configuration content to ensure that all parameters of the new configuration are written correctly.
[0107] S703, the configuration hot update unit 1111 terminates the process of the proxy service unit 1108. After the temporary configuration file 1117 is written, the configuration hot update unit 1111 terminates the running process of the proxy service unit 1108. After the process of the proxy service unit 1108 is terminated, the startup unit 1113 responds to the service interruption by performing configuration verification and service restart procedures.
[0108] S704, the startup unit 1113 verifies the validity of the temporary configuration file 1117. When the startup unit 1113 detects that the agent service unit 1108 process has terminated, it verifies the new configuration in the temporary configuration file 1117, including whether the configuration format conforms to the specification, whether the parameter values are within the valid range, and whether the configuration logic conflicts.
[0109] S705, startup unit 1113 synchronizes the contents of temporary configuration file 1117 to main configuration file 1115 and clears temporary configuration file 1117. After temporary configuration file 1117 passes validity verification, startup unit 1113 synchronizes its configuration content to main configuration file 1115. Main configuration file 1115 is the actual configuration source loaded by proxy service unit 1108. After configuration synchronization is complete, startup unit 1113 clears temporary configuration file 1117 to avoid repeatedly loading the same configuration in subsequent processes and to prevent configuration chaos caused by residual configuration in temporary configuration file 1117.
[0110] S706, Startup unit 1113 restarts the process of proxy service unit 1108. After the main configuration file 1115 is updated, startup unit 1113 restarts the process of proxy service unit 1108. After the process of proxy service unit 1108 restarts, proxy service unit 1108 reads the latest configuration content in the main configuration file 1115, initializes forwarding rules, network parameters, etc. according to the new configuration, and ensures that the service runs based on the updated parameters.
[0111] Figure 8 The illustration shows a schematic diagram of the configuration control unit hot update process of a database VPC network access method according to an embodiment of this application.
[0112] like Figure 8 As shown, the steps include:
[0113] S801, the configuration control unit 1103 initializes its monitoring of the control configuration storage unit 1105. The control configuration storage unit 1105 stores the global configurations required for the operation of the cluster control unit 1104, including key configurations such as VPC network scheduling rules, domain name resolution policies, and elastic public network binding parameters. The configuration control unit 1103 establishes a real-time connection with the control configuration storage unit 1105, clarifies the scope of configuration items to be monitored, and sets the conditions for event triggering. Simultaneously, the configuration control unit 1103 initializes its local cache, synchronizing the current configuration in the control configuration storage unit 1105 to the cache as a benchmark for subsequent configuration comparisons, ensuring rapid identification of configuration changes.
[0114] S802, the configuration control unit 1103 captures update events of the control configuration storage unit 1105. The configuration control unit 1103 continuously listens for and captures all change events of the control configuration storage unit 1105 in real time.
[0115] S803, the configuration control unit 1103 parses and verifies the configuration content of the control configuration storage unit 1105. The configuration control unit 1103 parses and verifies the changed configuration content in the control configuration storage unit 1105. The parsing process converts the structured configuration data into a parameter format recognizable by the system. The verification process includes legality verification and rationality verification.
[0116] Validity check: Check whether the configuration format conforms to the specifications, such as whether the IP address is valid, whether the port range is within the valid range, and whether the required parameters are complete.
[0117] Reasonableness verification: Verify whether the configuration logic matches the business rules, such as whether the bandwidth parameters bound to the Elastic Public Network are within the preset range, and whether the VPC subnet is compatible with the security group rules, etc.
[0118] S804, the configuration control unit 1103 performs a global configuration parameter update. After the parsed and verified configuration is confirmed to be valid, the configuration control unit 1103 executes the global configuration parameter update operation.
[0119] Figure 9 The illustration shows a schematic diagram of a cloud database primary / backup switching process according to an embodiment of the present application for a database VPC network access method.
[0120] like Figure 9 As shown, the steps include:
[0121] S901, the cluster control unit 1104 initializes its monitoring of cloud database master-slave failover events. The cluster control unit 1104 initializes its monitoring of cloud database master-slave failover events by connecting to the cloud database cluster's status management interface to capture real-time signals of role changes in the cloud database master and slave nodes. During initialization, the cluster control unit 1104 records the current identification information of the cloud database master and slave, such as node ID and network address, sets event triggering threshold conditions, such as the master database failure duration exceeding a set value or the failover being triggered after the slave database completes data synchronization, and configures a local cache for temporary storage of cloud database master-slave status information.
[0122] S902, the cluster control unit 1104 captures and verifies the cloud database master-slave switchover event. When a master-slave switchover occurs in the cloud database, the cluster control unit 1104 captures the change event in real time and verifies the event, including confirming the authenticity of the switchover event, checking whether the new master database has completed data synchronization, and verifying the running status of the new master database. If the verification is successful, the cloud database master-slave switchover event is deemed valid, and the subsequent processing flow begins.
[0123] S903, the cluster control unit 1104 obtains the connection information of the new primary cloud database. After confirming the validity of the primary / standby switchover event, the cluster control unit 1104 extracts the core connection information of the new primary cloud database through the metadata interface of the cloud database cluster, including the network address, service port, and node status identifier of the new primary cloud database.
[0124] S904, the cluster control unit 1104 updates the forwarding configuration of the connection proxy component 1102. Based on the connection information of the new primary database of the cloud database, the cluster control unit 1104 generates a new forwarding configuration for the connection proxy component 1102 and replaces the original forwarding rules. The target address of the VPC network requests received by the connection proxy component 1102 is changed from the old primary database of the cloud database to the new primary database. The configuration update includes address, port parameters, network adaptation parameters, etc.
[0125] S905, the configuration hot update unit 1111 performs a hot update on the configuration of the connection proxy component 1102. After receiving the generated new forwarding configuration, the configuration hot update unit 1111 writes the new forwarding configuration to the temporary configuration file 1117 and terminates the process of the proxy service unit 1108 to trigger the startup unit 1113. The startup unit 1113 verifies the legality of the configuration in the temporary configuration file 1117. After the verification is successful, the configuration content in the temporary configuration file 1117 is synchronized to the main configuration file 1115, and the temporary configuration file 1117 is cleared. The proxy service unit 1108 is restarted to load the new forwarding configuration, realizing the forwarding switch from the old primary database to the new primary database.
[0126] S906, the cluster control unit 1104 verifies the new forwarding configuration of the connection agent component 1102. The cluster control unit 1104 verifies whether the connection agent component 1102 has successfully loaded the new forwarding configuration and normally forwards VPC network requests to the new primary cloud database. The verification methods include sending simulated query requests to check whether the correct response can be received from the new primary cloud database, continuously monitoring the forwarding success rate over a certain period of time, and testing connection stability.
[0127] S907, Cluster Control Unit 1104 updates the annotation information of custom resources in the cloud database. After verifying the validity of the new forwarding configuration, Cluster Control Unit 1104 updates the annotation information of custom resources in the cloud database. The updated content includes the connection information of the new primary cloud database, the completion time of the primary / standby switchover, and the forwarding status of the current proxy component.
[0128] Figure 10 The illustration shows a schematic diagram of the VPC network address change processing flow of a database VPC network access method according to an embodiment of this application.
[0129] like Figure 10 As shown, the steps include:
[0130] S1001, Cluster Control Unit 1104 initializes listening for VPC network address change events. Cluster Control Unit 1104 initializes listening for VPC network address change events, and monitors the VPC network address status of Connection Agent Component 1102 in real time, including whether the address has been reassigned, whether the change is due to subnetting or fault recovery, etc.
[0131] S1002, the dynamic monitoring subunit 1107 captures and verifies VPC network address change events. When a VPC network address changes, the dynamic monitoring subunit 1107 captures the event in real time and verifies it, including confirming the authenticity of the address change, checking the legality of the new address, and confirming that the address change belongs to the instance that needs to be processed.
[0132] S1003, Cluster Control Unit 1104 updates the VPC address in the annotation information of the custom cloud database resource. After the VPC network address change takes effect, Cluster Control Unit 1104 updates the annotation information in the custom cloud database resource.
[0133] S1004, Cluster Control Unit 1104 performs domain name resolution or Elastic Public Network Service (ESP) unbinding. Cluster Control Unit 1104 will disconnect the original address from domain name resolution and ESP.
[0134] S1005, the cluster control unit 1104 rebinds the VPC address, domain name, and elastic public network based on the configuration of the control configuration storage unit 1105. After unbinding, the cluster control unit 1104 reads the preset binding rules in the control configuration storage unit 1105, and rebinds the domain name resolution and elastic public network service for the new VPC network address, re-establishes the mapping relationship between the new VPC network address and the original domain name, and allocates elastic public network resources according to the configuration.
[0135] S1006, the cluster control unit 1104 verifies the validity of the rebound VPC address, domain name, and elastic public network. The cluster control unit 1104 verifies the newly established binding association. For the VPC network address, it checks whether it can normally receive requests from the VPC network; for domain name resolution, it monitors whether the domain name can correctly point to the new address and whether the resolution latency is within a preset reasonable range; for the elastic public network, it verifies whether the public network ingress can forward traffic to the new VPC network address and whether the network performance meets the preset configuration requirements.
[0136] S1007, the cluster control unit 1104 updates and confirms the service information and status in the annotations of the custom resources of the cloud database. The cluster control unit 1104 updates the service information in the annotations of the custom resources of the cloud database, writes the rebound domain name and elastic public network entry address into the annotation, and checks the integrity of the annotation information.
[0137] Figure 11 The diagram illustrates the overall architecture of a database VPC network access device according to an embodiment of this application.
[0138] like Figure 11 As shown, it includes a network access control component 1101 and a connection proxy component 1102.
[0139] The network access control component 1101 is configured to continuously monitor the custom resources of the cloud database instance, read annotation information, determine whether the cloud database instance is connected to the VPC network, and configure specific parameter information such as subnet and security group required for VPC network access. Based on the annotation information, it deploys the connection proxy component 1102. The network access control component 1101 responds in real-time to changes in global configuration, such as adjustments to domain name resolution rules or elastic public network parameters, and performs hot updates to the new configuration. Simultaneously, the network access control component 1101 continuously monitors and processes the status of VPC network address allocation, cloud database primary / standby failover, and configuration updates to ensure a stable and reliable VPC network access process.
[0140] The connection proxy component 1102 is configured to handle VPC network data forwarding, and at least two are deployed, with a first network interface card (NIC) 1109 and a second NIC 1110. The first NIC 1109 is configured to access the VPC network and receive access requests from external sources; the second NIC 1110 is configured to access the internal network of the cloud database, forwarding external access requests from the VPC network to the cloud database master database and sending the master database's response back to the external network, thus achieving network isolation between tenants through network policies. When the configuration of the connection proxy component 1102 is updated, the hot update unit first writes the new configuration to the temporary configuration file 1117 and verifies it, then restarts the process of the proxy service unit 1108 to achieve real-time hot loading of the new configuration.
[0141] Figure 12 The diagram illustrates the structure of a network access control component of a database VPC network access device according to an embodiment of this application.
[0142] like Figure 12 As shown, it includes a configuration control unit 1103, a cluster control unit 1104, a control configuration storage unit 1105, and a connection configuration storage unit 1106, wherein the cluster control unit 1104 includes a dynamic monitoring subunit 1107.
[0143] The configuration control unit 1103 is configured to continuously monitor change events of the control configuration storage unit 1105, including VPC subnet rules, domain name resolution policies, and elastic public network parameters. After the configuration control unit 1103 obtains a change event, it parses the new configuration and verifies its legality, such as checking whether the parameter format is correct and whether there are any logical conflicts. For new configurations that pass verification, they are synchronized to the global parameter pool.
[0144] The cluster control unit 1104 is configured to manage VPC network access. Based on events captured by the dynamic monitoring subunit 1107 and combined with parameters such as subnet and security group in the cloud database's custom resource annotation information, it determines whether the cloud database instance is connected to the VPC network, and then decides whether to deploy, update, or uninstall the connection agent component 1102. In the lifecycle management of the connection agent component 1102, the cluster control unit 1104 generates relevant configurations for the connection agent component 1102 based on the cloud database master database information and monitors the running status of the connection agent component 1102. When a master-slave switch occurs in the cloud database, it updates the forwarding rules and handles tasks such as VPC network address changes, domain name or elastic public network binding.
[0145] The control configuration storage unit 1105 is configured as a subordinate network access control component 1101, storing the global parameters required for the operation of the cluster control unit 1104, including VPC network adaptation rules, domain name resolution policies, elastic public network binding parameters, etc., as objects for the configuration control unit 1103 to monitor update events. After capturing its change events, the configuration control unit 1103 parses and verifies the legality of the configuration. After the verification is passed, it is synchronized to the global parameter pool. At the same time, it provides parameter support for the cluster control unit 1104 to determine the cloud database instance VPC network access requirements, make decisions on the deployment and update of the connection agent component 1102, and handle tasks such as VPC network address changes, domain names or elastic public network binding.
[0146] The connection configuration storage unit 1106 is subordinate to the network access control component 1101. It is generated by the cluster control unit 1104 based on the connection information of the cloud database master database, stores the connection configuration of the connection proxy component 1102, and serves as the configuration source for the connection proxy component 1102 to load the configuration.
[0147] The dynamic monitoring sub-unit 1107 is configured to scan the full lifecycle events of custom resources in the cloud database and the status events of the connection agent component 1102 in real time, and filter and verify the acquired events, including the resource status associated with the event and the tag matching degree, and only send valid events that meet the processing conditions to the cluster control unit 1104.
[0148] Figure 13 The diagram illustrates a connection proxy component structure of a database VPC network access device according to an embodiment of this application.
[0149] like Figure 13 As shown, the system includes a proxy service unit 1108, a first network card 1109, a second network card 1110, a configuration hot update unit 1111, a configuration unit 1112, a startup unit 1113, and a compilation unit 1114.
[0150] The proxy service unit 1108 achieves bidirectional communication through the first network interface card 1109 and the second network interface card 1110. The first network interface card 1109 connects to the VPC network and receives external requests from cloud hosts and elastic public networks, such as database queries and connection establishment. The second network interface card 1110 connects to the internal network of the cloud database, accurately forwards the parsed requests to the current cloud database master database, and sends the response from the cloud database master database back to the outside.
[0151] The configuration hot update unit 1111 is configured to monitor configuration changes and trigger configuration hot updates. It listens in real time for update events connected to the configuration storage unit 1106, such as changes in the cloud database master address or adjustments to forwarding rules. Upon receiving a change event, it writes the new configuration to the temporary configuration file 1117 of the configuration unit 1112, terminates the process of the proxy service unit 1108, and triggers the startup unit 1113. After the startup unit 1113 is triggered, it verifies the validity of the temporary configuration file 1117. If the verification passes, it synchronizes the configuration content in the temporary configuration file 1117 to the main configuration file 1115 in the configuration unit 1112, clears the temporary configuration file 1117 to avoid duplicate loading, and finally restarts the process of the proxy service unit 1108 to load the latest configuration in the main configuration file 1115, completing the hot update.
[0152] Configuration unit 1112 includes a main configuration file 1115, a mounted configuration file 1116, and a temporary configuration file 1117. The main configuration file 1115 is the valid configuration source actually loaded by the proxy service unit 1108, storing currently used forwarding rules, network interface card parameters, etc. The mounted configuration file 1116 is used for initialization when the connection proxy component 1102 starts for the first time, synchronizing the initial configuration from the connection configuration storage unit 1106 as the basic parameters for the initial startup of the connection proxy component 1102. The temporary configuration file 1117 is configured to receive the latest configuration transmitted by the configuration hot update unit 1111. Its validity is first verified by the startup unit 1113, such as whether the format is correct and whether the parameters conflict. After successful verification, the configuration is synchronized to the main configuration file 1115 to prevent incorrect configurations from taking effect directly.
[0153] Startup unit 1113 is configured to perform configuration verification, service startup, and exception recovery. When connection proxy component 1102 starts for the first time, startup unit 1113 reads the initial configuration from the mounted configuration file 1116, writes it to the main configuration file 1115 after successful verification, and then starts the proxy service unit 1108 based on the configuration information in the main configuration file 1115. When the configuration of connection proxy component 1102 is updated, startup unit 1113 responds to the termination of the proxy service unit 1108 process by verifying the validity of the temporary configuration file 1117. If it passes, it synchronizes the configuration content in the temporary configuration file 1117 to the main configuration file 1115, clears the temporary configuration file 1117, restarts the proxy service unit 1108, and loads the configuration information from the main configuration file 1115.
[0154] The compilation unit 1114 completes the deployment preparation work of the agent service unit 1108 through automated scripts, including creating necessary directories, setting file permissions, installing network protocol libraries, encryption modules and other dependencies, and automatically compiling the executable program of the agent service based on the preset service version and functional requirements. After the compilation is completed, the corresponding executable program and configuration template are packaged.
[0155] Figure 14 An exemplary block diagram of a computer program product of a database VPC network access method according to an embodiment of this application is shown schematically.
[0156] like Figure 14 As shown, the computer program product stores a computer program 1401, which, when executed by a processor, implements the method provided in any embodiment of this application.
[0157] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.
[0158] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0159] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0160] It should also be noted that in the system and method of this application, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of this application.
[0161] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this application is not limited to the specific aspects of the processes, machines, manufacturing, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufacturing, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described above can be utilized. Therefore, the appended claims include such processes, machines, manufacturing, events, means, methods, or actions within their scope.
[0162] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0163] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A database VPC network access method, characterized in that, Includes the following steps: A network access control component is deployed through a container orchestration platform, the network access control component including a configuration control unit and a cluster control unit; The cluster control unit determines whether a cloud database instance is accessing the VPC network based on the annotation information of the cloud database's custom resources. When a cloud database instance connects to a VPC network, the cluster control unit generates a connection configuration storage unit corresponding to the connection proxy component based on the connection information of the cloud database master and the VPC network parameters, and deploys the connection proxy component. The connection configuration storage unit stores all the configuration parameters required for the connection proxy component to run. The connection proxy component receives VPC network requests through a first network interface card (NIC) and forwards the VPC network requests to the cloud database instance through a second NIC. The cluster control unit monitors changes in the VPC network address of the connection agent component, dynamically updates the annotation information of custom resources in the cloud database, and binds domain name resolution or elastic public network services. The configuration control unit detects update events of the control configuration storage unit. When the global parameters in the control configuration storage unit are updated, the updated global parameters are synchronized to the operating environment of the cluster control unit.
2. The method according to claim 1, characterized in that, The annotation information of the cloud database custom resources includes at least one of the following: user identifier, VPC subnet parameters, security group rules, and network type identifier; The cluster control unit verifies whether the annotation information of the custom resource of the cloud database matches the preset access rules to determine whether to access the VPC network for the cloud database instance.
3. The method according to claim 1, characterized in that, The cluster control unit generates the connection configuration storage unit corresponding to the connection proxy component based on the master database connection information of the cloud database, including: The cluster control unit queries the network address and service port of the master database of the cloud database that is in normal operation. The cluster control unit constructs a configuration template for the connection proxy component based on the network address and the service port, generates a connection configuration storage unit corresponding to the connection proxy component, and configures the connection configuration storage unit to load the configuration of the connection proxy component and initialize the parameters.
4. The method according to claim 1, characterized in that, The connection proxy component includes a configuration hot update unit, a configuration unit, a startup unit, and a proxy service unit. The connection proxy component triggers a configuration hot update for the proxy service unit, including: After the configuration hot update unit detects that the configuration of the connection configuration storage unit has been updated, it writes the latest configuration into the temporary configuration file of the configuration unit. The process of the proxy service unit is terminated to trigger the startup unit. The startup unit verifies the validity of the temporary configuration file. If the verification is successful, the contents of the temporary configuration file are synchronized to the main configuration file of the configuration unit and the temporary configuration file is cleared. Then the proxy service unit is restarted to complete the configuration hot update.
5. The method according to claim 4, characterized in that, When the proxy service unit is started for the first time, the startup unit obtains the initial configuration through the mounting configuration file of the configuration unit, writes it into the main configuration file of the configuration unit after verifying its legality, and starts the proxy service unit.
6. The method according to claim 1, characterized in that, The cluster control unit monitors the master-slave switchover event of the cloud database in real time. When a master-slave switchover of the cloud database is detected, the forwarding configuration of the connection proxy component is updated in real time so that the connection request is directed to the new master database of the cloud database.
7. The method according to claim 1, characterized in that, When the cluster control unit detects a change in the VPC network address, it updates the annotation information of the VPC network address in the cloud database custom resource, rebinds the domain name resolution or elastic public network service, and writes the updated domain name or elastic public network information into the annotation of the cloud database custom resource.
8. The method according to claim 1, characterized in that, The cluster control unit includes a dynamic monitoring subunit, which acquires creation, update and deletion events of custom resources in the cloud database in real time, performs at least one operation on the events, including status verification, annotation comparison and tag matching, and triggers the VPC network access or unloading process when the event meets the queuing conditions.
9. The method according to claim 1, characterized in that, The configuration control unit monitors and acquires update events of the control configuration storage unit in real time, and dynamically updates the global configuration parameters.
10. A database VPC network access device, characterized in that, This includes network access control components and connection proxy components; The network access control component includes a configuration control unit and a cluster control unit; wherein... The configuration control unit is configured to monitor update events of the control configuration storage unit. When the global parameters in the control configuration storage unit are updated, the updated global parameters are synchronized to the runtime environment of the cluster control unit. The control configuration storage unit belongs to the network access control component. The cluster control unit is configured to monitor annotation information of cloud database custom resources, determine whether to access the VPC network based on the annotation information, deploy at least two connection proxy components when accessing the VPC network, generate connection configuration storage units corresponding to the connection proxy components based on the connection information of the cloud database master database and VPC network parameters, and monitor VPC network address events and update the annotations of cloud database custom resources. The connection configuration storage unit stores all configuration parameters required for the operation of the connection proxy components. The connection proxy component includes a proxy service unit, a configuration hot update unit, a compilation unit, a startup unit, and a configuration unit; wherein... The configuration hot update unit is configured to monitor update events of the connection configuration storage unit and trigger a configuration hot update of the proxy service unit; the compilation unit includes a compilation script configured to automatically compile and package the proxy service unit; the startup unit includes a startup script configured to perform at least one of configuration verification, loading, and service startup on the configuration unit; the configuration unit includes a main configuration file, a mount configuration file, and a temporary configuration file, wherein the main configuration file is configured to store valid configuration, the mount configuration file is configured to initialize configuration, and the temporary configuration file is configured to verify and update configuration.
11. The apparatus according to claim 10, characterized in that, The cluster control unit includes a dynamic monitoring subunit, which monitors the custom resource events of the cloud database and the resource events of the connection proxy component, respectively. Based on the status check results of the events, it performs at least one of the following operations: creation, update, and deletion of the connection proxy component.
12. The apparatus according to claim 10, characterized in that, The connection proxy component is also configured with a first network interface card (NIC) and a second NIC; The proxy service unit receives VPC network requests through the first network interface card (NIC); the proxy service unit forwards the VPC network requests to the cloud database instance through the second NIC.
13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method of any one of claims 1-9.
14. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Network segmentation for container orchestration platform
CN117687773A
Cloud system based on public cloud service, message processing method and related device
CN119052233A