هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.
- Service Overview
- Billing
- Getting Started
-
User Guide
- Overview
- Permissions Management
- Environment Management
- Application Management
- Component Management
- Instance Management
- Component Configurations
- Component O&M
- System Settings
- Key Operations Recorded by CTS
-
Best Practices
- CAE Best Practices
- Using CAE to Host Nginx Static File Servers
- Interconnecting GitLab with Jenkins for Automatic Build and Deployment on CAE
- Deploying Components Based on the Dependency Sequence Using the Jenkins Pipeline
- Deploying Spring Cloud Applications to CAE to Automatically Connect to the Nacos Engine
- Graceful Startup of a Spring Cloud Application
- Health Check
- Lifecycle Management
- Sending Event Alarms to WeCom
-
Connecting to the CodeArts Pipeline to Automatically Upgrade CAE Components
- Overview
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to a CodeArts Release Repo
- Upgrading a CAE Component After Uploading a Software Package Built Using the Pipeline to the OBS Bucket
- Upgrading a CAE Component After Uploading an Image Built Using the Pipeline to the SWR Image Repository
- Configuring PromQL to Implement Custom Auto Scaling
- Configuring the Interconnection Between CAE and DEW to Help Applications Obtain Encrypted Secrets from DEW
- Deploying ASP.NET Core Applications to CAE
- Connecting the Network Through Enterprise Routes
- API Reference
-
FAQs
- Component Management FAQs
- Environment Management
-
Component Configuration FAQs
- Is Manual Scaling Still Effective When a Scaling Policy Is Configured?
- Can Components Be Scaled Without a Scaling Policy?
- Why Is My Instance Abnormal After Cloud Storage Is Configured?
- What Do I Do If a Component Becomes Not Ready?
- How Does CAE Support Dark Launch?
- How Do I Provide Prometheus Metrics for a Java Application?
- System Configuration FAQs
- Service Resources FAQs
- General Reference
Show all
Copied.
Graceful Startup of a Spring Cloud Application
Overview
This section describes how to configure graceful startup for Spring Cloud application to perform operations such as upgrade, restart, and scale-out during component O&M.
Prerequisites
- You have created an environment.
- You have created an application.
- You have created and deployed a Spring Cloud component.
Procedure
- Enable spring-boot-starter-actuator for Spring Cloud.
- Add the spring-boot-starter-actuator dependency to the pom.xml file of the source code corresponding to the component. (Version 2.3.0 or later is recommended.)
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>{Your Spring boot version}</version> </dependency>
- Add the following configurations to the application.properties file:
Table 1 application.properties Spring Boot Version
Configuration
2.3.0/2.3.1
management.health.probes.enabled=true
>= 2.3.2
management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
- Update code.
- If your component is deployed using source code, update the modified source code to the source code repository.
- If your component is deployed using a software package, pack the new code into a software package and upload the new package to the software package repository.
- Use the new source code or software package to upgrade the component.
- Add the spring-boot-starter-actuator dependency to the pom.xml file of the source code corresponding to the component. (Version 2.3.0 or later is recommended.)
- Configure component health check.
- Log in to CAE. Choose Component Configurations.
- Select the target component from the drop-down list in the upper part of the page.
- Configure readiness probe by referring to Configuring Health Check. The parameters are as follows:
Table 2 Readiness probe parameters Parameter
Description
Check Method
Select HTTP.
Port
Enter the listening port of your component.
Path
- For Spring Boot 2.3 and later, enter /actuator/health/readiness.
- For Spring Boot versions earlier than 2.3, enter /actuator/health.
Protocol
Select the protocol of your component.
Check Interval
Enter 10.
Latency
Enter 0.
Timeout Interval
Enter 1.
Success Threshold
Enter 1.
Failure Threshold
Enter 3.
- Upgrade the component. For details, see Upgrading a Component.
- Verify the configuration.
- Choose Components. If the status of the target component is Running, go to the next step. Otherwise, the configuration fails.
- Choose Component Events and select the target component from the drop-down list in the upper part of the page. If the Component instance healthy event exists, the configuration is successful. Otherwise, the configuration fails.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot