Hot deployment method based on distributed cluster

By adopting a hot deployment method in a distributed cluster, gradually transferring traffic and conducting health checks and performance tests, it solves the problem of traditional cluster maintenance requiring service interruption, improves the stability and reliability of the cluster, and reduces maintenance costs.

CN118713975APending Publication Date: 2024-09-27EAGLERISE MAGNETOELECTRIC TECH (JI AN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410849313.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The traditional cluster maintenance method requires interrupting services, causing serious impact on business operations. How to upgrade, maintain or replace cluster software or hardware without interrupting services is an urgent problem that needs to be solved.

Method used

Adopt a hot deployment method based on distributed clusters, plan the update scope, use automated tools to create and start new nodes, conduct health checks and performance tests, gradually transfer traffic, and shut down the old nodes after the new nodes are stable. If problems occur, trigger a return rolling mechanism to ensure service continuity and high availability.

Benefits of technology

It enables cluster upgrades and maintenance without interrupting services, improves system stability and reliability, reduces maintenance costs, and ensures service continuity and high availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713975A
    Figure CN118713975A
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a distributed cluster-based hot deployment method, which comprises the following steps of: planning an update range, determining nodes needing to be updated, and preparing a corresponding rollback mechanism; creating and starting a new node in the distributed cluster through an automatic tool, and using the updated configuration or application version; performing health check and performance test on the new node; gradually transferring traffic from an old node to a new node, and continuously monitoring performance indexes and health conditions of the new and old nodes; after the new node operates stably and can process all the traffic, closing the old node to complete the updating process; and if a problem occurs in the updating process or the operation period of the new node, triggering a rollback mechanism. According to the invention, on the premise of not interrupting the distributed cluster service, the software or hardware of the new node in the cluster is upgraded, maintained or replaced, so that the stability and reliability of the cluster system are greatly improved, and the maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a hot deployment method based on a distributed cluster. Background Art

[0002] With the rapid development of information technology, distributed cluster systems have become important infrastructure in the fields of big data processing, cloud computing, artificial intelligence, etc. However, traditional cluster maintenance methods often require service interruption, which will have a serious impact on business operations. Therefore, how to perform cluster maintenance without interrupting services is an urgent problem to be solved in the industry. Summary of the invention

[0003] The purpose of the present invention is to propose a hot deployment method based on a distributed cluster, so as to achieve software or hardware upgrade, maintenance or replacement of new nodes in the cluster without interrupting the distributed cluster service, thereby greatly improving the stability and reliability of the cluster system and reducing maintenance costs.

[0004] To achieve this object, the present invention adopts the following technical solutions:

[0005] A hot deployment method based on a distributed cluster includes the following steps:

[0006] S1. Plan the update scope, determine the nodes that need to be updated, and prepare the corresponding rollback mechanism;

[0007] S2. Create and start new nodes in the distributed cluster through automated tools, using updated configurations or application versions;

[0008] S3. Perform health checks and performance tests on new nodes to ensure that they can work normally and meet performance indicators.

[0009] S4, gradually transfer traffic from old nodes to new nodes, while continuously monitoring the performance indicators and health status of old and new nodes;

[0010] S5. After the new node runs stably and can handle all traffic, shut down the old node to complete the update process.

[0011] S6. If a problem occurs during the update process or during the operation of the new node, the rollback mechanism is triggered.

[0012] Preferably, in S1, the rollback mechanism includes:

[0013] S11. Stop sending traffic to the problematic new node and isolate the problematic node to prevent further impact on the cluster.

[0014] S12. Roll back the service deployment to the previous stable version using the previously saved deployment configuration or the history in the version control system;

[0015] S13. Verify that the node after rollback works normally and meets the performance indicators;

[0016] S14. Reroute traffic to the verified nodes and continue to monitor the cluster status.

[0017] Preferably, the rollback operation further includes:

[0018] S15. Before executing the rollback operation, back up the current cluster state in case of rollback failure.

[0019] S16. After the rollback is completed, summarize the rollback process and record the rollback reasons, rollback steps and results;

[0020] S17. During the rollback process, relevant personnel are automatically notified and the real-time progress and results of the rollback are provided.

[0021] Preferably, in S2, the creation and startup of the new node are automatically completed by a container orchestration tool, wherein the container orchestration tool includes but is not limited to Kubernetes, Docker Swarm and Apache Mesos.

[0022] Preferably, in S3, health checks and performance tests are performed on newly started nodes through an http api interface; the performance tests include concurrency tests and load tests.

[0023] Preferably, in S3, the health check and performance test are performed on the newly started node, and when the health check and performance test fail, the process returns to and re-executes step S2.

[0024] Preferably, in S4, the gradual transfer of traffic is achieved by dynamically adjusting load balancing strategies, service routing rules or using service mesh technology.

[0025] Preferably, in S6, the triggering rollback mechanism includes two modes: manual triggering and automatic triggering.

[0026] Preferably, the following steps are also included: S7. During the update process, log data is collected and analyzed in real time through monitoring tools to facilitate troubleshooting and performance optimization.

[0027] One of the above technical solutions has the following beneficial effects:

[0028] (1) Through clear update planning and rollback plans, update risks are reduced and the reliability of system updates is improved.

[0029] (2) Use automated tools to quickly create and start new nodes, improving deployment efficiency.

[0030] (3) Ensure the stability and performance of new nodes through health checks and performance tests.

[0031] (4) The strategy of gradually shifting traffic ensures service continuity and high availability. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of a hot deployment method based on a distributed cluster in the present invention. DETAILED DESCRIPTION

[0033] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.

[0034] like Figure 1 As shown, a hot deployment method based on a distributed cluster includes the following steps:

[0035] S1. Plan the update scope, determine the nodes that need to be updated, and prepare the corresponding rollback mechanism;

[0036] S2. Create and start new nodes in the distributed cluster through automated tools, using updated configurations or application versions;

[0037] S3. Perform health checks and performance tests on new nodes to ensure that they can work normally and meet performance indicators.

[0038] S4, gradually transfer traffic from old nodes to new nodes, while continuously monitoring the performance indicators and health status of old and new nodes;

[0039] S5. After the new node runs stably and can handle all traffic, shut down the old node to complete the update process.

[0040] S6. If a problem occurs during the update process or during the operation of the new node, the rollback mechanism is triggered.

[0041] The present invention has the following beneficial effects:

[0042] (1) Through clear update planning and rollback plans, update risks are reduced and the reliability of system updates is improved.

[0043] (2) Use automated tools to quickly create and start new nodes, improving deployment efficiency.

[0044] (3) Ensure the stability and performance of new nodes through health checks and performance tests.

[0045] (4) The strategy of gradually shifting traffic ensures service continuity and high availability.

[0046] To further illustrate, in S1, the rollback mechanism includes:

[0047] S11. Stop sending traffic to the problematic new node and isolate the problematic node to prevent further impact on the cluster.

[0048] S12. Roll back the service deployment to the previous stable version using the previously saved deployment configuration or the history in the version control system;

[0049] S13. Verify that the node after rollback works normally and meets the performance indicators;

[0050] S14. Reroute traffic to the verified nodes and continue to monitor the cluster status.

[0051] This embodiment provides specific steps for rollback operation to ensure that the system state can be quickly and effectively restored when problems occur. At the same time, the backup and recovery strategy reduces the risk of rollback failure, and then ensures the stability and performance of the system after rollback according to the verification steps.

[0052] To further illustrate, the rollback operation also includes:

[0053] S15. Before executing the rollback operation, back up the current cluster state in case of rollback failure.

[0054] S16. After the rollback is completed, summarize the rollback process and record the rollback reasons, rollback steps and results to facilitate subsequent analysis and improvement;

[0055] S17. During the rollback process, relevant personnel are automatically notified and the real-time progress and results of the rollback are provided.

[0056] To further illustrate, in S2, the creation and startup of the new node is automatically completed by a container orchestration tool, wherein the container orchestration tool includes but is not limited to Kubernetes, Docker Swarm and Apache Mesos.

[0057] This embodiment uses container orchestration tools to simplify the deployment and rollback process of services and improve deployment efficiency. In addition, containerization technology provides better portability and scalability, facilitating rapid deployment and expansion of services. The process automatically completed by the container orchestration tool is as follows:

[0058] 1. First, configure the container orchestration tool:

[0059] 1-1. Define services: In container orchestration tools, you need to define resource objects such as services and deployments. Services define how to access a group of containers (Pods) with the same functions, while deployments define how to create and update these containers.

[0060] 1-2. Set up the image: During deployment, you need to specify the image used to start the container. This image contains all the dependencies and configurations of the application, ensuring that the container can directly run the application when it starts.

[0061] 1-3. Configure resources: Configure the CPU, memory and other resources required by the container according to the application requirements. This helps ensure the stable operation of the application in the container.

[0062] 1-4 Define policies: Configure policies such as automatic expansion and rolling updates. These policies can automatically adjust the number of containers according to the load of the application, or gradually replace old containers during updates to ensure service continuity and high availability.

[0063] 2. Secondly, automated deployment:

[0064] 2-1. Write a YAML file: Use a YAML file to define services, deployments, and other resource objects. This file contains all the information on how to create and start a container.

[0065] 2-2. Apply the YAML file: Apply the YAML file to the container orchestration tool. This can be done through a command line tool (such as kubectl) or a graphical interface. Once applied successfully, the container orchestration tool will automatically create and start the container node.

[0066] 2-3. Verify deployment: Use the monitoring and logging functions of the container orchestration tool to verify whether the new node is successfully created and started. At the same time, you can check the running status and performance indicators of the application to ensure the normal operation of the service.

[0067] To further explain, in S3, a health check and performance test are performed on the newly started node through the http api interface; the performance test includes concurrency test and load test.

[0068] Specifically, concurrent testing includes:

[0069] First, use performance testing tools (such as Apache JMeter, Gatling, LoadRunner, etc.) to simulate multiple concurrent user requests; second, set the number of concurrent users (such as 100, 500, 1000, etc.) and send HTTP requests to the target interface; then monitor and record performance indicators such as response time, throughput, error rate, etc. Finally, analyze the test results to see if the service can handle the expected number of concurrent requests.

[0070] Load testing is similar to concurrency testing, but it focuses more on simulating system performance under different loads. Specifically, it includes: first gradually increasing the number of concurrent users or request rates, and observing the performance indicators of the service under different loads. Secondly, monitoring the usage of server resources (such as CPU, memory, disk, network, etc.) to see if there are bottlenecks or resource exhaustion. Finally, analyze the test results to determine the maximum load capacity and performance bottlenecks of the service.

[0071] Preferably, in S3, the newly started node is subjected to health check and performance test, and when the health check and performance test fail, the process returns to step S2 and the new node is not released, and the information release is postponed.

[0072] To further explain, in S4, the gradual transfer of the traffic is achieved by dynamically adjusting the load balancing strategy, service routing rules or using service mesh technology.

[0073] The gradual transfer of the traffic is achieved as follows:

[0074] 1. Dynamically adjust the load balancing strategy:

[0075] During the update process, the strategy of the load balancer (such as Nginx, HAProxy, etc.) is dynamically adjusted according to the actual situation of the service.

[0076] In the initial stage, a small amount of traffic is directed to the newly launched nodes to verify their stability and performance.

[0077] As the new node runs stably, gradually increase the proportion of traffic allocated to the new node, while reducing the traffic of the old node.

[0078] Monitor the performance indicators of new and old nodes to ensure the overall stability and availability of the service.

[0079] 2. Adjust service routing rules:

[0080] Update the routing information of the service in the service registration and discovery mechanism (such as Eureka, Consul, Zookeeper, etc.).

[0081] At the beginning of the update, a certain weight ratio is set to direct part of the traffic to the new node while keeping the old node running normally.

[0082] As the new node is verified and stabilized, the weight of the new node is gradually increased until it completely takes over all traffic.

[0083] Monitor the real-time status of service routing to ensure smooth and seamless traffic transfer.

[0084] 3. Use service mesh technology:

[0085] In a complex microservice architecture, service mesh technologies (such as Istio, Linkerd, etc.) can be used to achieve fine-grained control of traffic.

[0086] Through the traffic routing rules of the service grid, the traffic is gradually transferred from the old node to the new node.

[0087] Traffic routing can be performed based on the context of the request (such as user identification, request header information, etc.) to implement more complex traffic management strategies.

[0088] Monitor the traffic status of the service grid in real time to ensure the accuracy and efficiency of traffic transfer.

[0089] In summary, gradual traffic transfer is a key step to ensure service continuity and high availability during the update process. By dynamically adjusting load balancing strategies, service routing rules, or using service mesh technology, smooth traffic transfer and seamless switching can be achieved. At the same time, monitor and evaluate the performance indicators and service status of new and old nodes to ensure the accuracy and efficiency of traffic transfer.

[0090] To further explain, in S6, the triggering rollback mechanism includes two modes: manual triggering and automatic triggering.

[0091] Manual triggering and automatic triggering provide flexible fault recovery methods to ensure rapid response and processing when problems occur. Specifically, automatic triggering triggers rollback operations based on preset monitoring indicators or alarm rules to improve the timeliness and accuracy of rollback.

[0092] Further explanation, the following steps are also included: S7. During the update process, log data is collected and analyzed in real time through monitoring tools to facilitate troubleshooting and performance optimization. This embodiment provides real-time monitoring to ensure timely discovery and processing of problems, thereby improving the stability and reliability of the system. At the same time, log analysis helps locate problems and optimize performance, thereby improving the performance of the system and user experience. Specifically, monitoring and log collection are implemented through a cluster management system or a special monitoring tool, which comprehensively monitors the nodes, networks, storage and other resources in the cluster, and collects and analyzes log data in real time.

[0093] The technical principle of the present invention is described above in conjunction with specific embodiments. These descriptions are only for explaining the principle of the present invention and cannot be interpreted as limiting the scope of protection of the present invention in any way. Based on the explanations herein, those skilled in the art can associate other specific embodiments of the present invention without creative work, and these equivalent variations or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A hot deployment method based on distributed clusters, It is characterized in that The following steps are involved: S1. Plan the update scope, determine the nodes that need to be updated, and prepare the corresponding rollback mechanism; S2. Create and start new nodes in the distributed cluster through automated tools, using updated configurations or application versions; S3. Perform health checks and performance tests on new nodes to ensure that they can work normally and meet performance indicators. S4, gradually transfer traffic from old nodes to new nodes, while continuously monitoring the performance indicators and health status of old and new nodes; S5. After the new node runs stably and can handle all traffic, shut down the old node to complete the update process. S6. If a problem occurs during the update process or during the operation of the new node, the rollback mechanism is triggered.

2. According to the hot deployment method based on distributed clusters according to claim 1, It is characterized in that In S1, the rollback mechanism includes: S11. Stop sending traffic to the problematic new node and isolate the problematic node to prevent further impact on the cluster. S12. Roll back the service deployment to the previous stable version using the previously saved deployment configuration or the history in the version control system; S13. Verify that the node after rollback works normally and meets the performance indicators; S14. Reroute traffic to the verified nodes and continue to monitor the cluster status.

3. According to the hot deployment method based on distributed clusters according to claim 2, It is characterized in that The rollback operation further includes: S15. Before executing the rollback operation, back up the current cluster state in case of rollback failure. S16. After the rollback is completed, summarize the rollback process and record the rollback reasons, rollback steps and results; S17. During the rollback process, relevant personnel are automatically notified and the real-time progress and results of the rollback are provided.

4. According to the hot deployment method based on distributed clusters according to claim 1, It is characterized in that In S2, the creation and startup of the new node are automatically completed by a container orchestration tool, wherein the container orchestration tool includes but is not limited to Kubernetes, Docker Swarm and Apache Mesos.

5. According to the hot deployment method based on distributed clusters according to claim 1, It is characterized in that In S3, health checks and performance tests are performed on newly started nodes through the http api interface; the performance tests include concurrency tests and load tests.

6. A distributed cluster-based hot deployment method according to claim 1, It is characterized in that In S3, the health check and performance test are performed on the newly started node. If the health check and performance test fail, the process returns to step S2 and executes it again.

7. A distributed cluster-based hot deployment method according to claim 1, It is characterized in that In S4, the gradual transfer of the traffic is achieved by dynamically adjusting the load balancing strategy, service routing rules or using service mesh technology.

8. A distributed cluster-based hot deployment method according to claim 1, It is characterized in that In S6, the trigger rollback mechanism includes two modes: manual trigger and automatic trigger.

9. A distributed cluster-based hot deployment method according to claim 1, It is characterized in that The following steps are also included: S7. During the update process, log data is collected and analyzed in real time through monitoring tools to facilitate troubleshooting and performance optimization.

Citation Information

Cited By

  • Container application migration monitoring method and device based on K8s cluster

    CN120675940A

  • Service updating deployment method of distributed system

    CN120825414A