美文网首页
使用SpringAdmin

使用SpringAdmin

作者: 8813d76fee36 | 来源:发表于2018-05-03 13:55 被阅读44次

搭建SpringAdmin Server端

  • 新建SpringBoot项目
    加入Spring Admin Server端依赖
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
        </dependency>
  • 开启Server服务
    在启动类上加入@EnableAdminServer注解。
    @EnableAdminServer

至此Server端搭建完毕,访问http://localhost:8080/即可看到主页面。

搭建Spring Admin Client端

  • 新建SpringBoot项目
    引入依赖
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
        </dependency>
  • 开发监控端点并注册到Server端
spring.boot.admin.auto-registration=true  # 开启自动注册
spring.boot.admin.url=http://localhost:8080 # 配置Server端地址
spring.boot.admin.client.name=AdminClientTest  # 客户端名称
endpoints.sensitive=false # 开放所有监控端点

至此Client端搭建完成。

效果

分别启动Server端和Client端,并访问Server端,默认URL:http://localhost:8080

主页
点击Details即可查看详情数据。

相关文章

网友评论

      本文标题:使用SpringAdmin

      本文链接:https://www.haomeiwen.com/subject/zdikrftx.html