我想从我的涡轮机应用程序中读取在领事注册的服务。我已经为它配置了涡轮机:
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所有这些配置都是在涡轮机应用上完成的。
现在,在consul上注册的每个服务都有依赖关系-
<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,在我们的rest调用方法中使用HystrixCommand,使用适当的回退逻辑调用其他服务。
application.properties:-
spring.application.name=dm-geo现在,我们的python脚本使用所需的配置来发现这些服务并在consul上注册。当我尝试获取每个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"有人能在这方面帮忙吗?
发布于 2016-10-20 18:33:09
对于我们的应用涡轮机,现在已经解决了。基本上,流是通过URL进行身份验证的,所以我必须跳过这一步,这样就可以完美地显示涡轮机流和仪表板。例如:
security.ignored = /turbine.stream在spring boot应用程序中。
https://stackoverflow.com/questions/38612581
复制相似问题