Spring boot admin 使用


1. maven依賴
 
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
 
2. 應用配置文件
server.port =8090
spring.application.name=SpringBootAdminWeb
spring.boot.admin.url=http://localhost:${server.port}
spring.jackson.serialization.indent_output=true
endpoints.health.sensitive=false
 
3. spring boot admin server 注解啟動
@SpringBootApplication
@EnableAdminServer
publicclassPaasApplication{
publicstaticvoid main(String[] args){
SpringApplication.run(PaasApplication.class, args);
}
}
 
4. 客戶端引用
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.3.2</version>
</dependency>
 
5. 日志操作:
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>

 

6. 參考文檔:
 
http://codecentric.github.io/spring-boot-admin/1.5.0/#getting-started


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM