【问题标题】:Netflix Turbine does not display cluster hystrix streamNetflix Turbine 不显示集群 hystrix 流
【发布时间】:2017-07-10 15:48:53
【问题描述】:

我尝试使用 Netflix Turbine (1.1.5) 对 hystrix (1.1.5) 流进行分组。

涡轮应用配置:

spring.application.name=moritoring_server
server.port=8989

eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka eureka.instance.preferIpAddress=true

turbine.aggregator.clusterConfig=MPI_Services Turbo.appconfig=MPI_Services

使用hystrix的Healthy-checks App需要显示在Turbine Dashboard中:

spring.application.name=health_checks_service
spring.cloud.config.enabled=true
spring.cloud.config.discovery.enabled=true
spring.cloud.config.discovery.serviceId=MPI_Services
server.port=8081

eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka
eureka.instance.preferIpAddress=true
eureka.instance.metadataMap.cluster=MPI_Services

我可以看到来自 Eureka 的集群如下,来自 Turbine 的单个 Hystrix 流很好,

但是,我不能在 Turbine 流中使用集群,而且它似乎一直在加载,

有人可以告诉我如何解决这个问题吗?

谢谢, 肖恩

【问题讨论】:

    标签: spring-boot spring-cloud-netflix netflix


    【解决方案1】:

    这里有几点要检查。

    1) 您正在监控的应用程序在端口 8081 上提供 hystrix.stream。尝试在应用程序中将 eureka.instance.metadataMap.management.port 设置为 8081,以便 Turbine 能够找出正确的端口。详情请查看this one

    2) 我会尽量避免在集群名称中混合大小写字母

    3) 在查看 Hystrix Dashboard 以支持 Turbine 流时,请确保调用演示应用程序以便生成一些统计信息。在第一条消息通过 Hystrix 命令之前,仪表板一直为空(正在加载)

    4) 等到 Turbine 应用程序真正发现应用程序集群(检查 Turbine 应用程序日志中的“Found hosts”和“Hosts up”消息)。这会在某个超时间隔后发生,而不是在应用程序启动后立即发生

    这是一个适用于 Spring Cloud Dalston.SR1 的配置

    演示应用程序.yml:

    management:
      security:
        enabled: false
      port: 8081
    
    hystrix:
      enabled: true
    

    演示 bootstrap.yml:

    spring:
      application:
        name: demo-service
      cloud:
        config:
          discovery:
            enabled: true
            serviceId: config-service
    
    eureka:
      client:
        register-with-eureka: false
        serviceUrl:
          defaultZone: http://localhost:8761/eureka/
      instance:
        hostname: ${APPLICATION_DOMAIN:localhost}
        nonSecurePort: 8090
        metadataMap:
          management.port: 8082
    

    Hystrix Dashboard & Turbine bootstrap.yml

    spring:
      application:
        name: hystrix-service
      cloud:
        config:
          discovery:
            enabled: true
            serviceId: config-service
    
    eureka:
      client:
        register-with-eureka: false
        serviceUrl:
          defaultZone: http://localhost:8761/eureka/
    

    Hystrix Dashboard & Turbine application.yml

    ...
    turbine:
      aggregator:
        clusterConfig: DEMO-SERVICE
      appConfig: demo-service
    

    解决方案的所有部分都启动后,Hystrix 仪表板可在

    http://localhost:8989/hystrix
    

    然后使用的 Turbine 流 URL 是

    http://localhost:8989/turbine.stream?cluster=DEMO-SERVICE
    

    仪表板的完整 Hystrix Dashboard 和 Turbine URL:

    http://localhost:8989/hystrix/monitor?stream=http%3A%2F%2Flocalhost%3A8989%2Fturbine.stream%3Fcluster%3DDEMO-SERVICE
    

    【讨论】:

      猜你喜欢
      • 2015-12-10
      • 1970-01-01
      • 2015-09-28
      • 2017-09-10
      • 2017-10-24
      • 2016-02-29
      • 2017-03-07
      • 2014-05-20
      • 2018-07-07
      相关资源
      最近更新 更多