基于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 监控.类加载.健 ...
随机推荐
- 最优比例生成环(dfs判正环或spfa判负环)
http://poj.org/problem?id=3621 Sightseeing Cows Time Limit: 1000MS Memory Limit: 65536K Total Subm ...
- 从零打造在线网盘系统之Struts2框架配置全解析
欢迎浏览Java工程师SSH教程从零打造在线网盘系统系列教程,本系列教程将会使用SSH(Struts2+Spring+Hibernate)打造一个在线网盘系统,本系列教程是从零开始,所以会详细以及着重 ...
- 170525、解决maven隐式依赖包版本问题
今天在使用dubbo2.5.3版本的时候,启动项目的时候发现一个问题,tomcat启动一直报错 Caused by: java.lang.IllegalStateException: Context ...
- 徐州网络赛H-Ryuji doesn't want to study【线段树】
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, ea ...
- Fast R-CNN论文详解 - CSDN博客
废话不多说,上车吧,少年 paper链接:Fast R-CNN &创新点 规避R-CNN中冗余的特征提取操作,只对整张图像全区域进行一次特征提取: 用RoI pooling层取代最后一层max ...
- Python开发【笔记】:进程
序言 进程与线程概述: 很多同学都听说过,现代操作系统比如Mac OS X,UNIX,Linux,Windows等,都是支持“多任务”的操作系统. 什么叫“多任务”呢?简单地说,就是操作系统可以同时运 ...
- django自带权限机制
1. Django权限机制概述 权限机制能够约束用户行为,控制页面的显示内容,也能使API更加安全和灵活:用好权限机制,能让系统更加强大和健壮.因此,基于Django的开发,理清Django权限机制是 ...
- T-SQL练习题
转自:http://www.cnblogs.com/jenrrychen/p/5348546.html 1 - 3 题: 数据表结构: OrderID ProductID OrderDate Sal ...
- centos LAMP第一部分-环境搭建 Linux软件删除方式,mysql安装,apache,PHP,apache和php结合,phpinfo页面,ldd命令 第十九节课
centos LAMP第一部分-环境搭建 Linux软件删除方式,mysql安装,apache,PHP,apache和php结合,phpinfo页面,ldd命令 第十九节课 打命令之后可以输入: e ...
- git-【五】远程仓库
一.准备工作 在了解之前,先注册github[https://github.com/]账号,由于你的本地Git仓库和github仓库之间的传输是通过SSH加密的,所以需要一点设置: 第一步 创建SSH ...