A method and system for realizing access cut-off of Xingcheng environment application
By dynamically updating service connections between primary and backup clusters and using LVM storage and DRBD technology to synchronize data, combined with DTS service, efficient and highly available data synchronization and switching of cloud-native applications across multiple data center clusters is achieved, solving the high availability problem across data center clusters.
Patent Information
- Application Number
- CN202410305458.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2026-01-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing technologies, cloud-native applications face challenges in achieving high availability switching and rollback across multiple data center clusters, especially in the event of a failure, where they cannot quickly switch over and synchronize data.
By using the ingress service to connect to the database between the primary and backup clusters and dynamically updating the service pointer when a failure occurs, data synchronization and primary/backup failover are achieved by combining LVM storage and DRBD technology. The DTS service is used to automatically synchronize the database, achieving high-availability failover and rollback without restarting.
It enables efficient data synchronization and rapid switching of cloud-native applications between primary and backup clusters, ensuring business continuity and solving the high availability problem across data center clusters.
Smart Images

Figure CN118250290B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of cloud native technology, and in particular to a method and system for realizing access switching of an application in a trust creation environment. BACKGROUND
[0002] Application high availability has always been the goal pursued by various core businesses. In practice, multiple sets of business systems are usually deployed based on two or more physically separated data centers. The two or more data centers are connected through BGP or a dedicated line to ensure data transmission efficiency and latency.
[0003] As for each data center, the application developed and deployed through the industry-leading cloud native technology can provide a certain degree of single-cluster high availability capability. However, there are problems in switching and back switching of cloud native applications across multiple data center clusters to realize high availability. SUMMARY
[0004] The purpose of the application is to provide a method and system for realizing access switching of an application in a trust creation environment to solve the problems in the background technology.
[0005] To achieve the above purpose, the application provides the following technical solution: a method for realizing access switching of an application in a trust creation environment, the method comprising the following steps:
[0006] When switching access, the application on the master and backup clusters connects the database through the ingress service. The backup cluster application normally accesses the master cluster database. When a fault occurs, the original service of the backup cluster is deleted, and a service pointing to the backup cluster itself is created. The backup cluster application can access the cluster database without restarting;
[0007] When switching back access, the original service of the backup cluster is deleted, a service and an endpoint pointing to the master cluster are created, and the backup cluster application can access the master cluster database without restarting.
[0008] Preferably, the lvm storage is used to realize automatic management and synchronization of k8s volume data disks and master-backup switching of drbd. First, the business application uses the lvm storage class to apply and create a local lvm storage to store business data.
[0009] Preferably, in the high-availability service, the minio and es work load resources are selected, the data synchronization strategy is configured, and the drbd synchronization mode is selected.
[0010] Based on the work load resources in the synchronization strategy and the nodes, pvc\pv data, the corresponding resources are assembled and created in the high-availability service. The components will create and take over the lvm pv data disk and automatically start data synchronization.
[0011] In the high-availability service, for the workload of minio, es using drbd to synchronize data, the corresponding master-slave switching strategy is configured, and when switching needs to be performed, the high-availability service directly operates the is_primary flag defined in the corresponding drbd cd resource in the cluster based on the configured strategy, to trigger the drbd cd to update the master-slave switching action.
[0012] Preferably, after the user deploys the business database in the master cluster, the user synchronously distributes the business database to the standby cluster through the high-availability service.
[0013] Based on the database workload information that has been distributed, the user creates a synchronization task from the master to the standby in the console of the control cluster, and starts it; then creates a synchronization task from the standby to the master, and keeps the task in a suspended state.
[0014] The user adds a synchronization strategy in the data synchronization configuration interface of the high-availability service, selects the business database workload, and associates the two DTS synchronization tasks just created.
[0015] The user configures the switching strategy in the disaster recovery strategy configuration interface of the high-availability service, and confirms that the business database workload has been associated.
[0016] When the user performs disaster recovery switching, the high-availability service automatically performs a start or suspend action on the corresponding DTS data synchronization task through the DTS service interface based on the configured strategy and the master-slave switching direction, to complete the synchronization direction switching.
[0017] An access switching system for an application in a signal creation environment, the system comprising a business storage module, a data synchronization strategy configuration module, and a distribution module.
[0018] When switching, the applications on the master and standby clusters connect to the database through the ingress service; the standby cluster applications normally access the master cluster database; when a fault occurs, the original service of the standby cluster is deleted, and a service pointing to the standby cluster itself is created; the standby cluster applications can access the cluster database without restarting.
[0019] When switching back, the original service of the standby cluster is deleted, and a service and an endpoint pointing to the master cluster are created; the standby cluster applications can access the master cluster data without restarting.
[0020] Preferably, the business storage module automatically manages and synchronizes the k8s volume data disk and the master-slave switching based on the lvm storage, and first, the business application uses the lvm storage class to apply and create a local lvm storage to store business data.
[0021] Preferably, the data synchronization strategy configuration module, in the high-availability service, selects minio, es workload resources, configures data synchronization strategies, and selects drbd synchronization mode.
[0022] In the high-availability service, based on the workload resources in the synchronization strategy and the nodes, pvc\pv data, corresponding resources are assembled and created, and the component will create and take over the lvm pv data disk, and automatically start data synchronization.
[0023] In the high-availability service, for minio, es workload using drbd to synchronize data, configure the corresponding master-slave switching strategy, when switching is needed, the high-availability service directly operates the is_primary flag defined in the corresponding drbd cd resource in the cluster based on the configured strategy, triggers the drbd cd to update the master-slave switching action.
[0024] Preferably, the distribution module, after the user deploys a business database in the master cluster; the user synchronizes the business database to the standby cluster through the high-availability service;
[0025] The user creates a synchronization task from the master to the standby in the console of the control cluster based on the database workload information that has been distributed, and starts it; then creates a synchronization task from the standby to the master, and keeps the task in a suspended state;
[0026] The user adds a synchronization strategy in the high-availability service data synchronization configuration interface, selects a business database workload, and associates the two DTS synchronization tasks just created;
[0027] The user configures the switching strategy in the high-availability service disaster recovery strategy configuration interface, and confirms that the business database workload has been associated;
[0028] When the user performs disaster recovery switching, the high-availability service automatically performs start or suspend actions on the corresponding DTS data synchronization task through the DTS service interface based on the configured strategy and the master-slave switching direction, and completes the synchronization direction switching.
[0029] Compared with the prior art, the present application has the following advantages:
[0030] The method and system for realizing access switching of the signal creation environment application provided by the present application realize the automatic and efficient synchronization of the workload of the distributed application developed in the cloud native mode and the data of the stateful application, and conveniently perform switching drills between the master and standby clusters in peacetime, and when a fault actually occurs, the distributed application can be quickly switched between clusters to realize high availability, effectively solving the problem of realizing high availability of cloud native applications across multiple data center clusters. BRIEF DESCRIPTION OF DRAWINGS
[0031] Fig. 1Architecture diagram for the present application;
[0032] Fig. 2 Method flow diagram for the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution of the present application clear, complete description, and the advantages are more clear and obvious, the following will be further described in detail with the help of the accompanying drawings. It should be understood that the specific embodiments described here are part of the embodiments of the present application, not all embodiments, and are only used to explain the embodiments of the present application, and are not used to limit the embodiments of the present application. All other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0034] Embodiment one
[0035] Please refer to Figs. 1-2 The present application provides a technical solution: a method for realizing access flow switching of Xingcheng environment application, the method comprising the following steps:.
[0036] 1. Ideally, when a fault occurs, the primary and backup switching should be automatic at the first time, which requires a global load balancing, global server load balancer (GSLB), on the two clusters. There are many implementations based on software and hardware for global load balancing, which are not expanded in this method.
[0037] 2. Generally speaking, the deployment architecture and deployment content of the two clusters are consistent, and only the database role is different from the configuration of the two clusters.
[0038] 3. If the business has the shortest switching time target, the deployment method can adopt application dual-live, and the data is switched through DTS; for minio, elasticsearch, image warehouse and other data synchronization methods that do not support DTS, DRBD can be used, nfs can be combined with DRBD, and lvm can be combined with DRBD.
[0039] DRBD part:
[0040] The method is based on lvm storage to realize automatic management and synchronization of k8s volume data disk and primary and backup switching of drbd. First, the business application uses lvm storage class to apply and create local lvm storage to store business data.
[0041] In the high-availability service, select minio, es and other work load resources, configure data synchronization strategy, and select drbd synchronization method.
[0042] High-availability service internally assembles and creates corresponding resources based on workload resources in synchronization strategy and data such as node, pvc\pv, etc. The component will create and take over the lvm pv data disk and automatically start data synchronization.
[0043] In high-availability service, for minio, es and other workloads that use drbd to synchronize data, configure the corresponding master-slave switching strategy. When switching is needed, the high-availability service directly operates the is_primary label defined in the corresponding drbd cd resource in the cluster based on the configured strategy (master-slave switching direction) to trigger drbd cd to update the master-slave switching action.
[0044] DTS part:
[0045] The user deploys a business database in the master cluster;
[0046] The user synchronizes the business database to the standby cluster through the high-availability service;
[0047] The user creates a master-to-standby synchronization task based on the database workload information (user login information, access address, port number, etc.) that has been distributed and starts it in the control cluster console. Then create a standby-to-master synchronization task and keep the task in a suspended state;
[0048] The user adds a synchronization strategy in the high-availability service data synchronization configuration interface, selects the business database workload, and associates the two DTS synchronization tasks just created;
[0049] The user configures the switching strategy in the high-availability service disaster recovery strategy configuration interface and confirms that the business database workload has been associated;
[0050] When the user performs disaster recovery switching, the high-availability service automatically starts or suspends the corresponding DTS data synchronization task based on the configured strategy and master-slave switching direction through the DTS service interface to complete the synchronization direction switching;
[0051] 4. Under normal circumstances, applications on the master cluster and the standby cluster can provide business access; when a fault occurs, all traffic of the fault cluster is switched to the standby cluster;
[0052] 5. Under normal circumstances, the standby cluster accesses the master cluster database; when a fault occurs, the standby cluster application changes to access the local database;
[0053] 6. Both the master and standby clusters need to deploy Nginx Ingress controller, but the Ingress service of the master and standby clusters is different;
[0054] 7. Develop database access proxy Ingress suitable for high-availability deployment mode according to the following method.
[0055] For the dual-active scene, it can be further divided into two cases: the application connection database is in the cluster and the master-slave cluster outside (third-party self-built). The default database IP and port has been configured, and the inter-cluster access capability is provided.
[0056] 8. The Ingress service can be newly created one or more, and needs to be selected in combination with environmental resources. If all databases are proxied by one Ingress nginx, the corresponding Ingress resource limit needs to be adjusted according to the number of databases and the database access level; if one database is proxied by one Ingress, the configuration of the database access level of the proxy can be configured.
[0057] 9. Various applications accessing databases, the host in the connection information is configured as Ingress service name, such as host=ingress.xxxx.svc.cluster.local.
[0058] 10. New service (Ingress) is created in the master cluster, and nodeport type is exposed. Taking the example of proxying all databases by one Ingress service, all databases under this project are exposed in the configuration, and the original database deployment service remains unchanged. The example is as follows:
[0059]
[0060]
[0061] 11. Two sets of Ingress controller service and endpoint yamls are prepared in the standby cluster, the two sets of services have the same name, one pointing to the master cluster and the other pointing to the standby cluster itself. The service pointing to the standby cluster itself is similar to the service of the master cluster, and the type is ClusterIP; the service pointing to the master cluster is configured to point to the service with the same name in the standby cluster itself, but the selector part is not required, and the corresponding endpoints resource is also created by yaml, and the address and port are configured as the database information of the master cluster. One of the key information is clusterIP, once determined, the clusterIP in the yaml should not be changed. The standby cluster service (Ingress) and endpoint pointing to the master cluster;
[0062] 12. It should be noted that the service (Ingress controller) needs to be deleted and reconstructed / modified, and the cluster ip needs to be ensured unchanged, and the client may have cached the ip, i.e. the creation and modification of the above-mentioned resource are managed by the control plane.
[0063] 13. The switching step is:
[0064] The application on the master and standby clusters connects the database through the service of ingress;
[0065] The standby cluster application normally accesses the master cluster database;
[0066] When a fault occurs, the original service of the standby cluster (pointing to the master cluster) is deleted, and a service pointing to the standby cluster itself is created (pointing to the standby cluster);
[0067] The standby cluster application can access the cluster database without restarting;
[0068] 14. The back switching step is:
[0069] The original service of the standby cluster (pointing to the standby cluster) is deleted;
[0070] The service (pointing to the master cluster) and the endpoint pointing to the master cluster are created;
[0071] The standby cluster application can access the master cluster database without restarting;
[0072] 15. For non-core business or stateless service applications, no changes to the database are involved during switching and back switching, so there is no need to configure as described above.
[0073] Embodiment Two
[0074] On the basis of embodiment one, an implementation of a signal creation environment application access switching system is proposed, which is composed of a business storage module, a data synchronization strategy configuration module, and a distribution module;
[0075] During access switching, the application on the master and standby clusters connects the database through the service of ingress; the standby cluster application normally accesses the master cluster database; when a fault occurs, the original service of the standby cluster is deleted, and a service pointing to the standby cluster itself is created; the standby cluster application can access the cluster database without restarting;
[0076] During access back switching, the original service of the standby cluster is deleted; the service and the endpoint pointing to the master cluster are created; the standby cluster application can access the master cluster data without restarting.
[0077] The business storage module implements automatic management and synchronization of K8S volume data disks and master-slave switching of DRBD based on LVM storage.
[0078] The data synchronization strategy configuration module selects minio and es workloads in the high-availability service, configures a data synchronization strategy, and selects a DRBD synchronization mode.
[0079] Based on the workloads in the synchronization strategy and the nodes, PVCs and PVs, the high-availability service assembles and creates corresponding resources, the components create and take over the LVM PV data disks, and automatically start data synchronization.
[0080] In the high-availability service, for minio and es workloads that use DRBD to synchronize data, the corresponding master-slave switching strategy is configured, and when switching is needed, the high-availability service directly updates the is_primary flag defined in the corresponding DRBD CD resource in the cluster based on the configured strategy, triggering the DRBD CD to complete the master-slave switching action.
[0081] The distribution module synchronizes the business database from the master cluster to the standby cluster through the high-availability service after the user deploys the business database in the master cluster.
[0082] The user creates a synchronization task from the master to the standby in the control console of the control cluster based on the database workload information that has been distributed, and starts it, and then creates a synchronization task from the standby to the master and keeps the task in a suspended state.
[0083] The user adds a synchronization strategy in the data synchronization configuration interface of the high-availability service, selects the business database workload, and associates the two DTS synchronization tasks just created.
[0084] The user configures the switching strategy in the disaster recovery strategy configuration interface of the high-availability service and confirms that the business database workload has been associated.
[0085] When the user performs disaster recovery switching, the high-availability service automatically starts or suspends the corresponding DTS data synchronization task through the DTS service interface based on the configured strategy and the master-slave switching direction, completing the synchronization direction switching.
[0086] Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the application, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for implementing application access flow switching in a domestically developed information technology environment, characterized in that: The method includes the following steps: During access switching, applications on the primary and backup clusters connect to the database through the ingress service; applications on the backup cluster can access the primary cluster database normally; when a failure occurs, the original service on the backup cluster is deleted, and a service pointing to the backup cluster is created. The service pointing to the backup cluster is a YAML file pointing to the backup cluster; applications on the backup cluster can access the cluster database without restarting. During access rollback, the original service in the backup cluster is deleted; a service and endpoint pointing to the primary cluster are created, where the service pointing to the primary cluster is a YAML file pointing to the primary cluster. The backup cluster application can access the primary cluster database without restarting. In the event of a failure, deleting the original service in the backup cluster means deleting the YAML file pointing to the primary cluster, and during access rollback, deleting the original service in the backup cluster means deleting the YAML file pointing to the backup cluster.
2. A system for implementing the method of application access switching in a domestically developed information technology (IT) environment according to claim 1, characterized in that: The system consists of a business storage module, a data synchronization strategy configuration module, and a distribution module. During access switching, applications on the primary and backup clusters connect to the database through the ingress service; applications on the backup cluster can access the primary cluster database normally; when a failure occurs, the original service on the backup cluster is deleted, and a service pointing to the backup cluster is created. The service pointing to the backup cluster is a YAML file pointing to the backup cluster; applications on the backup cluster can access the cluster database without restarting. During access rollback, the original service in the backup cluster is deleted, and a service and endpoint pointing to the primary cluster are created. The service pointing to the primary cluster is a YAML file pointing to the primary cluster. The backup cluster application can access the primary cluster database without restarting. In the event of a failure, deleting the original service in the backup cluster means deleting the YAML file pointing to the primary cluster. During access rollback, deleting the original service in the backup cluster means deleting the YAML file pointing to the backup cluster.
3. The system for implementing application access switching in a domestically developed information technology environment according to claim 2, characterized in that: The business storage module, based on LVM storage, implements automatic DRBD management and synchronization of Kubernetes volume data disks and master-slave failover. First, the business application uses the LVM storage class to apply for and create local LVM storage to store business data.
4. A system for implementing application access switching in a domestically developed information technology environment according to claim 2, characterized in that: In the data synchronization strategy configuration module, under the high availability service, select the minio and es workload resources, configure the data synchronization strategy, and select the drbd synchronization method; The high availability service internally assembles and creates corresponding resources based on the workload resources in the synchronization strategy, the node they reside on, and the PVC / PV data. The component will create and take over the LVM / PV data disk and automatically start data synchronization. In high-availability services, for workloads that use DRBD to synchronize data for minio and es, corresponding primary / standby failover strategies are configured. When a failover is required, the high-availability service directly updates the is_primary flag defined in the corresponding DRBDCD resource in the cluster based on the configured strategy, triggering the DRBD CD update to complete the primary / standby failover action.
5. A system for implementing application access switching in a domestically developed information technology environment according to claim 2, characterized in that: The distribution module allows users to deploy their business database on the primary cluster and then synchronously distribute it to the backup cluster via a high-availability service. Based on the distributed database workload information, users can create and start a synchronization task from primary to backup in the control cluster console; then create a synchronization task from backup to primary and keep the task paused. In the high availability service data synchronization configuration interface, users can add synchronization strategies, select business database workloads, and associate the two DTS synchronization tasks that were just created. In the high availability service disaster recovery strategy configuration interface, users configure the switching strategy and confirm that the associated business database workload has been associated. When a user performs a disaster recovery switch, the high availability service automatically starts or pauses the corresponding DTS data synchronization task through the DTS service interface based on the configured policy and the primary / standby switch direction, thus completing the synchronization direction switch.
Citation Information
Patent Citations
Realization method and system for high-availability and high-performance database cluster
CN104679907A
Container monitoring alarm method, system and device based on multiple clusters and storage medium
CN112511339A