In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "Spring Cloud how to achieve circuit breaker aggregation monitoring", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Spring Cloud how to achieve circuit breaker aggregation monitoring" this article.
A brief introduction to Hystrix Turbine
There is not much value in looking at the data of a single Hystrix Dashboard, and you need to use Hystrix Turbine to see the Hystrix Dashboard data of this system. Hystrix Turbine consolidates Hystrix Dashboard data for each service. The use of Hystrix Turbine is very simple, as long as the appropriate dependencies are introduced and annotated and configured.
II. Preparatory work
The project used in this paper is the project of the previous article, and the transformation is carried out on this basis. Because we need the Dashboard of multiple services, we need to build another service named service-lucy. Its basic configuration is the same as service-hi. For more information, please see the source code.
Third, create a service-turbine
Introduce the corresponding dependencies:
Org.springframework.cloud spring-cloud-starter-turbine org.springframework.cloud spring-cloud-netflix-turbine org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-test test
Add the annotation @ EnableTurbine to its entry class ServiceTurbineApplication, and enable the turbine,@EnableTurbine annotation to include the @ EnableDiscoveryClient annotation, that is, to enable the registration service.
@ SpringBootApplication@EnableTurbinepublic class ServiceTurbineApplication {public static void main (String [] args) {new SpringApplicationBuilder (ServiceTurbineApplication.class) .web (true) .run (args);}}
Profile application.yml:
Spring: application.name: service-turbineserver: port: 8769security.basic.enabled: falseturbine: aggregator: clusterConfig: default # specifies which clusters to aggregate, and multiple clusters are split using ",". The default is default. You can use one of the http://.../turbine.stream?cluster={clusterConfig} to access the serviceId list in appConfig: service-hi,service-lucy # configuration Eureka, indicating which services to monitor clusterNameExpression: new String ("default") # 1. ClusterNameExpression specifies the cluster name, and the default expression appName; at this time: turbine.aggregator.clusterConfig needs to configure the name of the application you want to monitor # 2. When clusterNameExpression: default, turbine.aggregator.clusterConfig does not have to write, because the default is default # 3. When clusterNameExpression: metadata ['cluster'], assume that the application you want to monitor is configured with eureka.instance.metadata-map.cluster: ABC, then you need to configure it, and turbine.aggregator.clusterConfig: ABCeureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/
The notes to the configuration file are very clear.
IV. Turbine demonstration
Open the eureka-server, service-hi, service-lucy, and service-turbine projects in turn.
Open the browser and enter: the http://localhost:8769/turbine.stream, interface is as follows:
Request in turn:
Http://localhost:8762/hi?name=forezp
Http://localhost:8763/hi?name=forezp
Open: http://localhost:8763/hystrix, input monitoring stream http://localhost:8769/turbine.stream
Click monitor stream to enter the page:
You can see that this page aggregates the hystrix dashbord data of two service.
The above is all the contents of the article "how to realize the aggregation and Monitoring of Circuit Breakers in Spring Cloud". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.