Spring Boot Admin-UI 图形化界面显示Actuator信息

AdminUI

启动AdminUI界面,需要单独定义AdminUI-Server服务,独立于功能服务之外。所有功能服务作为AdminUI-Client服务连接到Server服务,Server服务检测到连接后对进行监控处理。

Server

pom

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

application.properties

TIPS:注意端口不要和客户端冲突

server.port=8081

启动类

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;

import de.codecentric.boot.admin.server.config.EnableAdminServer;

/**
 * 启动类的配置与标准的spring boot启动类配置不同
 * 
 * 访问地址:http://localhost:8081
 * @author lenovo
 *
 */
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class AdminUiServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(AdminUiServerApplication.class, args);
	}

}

Client

pom

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
	<groupId>de.codecentric</groupId>
	<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

application.properties

# acturtor http 开启的endpoint
management.endpoints.web.exposure.include=*
# admin-ui server 
spring.boot.admin.client.url=http://127.0.0.1:8081
# 不使用域名注册,以IP形式注册
spring.boot.admin.client.instance.prefer-ip=true
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值