2016-06-07 75 views
1

我在渦輪儀表板上工作時遇到了一些問題。由於我能夠爲給定的集羣獲取渦輪流,但無法在儀表板上看到任何東西,因爲它正在加載,如下面的屏幕截圖所示。如果缺少任何配置,請提供幫助。彈簧渦輪儀表板不工作

下面是我的配置:

config.properties

turbine.aggregator.clusterConfig=SpringHystrixDemo2 
    turbine.instanceUrlSuffix=:9080/hystrix.stream 
    turbine.EurekaInstanceDiscovery.hystrix2.instances=localhost 
    InstanceDiscovery.impl=com.netflix.turbine.discovery.EurekaInstanceDiscovery.class 
    turbine.InstanceMonitor.eventStream.skipLineLogic.enabled=false 

Application.yml

server: 
    port: 8080 

    turbine: 
    aggregator: 
    clusterConfig: SPRINGHYSTRIXDEMO2 
    clusterNameExpression: new String("default") 
    appConfig: SpringHystrixDemo2 

    InstanceMonitor: 
    eventStream: 
    skipLineLogic: 
    enabled: false 

bootstrap.yml

spring: 
    application: 
    name: SpringTurbine 
    cloud: 
    config: 
    discovery: 
    enabled: true 

    eureka: 
    instance: 
    nonSecurePort: ${server.port:8080} 
    client: 
    serviceUrl: 
    defaultZone: http://${eureka.host:localhost}:${eureka.port:8761}/eureka/ 

Application.java

@SpringBootApplication 
    @EnableHystrix 
    @EnableEurekaClient 
    @EnableHystrixDashboard 
    @EnableTurbine 
    public class DemoApplication { 

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

對於集羣SpringHystrixDemo2我已在不同的應用程序被配置它的其他端口上運行:

application.yml -

server: 
    port: 9080 

    hystrix: 
    command: 
    RemoteMessageClientCommand: 
    execution: 
    isolation: 
    thread: 
    timeoutInMilliseconds: 5000 
    RemoteMessageAnnotationClient: 
    execution: 
    isolation: 
    thread: 
    timeoutInMilliseconds: 5000 

bootstrap.yml

spring: 
    application: 
    name: SpringHystrixDemo2 
    cloud: 
    config: 
    enabled: true 
    discovery: 
    enabled: true 
    serviceId: SPRINGCONFIGSERVER 

    eureka: 
    instance: 
    nonSecurePort: ${server.port:9080} 
    client: 
    serviceUrl: 
    defaultZone: http://${eureka.host:localhost}:${eureka.port:8761}/eureka/ 

Application.java - 這是來自hystrix儀表板服務。

@SpringBootApplication 
    @EnableHystrix 
    @EnableHystrixDashboard 
    @EnableEurekaClient 
    @EnableDiscoveryClient 
    public class DemoApplication { 

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

我在8761端口上配置了eureka服務器。這是lisening所有其他尤里卡client.as

Eureka server

這就是我現在無法看到任何渦輪儀表板。因爲它正在被加載。 是我腦海turbine stream view

回答

0

的第一件事是,你可以聲明一個管理端點是這樣的:

management: 
    port: 9081 
    contextPath: /management 

然後透平流將通過{yourHost}是入店:9081 /管理/渦輪機。流,而紅椎儀表盤將在{} yourhost送達:9080 /椎

0

從我讀過的和已知的,從配置

turbine.aggregator.clusterConfig=SpringHystrixDemo2 
turbine.instanceUrlSuffix=:9080/hystrix.stream 
turbine.EurekaInstanceDiscovery.hystrix2.instances=localhost InstanceDiscovery.impl=com.netflix.turbine.discovery.EurekaInstanceDiscovery.class 
turbine.InstanceMonitor.eventStream.skipLineLogic.enabled=false 

以下可能是問題。

你缺少一些配置,也許你還有一些額外的配置。

  1. 除非確實有多個實例,否則不需要「turbine.EurekaInstanceDiscovery.hystrix2.instances」。
  2. 您不需要「turbine.InstanceMonitor.eventStream.skipLineLogic.enabled」,因爲它默認爲false,如果您希望在具有高延遲的情況下使其成爲true,則它是必需的。
  3. 你需要「turbine.appConfig =」。在你的情況下,我認爲它的東西像SpringHystrixDemo2或者也許hystrix2 ...在這裏使用適當的名稱。
  4. 你需要「turbine.aggregator.clusterConfig =」這工作對我來說,只有當我在資本即HYSTRIX2
  5. 使用,如果你在你的服務,「turbine.instanceUrlSuffix.HYSTRIX2 =使用不同的管理端口:/錐。流
  6. 那麼這個「turbine.instanceInsertPort =假」將被禁用渦輪默認端口插入..基本上,你告訴尤里卡不要試圖尋找hystrix.strem當插入它自己的任何端口..

以下是我的物業

#turbine.clusterNameExpression=new String('default') 
#turbine.clusterNameExpression="'default'" 
turbine.instanceInsertPort=false 
turbine.appConfig=service1 
turbine.aggregator.clusterConfig=SERVICE1 
turbine.instanceUrlSuffix.SERVICE1=:51512/hystrix.stream 
#turbine.ConfigPropertyBasedDiscovery.USER.instances=service1-host1.abc.com,service1-host2.abc.com 
InstanceDiscovery.impl=com.netflix.turbine.discovery.EurekaInstanceDiscovery.class 
#for high latencies 
#turbine.InstanceMonitor.eventStream.skipLineLogic.enabled=false 

並試用渦輪機流

http://host:port/turbine.stream?cluster=SERVICE1