基于spring boot admin 做监控的一些问题记录
问题一
各个健康节点权限问题
解决方式
加入权限模块
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
设置账户
security:
user:
name: admin
password: qq123123
management:
security:
roles: SUPERUSER
spring boot admin 配置
eureka:
instance:
lease-renewal-interval-in-seconds:
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
呵呵 官方给出的解决方式是放入元数据中
问题二
spring boot admin 排查服务设置问题
boot:
admin:
routes:
endpoints: env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream,activiti
turbine:
location: dj-atliwen-edi-admin
discovery:
# ignored-services: turbine
ignored-services: ss-erp-*,yjc-zhongjie,*jsp*,admin-discovery
注意!
这里是小写!小写!小写!
ignored-services 是 Set<Stirng> 注入使用 ,就可以 。 不是 - ss
问题三
spring boot admin 自定义消息触发器
public class DdNotifier extends AbstractStatusChangeNotifier
{ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private static RestTemplate template = new RestTemplate(); private String url;
DdNotifier(String url) {
this.url = url;
} @Override
protected void doNotify(ClientApplicationEvent event) throws JsonProcessingException { Application a = event.getApplication();
StatusInfo statusInfo = a.getStatusInfo();
switch (statusInfo.getStatus()) {
// 健康检查没通过
case "DOWN":
sendDown(a, statusInfo);
break;
// 服务离线
case "OFFLINE":
offline(a);
break;
//服务上线
case "UP":
up(a);
break;
// 服务未知异常
case "UNKNOWN":
unknown(a);
break;
default:
break;
}
}
注意!! 这里是大写!大写!大写! 服务名称也是大写!都是大写!
@Bean
@Primary
public RemindingNotifier remindingNotifier() {
RemindingNotifier notifier = new RemindingNotifier(filteringNotifier());
notifier.setReminderPeriod(TimeUnit.SECONDS.toMillis());
String[] reminderStatuses = {"DOWN", "OFFLINE", "UP", "UNKNOWN"};
notifier.setReminderStatuses(reminderStatuses);
return notifier;
} @Scheduled(fixedRate = 6_000L)
public void remind() {
remindingNotifier().sendReminders();
}
注意!
setReminderPeriod 设置的不是官方文档上写的分钟! 不是分钟! 是秒!是秒!是秒!
问题四
spring boot admin 的 turbine 是在是太慢了!!!! 几分钟都不见得好,害我折腾半天,以为是自己哪里配置没配置好!!!!
基于spring boot admin 做监控的一些问题记录的更多相关文章
- Spring Cloud第十三篇 | Spring Boot Admin服务监控
本文是Spring Cloud专栏的第十三篇文章,了解前十二篇文章内容有助于更好的理解本文: Spring Cloud第一篇 | Spring Cloud前言及其常用组件介绍概览 Spring Clo ...
- Spring Boot Admin 详解(Spring Boot 2.0,基于 Eureka 的实现)
原文:https://blog.csdn.net/hubo_88/article/details/80671192 Spring Boot Admin 用于监控基于 Spring Boot 的应用,它 ...
- Spring Boot Admin 的使用 2
http://blog.csdn.net/kinginblue/article/details/52132113 ******************************************* ...
- 基于spring boot 2.x 的 spring-cloud-admin 实践
spring cloud admin 简介 Spring Boot Admin 用于监控基于 Spring Boot 的应用,它是在 Spring Boot Actuator 的基础上提供简洁的可视化 ...
- 微服务架构之spring boot admin
Spring boot admin是可视化的监控组件,依赖spring boot actuator收集各个服务的运行信息,通过spring boot actuator可以非常方便的查看每个微服务的He ...
- spring boot admin抛出"status":401,"error":"Unauthorized"异常
打开spring boot admin的监控平台发现其监控的服务明细打开均抛出异常: Error: {"timestamp":1502749349892,"status& ...
- Spring Boot Admin2.X监控的服务context-path问题
在使用Spring Boot Admin进行监控时,如果被监控的服务没有加context-path的话是不会有任何问题的,一旦服务加了context-path的配置,监控就会失败. 下图是正常情况的显 ...
- Spring Boot Admin,贼好使!
Spring Boot Admin(SBA)是一个开源的社区项目,用于管理和监控 Spring Boot 应用程序.应用程序可以通过 http 的方式,或 Spring Cloud 服务发现机制注册到 ...
- Springboot监控之二:Spring Boot Admin对Springboot服务进行监控
概述 Spring Boot 监控核心是 spring-boot-starter-actuator 依赖,增加依赖后, Spring Boot 会默认配置一些通用的监控,比如 jvm 监控.类加载.健 ...
随机推荐
- 【BZOJ1096】[ZJOI2007]仓库建设 斜率优化
[BZOJ1096][ZJOI2007]仓库建设 Description L公司有N个工厂,由高到底分布在一座山上.如图所示,工厂1在山顶,工厂N在山脚.由于这座山处于高原内陆地区(干燥少雨),L公司 ...
- oracle的with as用法
转自:https://www.cnblogs.com/linjiqin/archive/2013/06/24/3152667.html with as语法–针对一个别名with tmp as (sel ...
- Thrift 入门之helloWorld
不多说,先看项目结构 首先先编写一个hello.thrift的文件 hello.thrift namespace java sawshaw service HelloService { string ...
- mysql 把表中某一列的内容合并为一行
1,把表中某一列的内容合并为一行 select province,CONCAT('[\"全部\",\"',GROUP_CONCAT(city ORDER BY cityI ...
- linux设置安全连接设置(私钥)
1.私钥制作工具:puttygen 连接工具:xshell和putty. 2.制作私钥和公钥 a.打开puttygen点击Generate生产公钥和私钥(鼠标需要晃动,进度条才会前进) b. 设置标签 ...
- 微信小程序 --- 页面跳转
第一种:wx.navigateTo({}); 跳转: 注意:这种跳转回触发当前页面的 onHide 方法,将当前页面隐藏,然后显示跳转页面.所以可以返回,返回的时候触发 onShow方法进行显示: ( ...
- mysql-sql高级应用
sql语言进阶 典型操作 order by - select * from play_list order by createtime; - select * from play_list order ...
- 南京网络赛B-The writing on the wall
30.43% 2000ms 262144K Feeling hungry, a cute hamster decides to order some take-away food (like frie ...
- rbac - 界面、权限
一.模板继承 知识点: users.html / roles.html 继承自 base.html 滑动时,固定 position: fixed;top:60px;bottom:0;left:0;wi ...
- python中的Redis键空间通知(过期回调)
介绍 Redis是一个内存数据结构存储库,用于缓存,高速数据摄取,处理消息队列,分布式锁定等等. 使用Redis优于其他内存存储的优点是Redis提供持久性和数据结构,如列表,集合,有序集和散列. 在 ...