基于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 监控.类加载.健 ...
随机推荐
- for update 和 t.rowid的区别
select * from table_name for update; 和 select t.*, t.rowid from table_name t 的区别 前者会对你查询出来的结果加上锁,而后者 ...
- mybatis的<choose>和<when>、<otherwise>标签
SELECT<choose> <when test='timeType=="yy"'> TO_CHAR(REPORT_TIME,'yyyy') </w ...
- 查询hadoop参数变量
[hadoop@master hadoop]$ hive -S -e 'set -v'|grep querylog|grep -E -v 'CLASSPATH|class'hive.querylog. ...
- C++ list容器系列功能函数详解
C++ list函数详解 首先说下eclipse工具下怎样debug:方法:你先要设置好断点,然后以Debug方式启动你的应用程序,不要用run的方式,当程序运行到你的断点位置时就会停住,也会提示你进 ...
- MVC学习之简单的CRUD
1.一点知识的总结 (1)MVC将展示页面和后台处理逻辑分离,不像ASPX中展示页面继承自后台的cs页面,MVC展示页面继承自ViewPage<dynamic>,最终继承自Page(使用A ...
- Shell--基础知识
变量的定义: a=1 b=hello c="hello world !" d='hello "反启" !' e=`ls` (注意:这是反引号) 备注:=号左右 ...
- "errmsg" : "distinct too big, 16mb cap",
repl_test:PRIMARY> show dbs admin 0.000GB direct_vote_resource 16.487GB local 14.860GB personas 3 ...
- Python开发【整理笔记】
回顾笔记 学python半年,新知识不断填充,之前学的东西也忘的差不多,整理下笔记,把重点再加深下印象,算是读书拾遗吧.... 1.类继承.新式类.经典类 首先,新式类.经典类的概念只存在于Pytho ...
- Docker+Jenkins_自动化持续集成环境搭建
前一篇文章里已经在内网环境搭建好docker 详见:https://www.cnblogs.com/befer/p/9107503.html, 现在接着搭建一个Docker+Jenkins的集成环境 ...
- mysql 表的增删改查 修改表结构
四.修改表结构 语法: . 修改表名 ALTER TABLE 表名 RENAME 新表名; . 增加字段 ALTER TABLE 表名 ADD 字段名 数据类型 [完整性约束条件…], ADD 字段名 ...