简体   繁体   English

春季启动,尤里卡,hystrix,涡轮:涡轮始终显示0个报告主机

[英]Spring boot, eureka, hystrix, turbine: turbine always shows 0 reporting hosts

I have an implementation of turbine that is able to discover running services via Eureka: 我有一个涡轮实现,能够通过Eureka发现运行中的服务:

2015-09-08 11:40:13.727  INFO 13112 --- [        Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery  : Fetching instance list for apps: [policy-service]
2015-09-08 11:40:13.727  INFO 13112 --- [        Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery  : Fetching instances for app: policy-service
2015-09-08 11:40:13.727  INFO 13112 --- [        Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery  : Received instance list for app: policy-service, size=1
2015-09-08 11:40:13.727  INFO 13112 --- [        Timer-0] c.n.t.discovery.InstanceObservable       : Retrieved hosts from InstanceDiscovery: 1
2015-09-08 11:40:13.728  INFO 13112 --- [        Timer-0] c.n.t.discovery.InstanceObservable       : Found hosts that have been previously terminated: 0
2015-09-08 11:40:13.728  INFO 13112 --- [        Timer-0] c.n.t.discovery.InstanceObservable       : Hosts up:1, hosts down: 0

Hystrix is running on the client app, policy-service. Hystrix在客户端应用程序policy-service上运行。 I am able to view its stream and see it in the hystrix dashboard. 我能够查看其流并在hystrix仪表板中看到它。

The issue is that when I view the Turbine stream, I get this: 问题是,当我查看涡轮流时,得到以下信息:

: ping
data: {"reportingHostsLast10Seconds":0,"name":"meta","type":"meta","timestamp":1441734488823}

and when I view it in the Hystrix dashboard with the URI http://localhost:8095/turbine.stream?cluster=DEV , I just see "Loading..." 当我在Hystrix仪表板中使用URI http://localhost:8095/turbine.stream?cluster=DEV查看它时,我只看到“正在加载...”

I have tried everything mentioned in this post to no avail. 我曾尝试在提到一切职位无济于事。

Here is my turbine services' application.yml: 这是我的涡轮机服务的application.yml:

turbine:
  aggregator:
    clusterNameExpression: new String("default")
    clusterConfig: DEV
    #http://localhost:8095/turbine.stream?cluster=DEV
  appConfig: policy-service
  InstanceMonitor:
    eventStream:
      skipLineLogic:
        enabled: false

I've tried this without clusterConfig and without clusterNameExpression. 我已经尝试过在没有clusterConfig和clusterNameExpression的情况下使用。

Here's my bootstrap.yml: 这是我的bootstrap.yml:

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
spring:
  application:
    name: turbine-service
server:
  port: 8095

And here is my source: 这是我的资料来源:

package com.ml.turbine;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.turbine.EnableTurbine;

@SpringBootApplication
@EnableTurbine
@EnableEurekaClient
public class TurbineService {

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

When I hit my turbine stream in browser, the log reads: 当我在浏览器中点击涡轮流时,日志显示为:

2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.s.servlet.TurbineStreamServlet     : FilterCriteria: []
2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.s.servlet.TurbineStreamServlet     : StatsType filters: []
2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.s.TurbineStreamingConnection       : Relevance config: []
2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.s.TurbineStreamingConnection       : Relevance metrics config: {}
2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.monitor.cluster.ClusterMonitor     : Registering event handler for cluster monitor: StreamingHandler_92386c8c-b263-4548-be07-10c1a2a3dc27
2015-09-08 14:03:19.967  INFO 12024 --- [nio-8095-exec-4] c.n.t.handler.TurbineDataDispatcher      : 

Just added and starting handler tuple: StreamingHandler_92386c8c-b263-4548-be07-10c1a2a3dc27
2015-09-08 14:03:19.968  INFO 12024 --- [nio-8095-exec-4] c.n.turbine.data.AggDataFromCluster      : Per handler dispacher started for: StreamingHandler_92386c8c-b263-4548-be07-10c1a2a3dc27
2015-09-08 14:03:19.973  INFO 12024 --- [nio-8095-exec-4] c.n.t.monitor.cluster.ClusterMonitor     : All event handlers for cluster monitor: [StreamingHandler_92386c8c-b263-4548-be07-10c1a2a3dc27, StreamingHandler_deaba37e-b712-49db-beba-ab9f60848118, StaticListener_For_Aggregator, StreamingHandler_42896dd8-5d90-43c2-89ad-f57151b94894]
2015-09-08 14:03:19.974  INFO 12024 --- [nio-8095-exec-4] c.n.t.monitor.cluster.ClusterMonitor     : Starting up the cluster monitor for DEV_agg

Why am I getting nothing in my turbine stream when it is connected to the policy-service and the hystrix stream works as it should? 当涡轮机流连接到策略服务并且hystrix流正常工作时,为什么涡轮流中什么也没得到?

It turns out that my application.yml was configured wrong. 原来我的application.yml配置错误。

From here : 这里

The clusterName can be customized by a SPEL expression in turbine.clusterNameExpression with root an instance of InstanceInfo. 可以通过turbo.clusterNameExpression中的SPEL表达式来自定义InstanceInfo的实例来自定义clusterName。 The default value is appName, which means that the Eureka serviceId ends up as the cluster key (ie the InstanceInfo for customers has an appName of "CUSTOMERS"). 默认值为appName,这意味着Eureka serviceId最终作为集群键(即,客户的InstanceInfo的appName为“ CUSTOMERS”)。

My application.yml now looks like this: 我的application.yml现在看起来像这样:

turbine:
  aggregator:
    clusterNameExpression: new String("default")
    clusterConfig: POLICY-SERVICE
    #http://localhost:8095/turbine.stream?cluster=POLICY-SERVICE
  appConfig: policy-service

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Boot + Eureka Server +带涡轮机的Hystrix:空涡轮机 - Spring Boot + Eureka Server + Hystrix with Turbine: empty turbine.stream 如何在春季启动时为每个eureka应用程序配备一个涡轮机集群? - how to have a turbine cluster for each eureka app in spring boot? Hystrix和Turbine不适用于Spring Boot 2和Spring Cloud Finchley.M8 - Hystrix and Turbine does not work with Spring boot 2 and Spring cloud Finchley.M8 Spring Netflix Hystrix Turbo.stream 按集群过滤不起作用 - Spring Netflix Hystrix turbine.stream filter by cluster does not work hystrix.stream,management.port和Spring Cloud Turbine - hystrix.stream, management.port and Spring Cloud Turbine Hystrix / Turbine仪表板上有多项服务? - Multiple services on a Hystrix/Turbine dashboard? 涡轮不适用于弹簧靴2.0.6和弹簧云Finchley.SR1 - Turbine not working with spring boot 2.0.6 and spring cloud Finchley.SR1 如何在Turbine中添加其他Hystrix指标聚合 - How to add into Turbine additional Hystrix metrics aggregations Spring Cloud涡轮-/turbine.stream没有返回数据 - Spring Cloud turbine - No data returned from /turbine.stream 无法连接到 Spring Cloud + Hystrix + Turbine 中的命令指标 Stream - 不是“文本/事件流”的 MIME 类型(“文本/纯文本”) - Unable to connect to Command Metric Stream in Spring Cloud + Hystrix + Turbine - MIME type ("text/plain") that is not "text/event-stream"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM