我有一个作为涡轮服务器和 Hystrix 仪表板的 Spring Cloud 应用程序。它有一个 Eureka 客户端,仪表板正常运行,可以看到一个单独的 Hystrix 流,但我在涡轮流中没有得到任何东西。
这是 application.yml:
eureka:
client:
serviceUrl:
defaultZone: ${vcap.services.eureka-service.credentials.uri:http://10.12.2.99:8761}/eureka/
turbine:
aggregator:
clusterConfig: ITEMS-SERVICE
appConfig: items-service
如果我在 Turbine/dashboard 应用程序启动时查看日志,它看起来好像发现我的 Hystrix 服务正常:
2015-03-10 14:45:35.256 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Fetching instance list for apps: [items-service]
2015-03-10 14:45:35.257 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Fetching instances for app: items-service
2015-03-10 14:45:35.257 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Received instance list for app: items-service, size=2
2015-03-10 14:45:35.264 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Retrieved hosts from InstanceDiscovery: 2
2015-03-10 14:45:35.265 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Found hosts that have been previously terminated: 0
2015-03-10 14:45:35.265 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:2, hosts down: 0
2015-03-10 14:45:35.270 INFO 1383 --- [ Timer-0] c.n.t.monitor.instance.InstanceMonitor : Url for host: http://nf-app1:8080/hystrix.stream ITEMS-SERVICE
2015-03-10 14:45:35.270 INFO 1383 --- [ Timer-0] c.n.t.handler.TurbineDataDispatcher :
Just added and starting handler tuple: ITEMS-SERVICE_agg_aggClusterEventHandler
2015-03-10 14:45:35.271 INFO 1383 --- [ Timer-0] c.n.turbine.data.AggDataFromCluster : Per handler dispacher started for: ITEMS-SERVICE_agg_aggClusterEventHandler
2015-03-10 14:45:35.273 INFO 1383 --- [ Timer-0] c.n.t.monitor.instance.InstanceMonitor : Url for host: http://nf-app2:8080/hystrix.stream ITEMS-SERVICE
如果我在
http://localhost:8080/turbine.stream?cluster=ITEMS-SERVICE
我得到:
: ping
data: {"timestamp":1426018670641,"name":"meta","reportingHostsLast10Seconds":0,"type":"meta"}
: ping
data: {"timestamp":1426018673643,"name":"meta","reportingHostsLast10Seconds":0,"type":"meta"}
: ping
data: {"timestamp":1426018676645,"name":"meta","reportingHostsLast10Seconds":0,"type":"meta"}
当我查看涡轮机/仪表板日志时,我没有看到任何错误:
2015-03-10 14:48:33.804 INFO 1383 --- [nio-8080-exec-1] c.n.t.s.servlet.TurbineStreamServlet : FilterCriteria: []
2015-03-10 14:48:33.804 INFO 1383 --- [nio-8080-exec-1] c.n.t.s.servlet.TurbineStreamServlet : StatsType filters: []
2015-03-10 14:48:33.808 INFO 1383 --- [nio-8080-exec-1] c.n.t.s.TurbineStreamingConnection : Relevance config: []
2015-03-10 14:48:33.808 INFO 1383 --- [nio-8080-exec-1] c.n.t.s.TurbineStreamingConnection : Relevance metrics config: {}
2015-03-10 14:48:33.809 INFO 1383 --- [nio-8080-exec-1] c.n.t.monitor.cluster.ClusterMonitor : Registering event handler for cluster monitor: StreamingHandler_f1b7fc33-d0ed-4206-9976-fd4b2347bdd5
2015-03-10 14:48:33.809 INFO 1383 --- [nio-8080-exec-1] c.n.t.handler.TurbineDataDispatcher :
Just added and starting handler tuple: StreamingHandler_f1b7fc33-d0ed-4206-9976-fd4b2347bdd5
2015-03-10 14:48:33.809 INFO 1383 --- [nio-8080-exec-1] c.n.turbine.data.AggDataFromCluster : Per handler dispacher started for: StreamingHandler_f1b7fc33-d0ed-4206-9976-fd4b2347bdd5
2015-03-10 14:48:33.809 INFO 1383 --- [nio-8080-exec-1] c.n.t.monitor.cluster.ClusterMonitor : All event handlers for cluster monitor: [StaticListener_For_Aggregator, StreamingHandler_f1b7fc33-d0ed-4206-9976-fd4b2347bdd5]
2015-03-10 14:48:33.809 INFO 1383 --- [nio-8080-exec-1] c.n.t.monitor.cluster.ClusterMonitor : Starting up the cluster monitor for ITEMS-SERVICE_agg
2015-03-10 14:48:35.265 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Fetching instance list for apps: [items-service]
2015-03-10 14:48:35.266 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Fetching instances for app: items-service
2015-03-10 14:48:35.266 INFO 1383 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Received instance list for app: items-service, size=2
2015-03-10 14:48:35.266 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Retrieved hosts from InstanceDiscovery: 2
2015-03-10 14:48:35.266 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Found hosts that have been previously terminated: 0
2015-03-10 14:48:35.267 INFO 1383 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:2, hosts down: 0
如果我直接或通过仪表板(例如http://nf-app1:8080/hystrix.stream )点击其中一个项目流,我将获得有效的 Hystrix 数据 。
看起来 Turbine 应用程序正在通过 Eureka 找到这两个项目服务,并且它们的 Hystrix 流端点是有效的并且可以工作,所以我无法弄清楚为什么 Turbine 流是空的。