- 搭建Hystrix Dashboard
- 命令行启动访问(运行于httpd软件上)
- Turbine
- Turbine配置
- 新建spring模块:sp07-hystrix-dashboard
- 配置pom.xml。添加 Hystrix Dashboard
org.springframework.cloud spring-cloud-starter-netflix-hystrix-dashboard
- yml配置允许抓取的服务器列表
#eureka 2001, zuul 3001, hystrix dashboard 4001
server:
port: 4001
hystrix:
dashboard:
#允许抓取日志的服务列表
proxy-stream-allow-list: localhost
- 启动类添加注解:@EnableHystrixDashboard
- 访问路径:http://localhost:4001/hystrix
ab -n 20000 -c 50 http://localhost:3001/item-service/sakjfh464564?token=safd5464
ab -n 20000 -c 50 http://localhost:3001/user-service/8
从多台服务器抓取Hystrix日志,进行聚合, hystrix dashboard从Turbine抓取聚合后的日志数据
Turbine配置- 新建spring模块:sp08-turbine
- pom.xml:添加Turbine,eureka client
org.springframework.cloud spring-cloud-starter-netflix-eureka-client org.springframework.cloud spring-cloud-starter-netflix-turbine
- 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")
- 启动类注解:@EnableTurbine
- 访问http://localhost:5001/turbine.stream



