Turbine

当前服务实例的监控状况,让这个监控的数据可视化,他往往是集群部署的,单个实例的话意义不大,Turbine他可以做监控数据的聚合,他可以监控整个集群https://cloud.spring.io/spring-cloud-static/spring-cloud-netflix/2.1.0.M3/single/
spring-cloud-netflix.html#_turbine5.2 Turbine他不是一个从无到有的过程,他已经是一个特殊状况了,所以我就不按照文档进行讲解了Spring Cloud provides a spring-cloud-starter-netflix-turbine that has all the dependencies you need to get a Turbine server running. To ad Turnbine, create a Spring Boot application and annotate it with @EnableTurbine.你要写一个turbine server的话,加上这个就包括了一切依赖,turbine需要注册到eureka上面去localhost:8031/turbine.stream?cluster=microservice-consumer-movie-ribbon-hystrixlocalhost:8010/movie/1localhost:8031/turbine.stream?cluster=testhttps://blog.csdn.net/liaokailin/article/details/51344281localhost:8030/hystrixhttps://www.jianshu.com/p/5a5edd323506turbine是监控整个集群的,turbine从eurka获取多个节点本来就是有延迟的,所以是准实时的监控结果,有一定的延迟,断路器的状态是关闭的,这个他可以捕获到,查看个别实例,Hystrix查的是单个实例,集群环境下有什么用呢,意义不大,它是一个应用,他可以聚合,聚合到一个turbine stream,访问turbine.stream,组合的数据,可以放到hystrix dashboard里面去用,其实可以通过Eureka去定位到某个实例的,他说我这个东西怎么用呢,加上依赖Looking at an individual instance’s Hystrix data is not very useful in terms of the overall health of the system. Turbine is an application that aggregates all of the relevant /hystrix.stream endpoints into a combined /turbine.stream for use in the Hystrix Dashboard. Individual instances are located through Eureka. Running Turbine requires annotating your main class with the @EnableTurbine annotation (for example, by using spring-cloud-starter-netflix-turbine to set up the classpath). All of the documented configuration properties from the Turbine 1 wiki apply. The only difference is that the turbine.instanceUrlSuffix does not need the port prepended, as this is handled automatically unless turbine.instanceInsertPort=false.它会看每一个hystrix.stream这个终端https://cloud.spring.io/spring-cloud-static/spring-cloud-netflix/2.1.0.M3/single/
spring-cloud-netflix.html#_turbineBy default, Turbine looks for the /hystrix.stream endpoint on a registered instance by looking up its hostName and port entries in Eureka and then appending /hystrix.stream to it. If the instance’s metadata contains management.port, it is used instead of the port value for the /hystrix.stream endpoint. By default, the metadata entry called management.port is equal to the management.port configuration property. It can be overridden though with following configuration:/*** Gets the relative home page URL Path for this instance. The home page URL is then* constructed out of the hostName and the type of communication - secure or unsecure.** It is normally used for informational purposes for other services to use it as a* landing page.*/
private String homePageUrlPath = "/";默认是/org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean.statusPageUrl

4.0.0microservice-hystrix-turbine0.0.1-SNAPSHOTjarmicroservice-hystrix-turbineDemo project for Spring Bootcn.learnmicrocloud020.0.1UTF-8UTF-81.8org.springframework.cloudspring-cloud-starter-turbineorg.springframework.bootspring-boot-maven-plugin
package com.learn.cloud;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.turbine.EnableTurbine;@SpringBootApplication
@EnableTurbine
public class TurbineApplication {public static void main(String[] args) {SpringApplication.run(TurbineApplication.class, args);}
}

 


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部