1. 程式人生 > >【SpringBoot學習筆記】turbine界面不顯示監控信息——unable to connect to command metric stream

【SpringBoot學習筆記】turbine界面不顯示監控信息——unable to connect to command metric stream

code color boa cti In star 技術 alt pan

[[錯誤現象:]]

界面沒有監控信息,只有一行字:unable to connect to command metric stream ,如下圖:

技術分享圖片

[[可能原因]]:

1)stream地址輸入錯誤,一定要輸入:ip:port/turbine.stream,可能會誤寫成:ip:port/turbine.stream,這樣一來,反復檢查都不容易檢查出問題,因為本身後者在使用hystrix時是沒錯的,但用turbine時就不對了;

2)缺少pom依賴或註解

  依賴項如下:

<dependency>
    <groupId>org.springframework.cloud</
groupId> <artifactId>spring-cloud-starter-turbine</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-netflix-turbine</artifactId> </dependency> <dependency> <
groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>

  註解如下:

@SpringBootApplication
@EnableHystrixDashboard
@EnableTurbine

public class EurekaMonitorClientApplication {
    public static void main(String[] args) {
SpringApplication.run(EurekaMonitorClientApplication.class, args);
}
}
 

【SpringBoot學習筆記】turbine界面不顯示監控信息——unable to connect to command metric stream