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


目標client:

 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啦~





arrow
arrow
    文章標籤
    JAVA SpringBoot SpringBoot Ad
    全站熱搜

    咪卡恰比 發表在 痞客邦 留言(0) 人氣()