基于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 监控.类加载.健 ...
随机推荐
- Java初学者笔记三:关于字符串和自实现数组常见操作以及异常处理
一.字符串常见的操作 1.结合我在python中对于字符串常见处理总结出下面三个应该能算是字符串造作的TOP 3 //字符串查找子串,存在返回index,不存在返回-1 等于python的find: ...
- go练习2-go的学习资料
好吧 我承认,有自己添加的内容也有从别人的blog 中 ctrl + c 的 官方:http://golang.org ,经常被封 中文手册的翻译:http://code.google.com/p/g ...
- 从SVN一键对比版本
公司的部署程序太多,每次部署安装完后,还得从SVN上对比版本,手工做实在太麻烦. 比如下面的一个版本 思路: 将需要检查的部件及安装的位置.SVN相关信息写入配置文件,然后程序读取配置文件 配置文件内 ...
- 批量远程执行linux服务器程序--基于pxpect(多进程、记日志版)
#!/usr/bin/python '''Created on 2015-06-09@author: Administrator''' import pexpect import os,sys fro ...
- MySQL 5.6 my.cnf 参数说明(转)
# 以下选项会被MySQL客户端应用读取. # 注意只有MySQL附带的客户端应用程序保证可以读取这段内容. # 如果你想你自己的MySQL应用程序获取这些值. # 需要在MySQL客户端库初始化的时 ...
- 从零打造在线网盘系统之Struts2框架核心功能全解析
欢迎浏览Java工程师SSH教程从零打造在线网盘系统系列教程,本系列教程将会使用SSH(Struts2+Spring+Hibernate)打造一个在线网盘系统,本系列教程是从零开始,所以会详细以及着重 ...
- 3.html+.ashx(删除学生信息)
C03ListStu.ashx 0:false(删除);1:true(正常). (数据库里定义个BOOL型,TRUE表示正常FALSE表示删除) <html> <head> & ...
- javascript 执行环境,作用域链和闭包
首先看下这条语句: (function($) {…})(jQuery): 1.原理: function(arg){…}这就定义了一个匿名函数,参数为arg 而调用函数时,是在函数后面写上括号和实参的, ...
- could not execute menu item系统找不到指定的文件
Wamp3.0.6 64bit,系统任务栏图标,左键,Apache菜单,httpd.conf,报错“could not execute menu item.....系统找不到指定的文件” 根据网上的搜 ...
- 禁止输入emoji表情
三个文本框textField UITextView都要禁止苹果自带emoji 后来发现是原来写的方法不能覆盖所有的表情,新增的表情过滤不掉,只好再加了一个方法 http://www.jianshu.c ...