SpringCloud——turbine

目录​​​​​​​

TurbineDoc & 前言

TurbineServer

TurbineServer注册到eureka

TurbineServer监控

TurbineServer——Hystrix & homePageUrl

 TurbineServer——Turbine & turbine.instanceUrlSuffix

TurbineServer——hystrix & management.port

TurbineServer总结


  • TurbineDoc & 前言

前言:turbine是监控整个集群

https://projects.spring.io/spring-cloud/spring-cloud.html#_circuit_breaker_hystrix_clients

  • TurbineServer

  1. 1 pom.xml
<dependencies>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-turbine</artifactId>
	</dependency>
</dependencies>
  1. 2 启动类@EnableTurbine
@EnableTurbine
@SpringBootApplication
public class TurbineApplication {
  public static void main(String[] args) {
    SpringApplication.run(TurbineApplication.class, args);
  }
}
  1. 3 application.yml
server:
  port: 8031
spring:
  application:
    name: microservice-hystrix-turbine
eureka:
  client:
    serviceUrl:
      defaultZone: http://user:password123@localhost:8761/eureka
  instance:
    prefer-ip-address: true
turbine:
  aggregator:
    clusterConfig: microservice-consumer-movie-ribbon-with-hystrix
  appConfig: customers
  • TurbineServer注册到eureka

Application AMIs Availability Zones Status
MICROSERVICE-CONSUMER-MOVIE-RIBBON-WITH-HYSTRIX n/a (1) (1) UP (1) - MTC-20180821VUN:microservice-consumer-movie-ribbon-with-hystrix:8010
MICROSERVICE-HYSTRIX-TURBINE n/a (1) (1) UP (1) - MTC-20180821VUN:microservice-hystrix-turbine:8031
MICROSERVICE-PROVIDER-USER n/a (1) (1) UP (1) - microservice-provider-user:192.168.4.160:7900
  • TurbineServer监控

1.1 http://192.168.4.160:8031/turbine.stream?cluster=microservice-consumer-movie-ribbon-with-hystrix(按照上述仅仅监控了microservice-consumer-movie-ribbon-with-hystrix如果将全部服务名称都写上的话,则问号自身和后面都不需要,浏览器会一直ping,但是无结果)

1.2 访问ribbon-with-hystrix 接口 http://192.168.4.160:8010/movie/1

1.3 1.1出结果了但是有一定的延迟<如何查看数据呢?>hystrix dashboard

1.4 hystrix-dashboard项目启动,打开localhost:port/hystrix,将1.1路径复制输入,Title: Turbine

问:如何证明turbine是监控整个集群的呢?

答:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值