1. 程式人生 > >springboot 2.0 + spring cloud + hystrix dashboard

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