spring cloud(Greenwich.M2) hystrix dashboard 报/actuator/hystrix.stream 404 Not Found的问题
consumer端不引用spring-boot-starter-actuator的情况
Consumer端会报Unable to connect to Command Metric Stream。新建HystrixConfiguration类加入以下代码:
import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; @Configuration
public class HystrixConfiguration {
@Bean
public ServletRegistrationBean<HystrixMetricsStreamServlet> getServlet(){
HystrixMetricsStreamServlet hystrixMetricsStreamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean<HystrixMetricsStreamServlet> servletRegistrationBean = new ServletRegistrationBean();
servletRegistrationBean.setServlet(hystrixMetricsStreamServlet);
servletRegistrationBean.addUrlMappings("/hystrix.stream");
servletRegistrationBean.setName("HystrixMetricsStreamServlet");
return servletRegistrationBean;
}
}
hystrix-dashboord输入的地址为http://consumerhost:port/hystrix.stream
turbine站点配置文件加入:
turbine.appConfig=xxx1,xxx2,x3
turbine.instanceUrlSuffix=/hystrix.stream
xxx1为consumer端配置的应用程序名(如spring.application.name=xxx1),通过eareka-server自动找到对应的consumer接口http://consumerhost:port/hystrix.stream去抓取信息显示到turbine聚合界面上。
由于spring-boot-starter-actuator的默认context-path为actuator,若turbine.instanceUrlSuffix不做设置,默认路径为/actuator/hystrix.stream,与我们在consumer中设置的路径/hystrix.stream不匹配,所以出现/actuator/hystrix.stream 404 Not Found。
聚合hystrix-dashboord输入的地址为http://consumerhost:port/turbine.stream
consumer端引用spring-boot-starter-actuator的情况(推荐)
consumer端暴露/actuator/hystrix.stream,/actuator/info,/actuator/health这3个endpoint,配置文件中加入:
management.endpoints.web.exposure.include=hystrix.stream,health,info
默认值为health,info
hystrix-dashboord输入的地址为http://consumerhost:port/actuator/hystrix.stream
turbine站点配置文件加入:
turbine.appConfig=xxx1,xxx2,xxx3
turbine.instanceUrlSuffix=/actuator/hystrix.stream
/actuator/hystrix.stream为默认地址也可以不写。
聚合hystrix-dashboord输入的地址为http://consumerhost:port/turbine.stream
spring cloud(Greenwich.M2) hystrix dashboard 报/actuator/hystrix.stream 404 Not Found的问题的更多相关文章
- spring cloud hystrix dashboard 没有/actuator/hystrix.stream路径解决
首先我用的是spring boot Greenwich.SR2 在测试hystrix-dashboard监控服务时,发现访问localhost:9001/actuator/hystrix.stream ...
- Spring Cloud Greenwich 正式发布,Hystrix 即将寿终正寝。。
Spring Cloud Greenwich 正式版在 01/23/2019 这天正式发布了,下面我们来看下有哪些更新内容. 生命周期终止提醒 Spring Cloud Edgware Edgware ...
- spring boot 2.0.3+spring cloud (Finchley)4、熔断器Hystrix
在分布式系统中服务与服务之间的依赖错综复杂,一种不可避免的情况就是某些服务会出现故障,导致依赖于他们的其他服务出现远程调度的线程阻塞.某个服务的单个点的请求故障会导致用户的请求处于阻塞状态,最终的结果 ...
- Spring Cloud Greenwich 新特性和F升级分享
2019.01.23 期待已久的Spring Cloud Greenwich 发布了release版本,作为我们团队也第一时间把RC版本替换为release,以下为总结,希望对你使用Spring Cl ...
- Spring Cloud Greenwich.SR4 发布了,跟不上了……
前几天 Spring Cloud Greenwich.SR4 发布了: https://spring.io/blog/2019/11/19/spring-cloud-greenwich-sr4-rel ...
- Bug集锦-Spring Cloud Feign调用其它接口报错
问题描述 Spring Cloud Feign调用其它服务报错,错误提示如下:Failed to instantiate [java.util.List]: Specified class is an ...
- Spring Cloud项目之断路器集群监控Hystrix Dashboard
微服务(Microservices Architecture)是一种架构风格,一个大型复杂软件应用由一个或多个微服务组成.系统中的各个微服务可被独立部署,各个微服务之间是松耦合的.每个微服务仅关注于完 ...
- Spring Cloud系列(四):断路器Hystrix
上一篇介绍了负载均衡的配置方法,做负载均衡是为了保证高可用性,但是有时候服务提供者挂掉了,比如服务A调用了服务B,服务B又调用了服务C,然后有一天服务C的所有节点都挂掉了,这时服务B就会因为C异常而在 ...
- 【spring cloud】spring cloud打包最外层项目报错:'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 9, column 13
OK,spring cloud项目,最外层的父级项目在打包的时候,报错如下: "C:\Program Files\Java\jdk1.8.0_131\bin\java" -Dmav ...
随机推荐
- C#装箱和拆箱。
装箱:值类型-->引用类型. 拆箱:引用类型-->值类型 装箱:把值类型拷贝一份到堆里.反之拆箱. 具有父子关系 是拆装箱的条件之一. 所以: class Program { static ...
- Ubuntu 安装 JDK8 的两种方式
ubuntu 安装jdk 的两种方式: 1:通过ppa(源) 方式安装. 2:通过官网下载安装包安装. 这里推荐第1种,因为可以通过 apt-get upgrade 方式方便获得jdk的升级 使用pp ...
- Python初级面试语法<一>
可变对象与不可变对象 可变对象存的是地址,地址不变,但地址指向的值可以变(引用类型).类型:list.dict.set等 不可变对象直接存值,值变了,就是另一个对象了(值类型).int.float.t ...
- js 点击文本框,预览选择图片
点击文件选择框,选择图片文件,通过FileReader对象,读取图片文件中的内容,存放于result中,具体代码如下 <input type="file" onchange= ...
- JSJ—案例谈面向对象
有人告诉我那里遍地都是对象——我们把所有的程序代码放在main()里面,事实上,那根本就不是面向对象的做法,在Java的面向对象中,我们也会看到类和对象的不同,以及对象是如何让你的生活更美好(至少程序 ...
- Runnable和Callable接口辨析
突然发现和启动一个线程有关的有三函数,run(), call(), start(),有点小乱,所以特别梳理一下 首先说一下start(),这个是最好说的,感觉start()和run()这俩名字是真的有 ...
- SpringBoot 之集成邮件服务.
一.前言 Spring Email 抽象的核心是 MailSender 接口,MailSender 的实现能够把 Email 发送给邮件服务器,由邮件服务器实现邮件发送的功能. Spring 自带了一 ...
- lnmp环境切换php版本,并安装相应redis扩展
ubuntu+nginx+mysql+php+redis,其中php装两个版本,php7和php56 1.让nginx支持不同站点可以选择不同的php版本 1>创建fastcgi.conf文件 ...
- Git学习(二)Git命令
1.创建新的git仓库 初始化一个Git仓库,使用git init命令. 上图中我们新建了目录/home/honey/cxf,并进入目录cxf执行命令git init完成新git仓库的初始化,初始化成 ...
- Python相关机器学习‘武器库’
开始学习Python,之后渐渐成为我学习工作中的第一辅助脚本语言,虽然开发语言是Java,但平时的很多文本数据处理任务都交给了Python.这些年来,接触和使用了很多Python工具包,特别是在文本处 ...