十三、springboot (八)Admin

本文详细介绍如何使用Spring Boot Admin创建服务器端和客户端,实现应用监控。从添加依赖到配置启动类,再到客户端连接,逐步解析搭建过程。

1、创建server端spring-boot-admin

2、添加依赖

<parent>

  <groupId>org.springframework.boot</groupId>

  <artifactId>spring-boot-starter-parent</artifactId>

  <version>2.0.5.RELEASE</version>

  <relativePath /> <!-- lookup parent from repository -->

</parent>

<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-web</artifactId>

    </dependency>

</dependencies>

3、设置启动端口

  server.port=8088

4、创建启动类

@Configuration

@EnableAutoConfiguration

@EnableAdminServer

public class AdminServerApplication {

 

public static void main(String[] args) {

SpringApplication.run(AdminServerApplication.class, args);

}

}

5、创建客户端spring-boot

6、添加依赖

 

<dependency>

<groupId>de.codecentric</groupId>

<artifactId>spring-boot-admin-starter-client</artifactId>

<version>2.0.0</version>

</dependency>

 

7、修改application.properties

#关掉安全认证

management.security.enabled=false

spring.boot.admin.client.url:http://localhost:8088

 

8、localhost:8088启动服务端

 

转载于:https://www.cnblogs.com/monkeybrother/p/9780171.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值