springboot 2.0 + spring cloud + hystrix dashboard

springcloud整合hystrix dashboard,打开界面报了不能连接 Unable to connect to Command Metric Stream.,现在整理下几种解决方法:

1. 配置文件暴露端口,填写hystrix地址时,按照single hystrix提示的填写即可

management:
  endpoints:
    web:
      exposure:
        include: "*"

2. 注入Bean,并且访问hystrix地址时,去掉actuator

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

猜你喜欢

转载自blog.csdn.net/sosmmh/article/details/83585750