タービンアプリケーションからコンサルに登録されているサービスを読みたいと思います。私はそのよう用のタービンを設定している:スプリングコンサルタントタービンエラー - ホストへの接続を開始できませんでした:[]
Bootstrap.yml
server:
port: 8050
spring:
cloud:
consul:
discovery:
prefer-ip-address: true
host: *****hostName where consul reside****
port: 8500
turbine:
aggregator:
clusterConfig: dm-geo
appConfig: dm-geo
が持つ依存関係 -
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
メインアプリケーションクラスに -
@EnableTurbine
@EnableHystrixDashboard
@EnableDiscoveryClient
これらは、すべての設定がオンに行われていますタービン用途。アプリケーションクラスの
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
と @EnableHystrix
@EnableDiscoveryClient
HystrixCommand
との安静時の適切なフォールバックロジックを持つ他のサービスへのメソッドを呼び出す -
は今領事に登録されている各サービスは、依存関係を持っています。
application.properties:-
spring.application.name=dm-geo
今、必要な設定を持つ私たちのPythonスクリプトは、これらのサービスを発見し、領事に登録。 各hystrix.streamを取得しようとすると、そのためにhystrixダッシュボードを取得できます。
が、私のタービンアプリケーションから、エラーが
"timestamp":"2016-07-27T17:33:14.406+05:30","message":"Could not initiate connection to host, giving up,"logger_name":"com netflix turbine monitor instance InstanceMonitor","thread_name":"InstanceMonitor"
としてログインしている誰かが、この点で助けることができます?
spring.application.nameはbootstrap.propertiesに移動する必要がありますか? – spencergibb
はい、今日私はこれに取り組んだ。今解決されています。私たちのアプリケーションの場合、turbine.streamは認証されたURLだったので、これをスキップしてタービンストリームとダッシュボードを完全に表示する必要がありました。 as security.ignored = URLパスです。 – jagmohansharma