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的问题的更多相关文章

  1. spring cloud hystrix dashboard 没有/actuator/hystrix.stream路径解决

    首先我用的是spring boot Greenwich.SR2 在测试hystrix-dashboard监控服务时,发现访问localhost:9001/actuator/hystrix.stream ...

  2. Spring Cloud Greenwich 正式发布,Hystrix 即将寿终正寝。。

    Spring Cloud Greenwich 正式版在 01/23/2019 这天正式发布了,下面我们来看下有哪些更新内容. 生命周期终止提醒 Spring Cloud Edgware Edgware ...

  3. spring boot 2.0.3+spring cloud (Finchley)4、熔断器Hystrix

    在分布式系统中服务与服务之间的依赖错综复杂,一种不可避免的情况就是某些服务会出现故障,导致依赖于他们的其他服务出现远程调度的线程阻塞.某个服务的单个点的请求故障会导致用户的请求处于阻塞状态,最终的结果 ...

  4. Spring Cloud Greenwich 新特性和F升级分享

    2019.01.23 期待已久的Spring Cloud Greenwich 发布了release版本,作为我们团队也第一时间把RC版本替换为release,以下为总结,希望对你使用Spring Cl ...

  5. Spring Cloud Greenwich.SR4 发布了,跟不上了……

    前几天 Spring Cloud Greenwich.SR4 发布了: https://spring.io/blog/2019/11/19/spring-cloud-greenwich-sr4-rel ...

  6. Bug集锦-Spring Cloud Feign调用其它接口报错

    问题描述 Spring Cloud Feign调用其它服务报错,错误提示如下:Failed to instantiate [java.util.List]: Specified class is an ...

  7. Spring Cloud项目之断路器集群监控Hystrix Dashboard

    微服务(Microservices Architecture)是一种架构风格,一个大型复杂软件应用由一个或多个微服务组成.系统中的各个微服务可被独立部署,各个微服务之间是松耦合的.每个微服务仅关注于完 ...

  8. Spring Cloud系列(四):断路器Hystrix

    上一篇介绍了负载均衡的配置方法,做负载均衡是为了保证高可用性,但是有时候服务提供者挂掉了,比如服务A调用了服务B,服务B又调用了服务C,然后有一天服务C的所有节点都挂掉了,这时服务B就会因为C异常而在 ...

  9. 【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 ...

随机推荐

  1. 从零开始学安全(十六)● Linux vim命令

    游标控制 h 游标向左移 j 游标向下移 k 游标向上移 l (or spacebar) 游标向右移 w 向前移动一个单词 b 向后移动一个单词 e 向前移动一个单词,且游标指向单词的末尾 ( 移到当 ...

  2. 【微服务No.3】AOP组件ASPectCore简单使用

    介绍: AspectCore是.NET标准的基于AOP的跨平台框架[github解释].主要支持:对方面拦截器,依赖注入集成,Web应用程序,数据验证等的核心支持. 使用实例: 首先安装dll: In ...

  3. 4:Python的while循环

    while循环: while count<10: print(count) #count=100 count=count+1 print(123) while循环break:终止所有循环 cou ...

  4. JavaScript 基础(四) - HTML DOM Event

    HTML DOM Event(事件) HTML 4.0 的新特性之一是有能力使 HTML 事件触发浏览器中的动作(action),比如当用户点击某个 HTML 元素时启动一段 JavaScript.下 ...

  5. CSS3动画属性:动画(animation)

    一:动画(animation)的参数详解 由于上面用到了animation动画,这里详细介绍下这个animation的参数. 简介 CSS动画(Animations)简单说就是在一段固定的动画时间内暗 ...

  6. Python运维开发:运算符与数据类型(二)

    python对象的相关术语: python程序中保存的所有数据都是围绕对象这个概念展开的: 程序中存储的所有数据都是对象 每个对象都有一个身份.一个类型和一个值 例如,school='MaGe Lin ...

  7. 网络基础 记一次HTTPS证书验证测试过程

    记一次HTTPS证书验证测试过程 by:授客 QQ:1033553122 实践 1) 安装证书 选择主机A(假设10.202.95.88)上安装https证书 说明:采用https的服务器,必须安装数 ...

  8. Android 设计模式对比

    引言: Android框架的发展的过程就是一个不断化繁为简的过程,大家都在研究如何正确方便高效的规范代码.当然这条路也永远不会停止,就像新的芽儿,随着时间的流逝,每天都在长出新的枝叶,每天都在成长.对 ...

  9. celery 任务队列 + redis

    Celery 是一个“自带电池”的的任务队列.它易于使用,所以你可以无视其所解决问题的复杂程度而轻松入门.它遵照最佳实践设计,所以你的产品可以扩展,或与其他语言集成,并且它自带了在生产环境中运行这样一 ...

  10. (网页)HTML5

    1.html5基本格式: <!DOCTYPE> --> 文档类型声明. <html lang="zh-cn"> --> 表示html文档开始 & ...