成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

SpringBoot基于Actuator遠(yuǎn)程關(guān)閉服務(wù)

瀏覽:118日期:2023-04-07 08:39:53

1、在pom.xml文件引入依賴

<!-- 運行狀態(tài)監(jiān)控actuator依賴 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>

2、配置文件配置

server: port: 8100 #web服務(wù)端口 servlet: context-path: /buzhengspring: main: allow-bean-definition-overriding: true #是否允許使用相同名稱重新注冊不同的bean實現(xiàn). 默認(rèn)是允許 datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai username: root password: asdfghjkl### 運行狀態(tài)監(jiān)控Actuatormanagement: server: port: 9011 #運行狀態(tài)監(jiān)控端口 endpoints: web: exposure: include: '*' base-path: / #配置可遠(yuǎn)程使用 Actuator 關(guān)閉服務(wù) endpoint: shutdown: #關(guān)閉服務(wù) enabled: true

3、執(zhí)行關(guān)閉指令

http://localhost:9011/shutdown POST請求

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Spring
相關(guān)文章: