zoukankan      html  css  js  c++  java
  • 使用spring boot admin

    spring boot admin管理端,

    需要部署成独立的应用

    pom中添加依赖

    <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-server</artifactId>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server-ui</artifactId>
            </dependency>

    appllication.properties:

    server.port=8091
    spring.boot.admin.url=http://localhost:${server.port}
    spring.jackson.serialization.indent_output=true
    endpoints.health.sensitive=false

    管理端的端口设置为8091, 查看其他应用的状态也是从这个端口访问

    应用代码修改:

    入口加上 @EnableAdminServer

    spring boot admin客户端

    即普通的、需要被管理的web应用。

    pom依赖

    1 <dependency>
    2             <groupId>de.codecentric</groupId>
    3             <artifactId>spring-boot-admin-starter-client</artifactId>
    4         </dependency>
    5         <dependency>
    6             <groupId>org.springframework.boot</groupId>
    7             <artifactId>spring-boot-starter-security</artifactId>
    8         </dependency>

    application.properties配置:

    spring.application.name=XXXX
    spring.boot.admin.client.url=http://localhost:8091
    ##配置项不要加""
    management.endpoints.web.exposure.include=*
    management.endpoint.health.show-details=always
    spring.boot.admin.client.url 指向的是spring-boot-admin-server的地址,示例中是8091

    应用代码不需要修改

    结果图:

     

    点击查看详情

    视频教程-- 在google中搜索 spring boot admin site:youtube.com

  • 相关阅读:
    数据库封装类使用
    C# Socket-TCP异步编程原理详解附源码
    Mysql 5.7安装与配置-默认密码
    Python-Django WebAPi基本使用方法
    C# 微信小程序获取openid sessionkey
    voith项目配置服务程序
    社区安防系统
    数据结构和算法-一元多项式运算算法(加法)
    数据结构和算法-贪婪算法
    Oracle分页SQL语句
  • 原文地址:https://www.cnblogs.com/yszzu/p/9419700.html
Copyright © 2011-2022 走看看