标签搜索
向Spring Boot Admin 注册客户端
记录笔记的地方

向Spring Boot Admin 注册客户端

skwax
2021-08-10 / 0 评论 / 17 阅读 / 正在检测是否收录...
  1. pom文件引入client的起步依赖和web的起步依赖
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.1.0</version>
        </dependency>
                
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
  1. 在工程的配置文件application.yml中配置应用名和端口信息,以及向server注册的地址为http://localhost:8800,最后暴露自己的actuator的所有端口信息
spring:
  application:
    name: client
  boot:
    admin:
      client:
        url: http://192.168.2.9:8800
        instance:
          service-url: http://192.168.2.9:${server.port}
server:
  port: 8768

management:
  endpoints:
    web:
      exposure:
        include: '*'
  endpoint:
    health:
      show-details: ALWAYS
  1. 启动 server 和 client 后在 server 内查看信息
0

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/biji.moyuke.net/var/Widget/Archive.php on line 1032

评论

博主关闭了所有页面的评论