【问题解决】SpringCloud Hystrix DashBoard 依赖导入失败 ,Unable to connect to Command Metric Stream.

你使用的依赖是不是:

 
            org.springframework.boot
            spring-boot-starter-actuator
        
        
            org.springframework.cloud
            spring-cloud-starter-hystrix-dashboard
        

 

 

将它替换成:

 

        
            com.netflix.hystrix
            hystrix-javanica
            RELEASE
        
        
            org.springframework.cloud
            spring-cloud-netflix-hystrix-dashboard
        

 

 

【问题解决】SpringCloud Hystrix DashBoard 依赖导入失败 ,Unable to connect to Command Metric Stream._第1张图片

 二、

  1、之所以  Unable to connect to Command Metric Stream.,说明这个端口你访问不到

  第一步:在入口程序做以下配置

    @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;
    }

 

 

第二步:在你的服务中多发送几次请求,多访问服务

【问题解决】SpringCloud Hystrix DashBoard 依赖导入失败 ,Unable to connect to Command Metric Stream._第2张图片

你可能感兴趣的:(#,SpringCloud)