boot-actuator 项目安装与使用教程

boot-actuator 项目安装与使用教程

boot-actuator boot-actuator 项目地址: https://gitcode.com/gh_mirrors/boo/boot-actuator

1. 项目的目录结构及介绍

boot-actuator/
├── actuator-service/
│   ├── src/
│   └── pom.xml
├── boot-monitor/
│   ├── src/
│   └── pom.xml
├── LICENSE
├── README.md
└── actuator.sql

目录结构说明

  • actuator-service: 监控端点jar包,需要引入到需要监控的项目中。
  • boot-monitor: 监控图形化工程,用于展示监控数据。
  • LICENSE: 项目许可证文件。
  • README.md: 项目介绍和使用说明。
  • actuator.sql: 项目所需的数据库脚本。

2. 项目的启动文件介绍

actuator-service

在需要监控的项目中引入 actuator-service jar 包,并在启动类上增加扫描包注解:

@ComponentScan("com.pflm.**, com.github.qinxuewu.core")

启动日志出现如下端点信息,则表示集成监控jar包成功:

http://localhost:8080/actuator

boot-monitor

编译成jar或war包启动工程:

nohup java -jar boot-monitor.jar &

访问监控图形化界面:

http://localhost:8080/login

默认账号:admin/admin

3. 项目的配置文件介绍

actuator-service 配置

在需要监控的项目中引入 actuator-service jar 包,并在 application.properties 中添加以下配置:

# 监控应用名称,唯一
spring.application.name=web1

# 限制白名单访问监控端点,为空则不限制,建议设置
actuator.server.ip=

# 监控远程应用日志
actuator.log.path=F:/log/boot-monitor/spring.log

boot-monitor 配置

boot-monitor 项目的 application.properties 中添加以下配置:

# 数据库配置
spring.datasource.url=jdbc:mysql://localhost:3306/boot_monitor
spring.datasource.username=root
spring.datasource.password=root

# 监控端点配置
management.endpoints.web.exposure.include=*

通过以上配置,可以实现对多个web应用的远程监控,并展示监控数据在图形化界面中。

boot-actuator boot-actuator 项目地址: https://gitcode.com/gh_mirrors/boo/boot-actuator

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郎凌队Lois

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值