Hystrix是Java库而非系统级软件,需集成到Spring Boot应用中,通过Actuator暴露/hystrix.stream端点并配合独立Dashboard工程实现监控;常见失败原因包括端点未显式暴露、Security拦截、未触发Hystrix命令导致流为空,或路径/网络/SSE兼容性问题。

nginx 或 redis 那样通过 yum install 或 apt-get install 直接安装。它是一个 Java 库,必须集成到 Spring Boot 微服务应用中,再配合 Actuator 和 Hystrix Dashboard 实现监控能力。
下面分三块讲清楚怎么做、为什么这么配、容易在哪卡住。
怎么在 Spring Boot 项目里启用 Hystrix Dashboard
核心是:被监控的服务要暴露 hystrix.stream,还得有个独立的 Dashboard 应用去消费这个流。
- 被监控服务(比如订单服务)需添加依赖:
spring-boot-starter-actuator+spring-cloud-starter-netflix-hystrix - 配置文件(
application.yml)里加:management.endpoints.web.exposure.include=hystrix.stream - 启动类加注解:
@EnableCircuitBreaker(或@EnableHystrix) - 单独建一个 Dashboard 工程,只引入:
spring-cloud-starter-netflix-hystrix-dashboard,并加@EnableHystrixDashboard
为什么访问 /hystrix 页面后填 http://service:port/actuator/hystrix.stream 总是报错
常见原因不是地址写错,而是端点根本没暴露或权限拦截了。
Zynq‑7000 / Zynq UltraScale+ 硬件调试技能。适用于 Xilinx Zynq(Cortex‑A9/A53 + FPGA)Linux 环境,调试 I2C、I2S、UART、GPIO 等外设。包括设备树配置、内核驱动、用户空间调试工具、交叉编译和常见问题排查,支持 PetaLinux 开发。
-
hystrix.stream默认不暴露,必须显式配置management.endpoints.web.exposure.include,不能只写hystrix—— 正确值是hystrix.stream - Spring Boot 2.x+ 默认只暴露
health和info,其他端点需手动放开 - 如果用了 Spring Security,要放行
/actuator/hystrix.stream路径,否则返回 401 - 确认服务已实际触发过 Hystrix 命令(比如调用一次带
@HystrixCommand的接口),否则流为空,Dashboard 显示 “Unable to connect”
Hystrix Dashboard 启动后输入地址点 Monitor Stream 没反应
Dashboard 本质是 SSE(Server-Sent Events)客户端,依赖服务端持续推送数据。静止状态不等于失败,但以下情况会导致断连或空白:
- 被监控服务没走 Hystrix 流程:没加
@HystrixCommand,或 fallback 方法没触发,hystrix.stream就不会产生有效事件 - 网络不通:Dashboard 机器能
curl http://service:port/actuator/hystrix.stream吗?返回应是持续滚动的 JSON 数据流 - 路径错误:Spring Boot 2.5+ 默认 Actuator 基路径是
/actuator,不是/hystrix.stream或/hystrix.stream;确认 URL 是http://host:port/actuator/hystrix.stream - 浏览器限制:某些企业内网环境会拦截 SSE,换 Chrome 或 curl 直接测更可靠
hystrix.stream 是否真实输出、Dashboard 是否能稳定建立长连接、中间有没有反向代理或防火墙截断流式响应。先确保 curl -N http://service:port/actuator/hystrix.stream 能看到实时刷新的数据块,再谈图形界面。

















