1. Add the following dependencies to the spring boot application that needs to be accessed
<!-- spring-boot-admin-client -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.3.1</version>
</dependency>
<!-- spring-boot-actuator(必须) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- 在管理界面中与JMX-beans进行交互所需要被依赖的JAR -->
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
<version>1.7.1</version>
</dependency>
2. Add admin-server configuration in application.yml
# admin-server配置
spring:
application:
# 在spring-boot-admin 上的的显示名称
name: cherry-devops
boot:
admin:
client:
# admin-server地址
url: http://localhost:8000
# admin-server security用户名
username: admin
# admin-server security密码
password: 123456
# 开放健康检查接口
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
3. Start the application
After successful registration, there will be an id
4. Log in to admin to see the application
5. Precautions
If the client is a security-authenticated application, it needs to pass /actuator
and /instances
release, otherwise it will fail to register, add it to the security configuration file
.antMatchers("/actuator/**", "/instances/**").permitAll()