我在Spring Boot 2中尝试了涡轮+ hystrix仪表板。但是我遇到了问题,涡轮仪表板仅显示:
正在加载...
我有正常工作的Eureka服务器和应用程序(发送正确的hystrix.stream)
当我看着turbo.stream时唯一的
: ping
data: {"reportingHostsLast10Seconds":0,"name":"meta","type":"meta","timestamp":1533038381277}
我一直在寻找许多问题,但我无法得到答案。
这是涡轮机pom文件:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>com.netflix.archaius</groupId>
<artifactId>archaius-core</artifactId>
<version>0.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-turbine</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
application.properties
server.port=9090
spring.application.name=turbine-dashboard
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
turbine.app-config=RANDOMNUMBERSERVICE
app
@SpringBootApplication
@EnableDiscoveryClient
@EnableTurbine
@EnableHystrixDashboard
public class TurbineTestApplication {
public static void main(String[] args) {
SpringApplication.run(TurbineTestApplication.class, args);
}
}
答案 0 :(得分:1)
@janusz请附上仪表板的屏幕截图,以更清楚。
这可能意味着:
@HystrixCommand
带注释功能的端点(在您的情况下,我假设它是RANDOMNUMBERSERVICE
应用的端点),以便为仪表板显示数据。RANDOMNUMBERSERVICE
实例[]
。[]
。通常,此问题是由于无法从已配置的实例访问/hystrix.steam而引起的,但您已声明已经接收到流。我建议在您的application.properties
文件中使用以下内容可以纠正此问题:
turbine.appConfig = randomnumberservice
turbine.aggregator.clusterConfig = RANDOMNUMBERSERVICE
最后,请确保您为启用了涡轮的dahboard输入的URL指向仪表板所在的端口。 您的情况应该是:
http://localhost:9090/turbine.stream?cluster=yourclustername