上一篇文章当中,使用“Hystrix Dashboard”进行单体应用的监控,其实没有多大的意义,在实际应用中,我们要监控的应用往往是一个集群,这个时候我们就得采取Turbine集群监控了。Turbine有一个重要的功能就是汇聚监控信息,并将汇聚到的监控信息提供给Hystrix Dashboard来集中展示和监控。那我们就来看看Turbine集群监控如何使用。
本章是基于上一章的基础上进行实现,需要4个微服务应用程序,一个Eureka Server服务注册中心(spring-cloud-eureka-server);两个Hystrix Dashboard(spring-cloud-hystrix-dashboard-1和spring-cloud-hystrix-dashboard-2),spring-cloud-hystrix-dashboard-2的项目和spring-cloud-hystrix-dashboard-1一样;一个Hystrix Turbine(spring-cloud-hystrix-turbine)。
如下:
spring-cloud-eureka-server:8080
spring-cloud-hystrix-dashboard-1:8081
spring-cloud-hystrix-dashboard-2:8082
spring-cloud-hystrix-turbine:8083
第一步:创建一个普通的Spring Boot工程
spring-cloud-eureka-server、spring-cloud-hystrix-dashboard-1和spring-cloud-hystrix-dashboard-2创建工程不再重述,具体创建