SpringBoot Admin可用來監控SpringBoot服務,安裝簡單, 紀錄一下實作過程:
要起兩台服務,監控server 和 目標client
監控server:
pom.xml
add:
<dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server</artifactId><version>2.1.6</version> <!--注意版本號要和spring-boot一致--></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui</artifactId><version>2.1.6</version></dependency>
Application.java
add: @EnableAdminServer
application.properties
可以在這邊自定port
set port: server.port=9999
然後起服務確認
http://localhost:9999
pom.xml
add:
<dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-client</artifactId><version>2.1.6</version> <!--注意版本號--></dependency>
application.properties
server.port=8080
spring.application.name: demoservice
spring.boot.admin.client.url=http://localhost:9999
起服務確認剛剛的面板就OK啦~
文章標籤
全站熱搜