[hystrix] hystrix-dashboard 关于 Unable to connect to Command Metric Stream 的问题解决方法

问题#

在hystrix-dashboard界面中出现以下错误

解决方法#

  1. 高版本(具体哪些版本之后我不知道,加上去试试)springcloud需要加以下配置(在被监控一端):
@Configuration
public class HystrixConfig {
    @Bean
    public ServletRegistrationBean getServlet() {
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }
}
  1. 被监控端pom文件添加以下依赖:
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
  1. 在被监控端配置文件添加以下配置(开放以下actuator监控权限):
management:
  endpoints:
    web:
      exposure:
        include: ["health","info","hystrix.stream"]
  1. 在hashboard端配置文件添加以下配置(运行访问熔断监控页面的地址):
hystrix:
  dashboard:
    proxy-stream-allow-list: "localhost"
  1. 还不行就再google吧...然后解决了就在底下更新

Extra#

hystrix hashboard 不需要 eureka

作者:javanoob0660

出处:https://www.cnblogs.com/javanoob0660/p/16729536.html

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

posted @   丘丘CRUD  阅读(72)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
more_horiz
keyboard_arrow_up dark_mode palette
选择主题
menu
点击右上角即可分享
微信分享提示