栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringCloud的Hystrix Dashboard、Turbine的配置

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringCloud的Hystrix Dashboard、Turbine的配置

文章目录
    • 搭建Hystrix Dashboard
      • 命令行启动访问(运行于httpd软件上)
    • Turbine
      • Turbine配置

搭建Hystrix Dashboard
  1. 新建spring模块:sp07-hystrix-dashboard
  2. 配置pom.xml。添加 Hystrix Dashboard

                org.springframework.cloud
                spring-cloud-starter-netflix-hystrix-dashboard

  1. yml配置允许抓取的服务器列表
#eureka 2001,   zuul 3001, hystrix dashboard 4001
server:
  port: 4001
hystrix:
  dashboard:
    #允许抓取日志的服务列表
    proxy-stream-allow-list: localhost
  1. 启动类添加注解:@EnableHystrixDashboard
  2. 访问路径:http://localhost:4001/hystrix
命令行启动访问(运行于httpd软件上)

ab -n 20000 -c 50 http://localhost:3001/item-service/sakjfh464564?token=safd5464
ab -n 20000 -c 50 http://localhost:3001/user-service/8

Turbine

从多台服务器抓取Hystrix日志,进行聚合, hystrix dashboard从Turbine抓取聚合后的日志数据

Turbine配置
  1. 新建spring模块:sp08-turbine
  2. pom.xml:添加Turbine,eureka client

            org.springframework.cloud
            spring-cloud-starter-netflix-eureka-client
        
        
            org.springframework.cloud
            spring-cloud-starter-netflix-turbine
 
  1. yml配置
spring:
  application:
    name: turbine
server:
  port: 5001
eureka:
  client:
    service-url:
      defaultZone: http://eureka1:2001/eureka,http://eureka2:2002/eureka
turbine:
  app-config: zuul
  cluster-name-expression: new String("default")
  1. 启动类注解:@EnableTurbine
  2. 访问http://localhost:5001/turbine.stream
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/672818.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号