• SpringBoot_Actuator_AdminUI


    AdminUI的原理:

    服务端:

    1、pom.xml

    <dependencies>
    <dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-starter-server</artifactId>
    <version>2.0.0</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
    </dependency>
    <!-- Spring Boot Actuator对外暴露应用的监控信息,Jolokia提供使用HTTP接口获取JSON格式 的数据 -->
    <dependency>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-core</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <!-- 将原来本身的 1.1.1版本强制改为1.1版本 -->
    <dependency>
    <groupId>com.googlecode.json-simple</groupId>
    <artifactId>json-simple</artifactId>
    <version>1.1</version>
    </dependency>

    </dependencies>

    2、启动App类

    @ConfigurationProperties
    @EnableAutoConfiguration
    @EnableAdminServer

    3、application.yml

    spring:
      application:
        name: spring-boot-admin-server

    客户端:

    1、application.yml

    spring: ##配置client 注册到admin ui 平台
      boot:
        admin:
          client:
            url: http://localhost:8080
    server:
      port: 8081 ### 端口号
    ### 开放所有的监控接口监控权限
    management:
      endpoints:
        web:
          exposure:
            include: "*"

    2、pom.xml

    <dependencies>
    <dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-starter-client</artifactId>
    <version>2.0.0</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-core</artifactId>
    </dependency>
    <dependency>
    <groupId>com.googlecode.json-simple</groupId>
    <artifactId>json-simple</artifactId>
    <version>1.1</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    </dependencies>

    注意:先启动服务端,在启动客户端,以为客户端要在配置文件里指定服务端,必须是服务端存在。

  • 相关阅读:
    递归遍历多维数组(树数据结构)的超级简单方式,并且可以递归超过200层,摘自<<PHP精粹:编写高效PHP代码>>
    http协议传输二进制数据以及对输入流(php://input)和http请求的理解
    一个非常简单的RPC服务
    php://input 打开的数据流只能读取一次,即读取一次之后读取的值为空
    soap的简单实现(PHP)
    使用PHP的curl扩展实现跨域post请求,以及file_get_contents()百度短网址例子
    jquery选取iframe
    算法之棋盘覆盖
    词法分析之实验报告
    简单的词法分析小程序
  • 原文地址:https://www.cnblogs.com/wenwenzuiniucha/p/14508635.html
Copyright © 2020-2023  润新知