Cloud Foundry上的多个应用实例未显示在Netflix Hystrix仪表板中

时间:2017-08-23 09:08:12

标签: cloudfoundry netflix-eureka spring-cloud-netflix turbine

我已经在Cloud Foundry上设置了Netflix Eureka,Hystrix和Turbine分为两个应用程序:

监控应用程序“mrc-service”包括Eureka Server,Turbine和Hystrix Dashboard。这个应用程序的application.yml看起来像这样:

<your-child-component (mouseMoveEmitter)="onmousemove($event)"</your-child-component>

Hystrix流生成应用程序“log-test”在Cloud Foundry上有多个实例。该应用程序是Eureka客户端,使用Spring Actuator公开Hystrix流。这里app的application.yml:

---
spring:
  profiles: cloud
eureka:
  instance:
    nonSecurePort: 80
    hostname: ${vcap.application.uris[0]}
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
  client:
    registerWithEureka: true
    fetchRegistry: true
    service-url:
      defaultZone: https://mrc-service.myurl/eureka/

turbine:
  aggregator:
    clusterConfig: LOG-TEST
  appConfig: log-test

log-test app的两个实例正确地注册了Eureka服务器:

Successful Eureka client registration

但是当我开始监控涡轮机流时,Hystrix仪表板只显示一个主机(如红色箭头所示)而不是两个:

Hystrix dashboard shows only one host instead of two

Turbine日志正确检索两个实例,但随后说只有一个主机启动:

---
spring:
  profiles: cloud
eureka:
  instance:
    nonSecurePort: 80
    hostname: ${vcap.application.uris[0]}
    metadataMap:
      instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
    secure-port-enabled: true
  client:
    healthcheck:
        enabled: true
    service-url:
      defaultZone: https://mrc-service.myurl/eureka/

所以我想知道Turbine是否实际聚合了两个实例的Hystrix流。涡轮机必须联系实例,例如使用Cloud Foundry特定的标头参数,如X-CF-APP-INSTANCE。不确定这是否已经发生。

所描述的方法在Cloud Foundry上是否可行,或者我是否必须使用Turbine Stream和RabbitMQ?

2 个答案:

答案 0 :(得分:0)

要以总体方式打开Turbine,它与Hystrix的步骤相同,但您应通过Turbine通知集群:http://localhost:8989// turbine.stream?cluster=READ。

这将打开与Hystrix相同的屏幕,但如果我有更多服务,它们将以聚合方式显示。

答案 1 :(得分:0)

我从Spring Cloud Netflix问题跟踪器获得了官方reply:Cloud Foundry上多个应用实例的Hystrix数据汇总需要Turbine Stream与代理(例如RabbitMQ)结合使用。

相关问题