Eureka+SpringBoot2.X版本实现优雅停服
2024-09-01 19:40:03
在客户端添加如下配置
pom依赖 actuator.jar包
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
或者
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
application.yml全局配置文件添加如下
management:
endpoints:
web:
exposure:
include: shutdown #暴漏shutdown端点服务
endpoint:
shutdown:
enabled: true
然后在postman里边用post请求方式,请求如下地址
http://ip:port/actuator/shutdown
官方介绍:
https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html
最新文章
- TCP三次握手的正确使用姿势
- MVC学习系列8--分页和排序
- C语言变参问题
- C++中不可重载的5个运算符
- ssh连接阿里云一段时间不操作自动断开
- 类库探源——System.Drawing.Bitmap
- PHP - 日期与时间
- swift 笔记2
- Oracle 生成一张测试表并插入随机数据
- js 闭包的用法详解
- 【Java入门提高篇】Day13 Java中的反射机制
- H5 FormData对象的作用及用法
- Android全平台书籍
- HeapSter安装(k8s1.12以后废弃了)
- 一元线性回归与R语言
- 《精通CSS层叠样式表》
- Ubuntu编译gdb-ARM调试环境
- centos 修改host
- VGGnet——从TFrecords制作到网络训练
- singer页左侧滚动的时候右侧跟随高亮显示
热门文章
- mysql 忘记登录密码(修改root密码)
- 【nodejs原理&源码赏析(1)】Express中间件系统的基本实现
- 华为ARM64服务器上手体验--不吹不黑,用实际应用来看看TaiShan鲲鹏的表现
- 卸载&;&;更新docker(ubuntu)
- react-native测试安装
- [TimLinux] HTTP cookie与session技术
- ACM小组的古怪象棋
- B.Silly Mistake
- 【面试】386- JavaScript 面试 20 个核心考点
- rails 创建项目、创建controller、model等