5.3. Hystrix的健康监测
1、添加依赖
<!--添加认证监控-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2、浏览器访问 http://192.168.215.2:8908/actuator/health
就能显示Hystrix开启状态信息。
有人说,Spring boot 2.x 使用了endpoint,导致/actuator/health,/actuator/hystrix.stream都无法访问,报404错误。
我用的Spring Cloud 版本是Finchley.RELEASE,但是我没遇上,如果有人遇上,可以试试以下三种方法。而我将以下三种方法注释掉,一样能显示Hystrix的/actuator/health,/actuator/hystrix.stream信息
设置让endpoint允许显示/actuator/health,/actuator/hystrix.stream信息的方法如下:
方式一:在application.yml中添加如下配置:
management:
endpoint:
health:
show-details: always #允许显示/actuator/health信息
management:
endpoints:
web:
exposure:

本文介绍了Hystrix的健康监测,包括如何查看Hystrix的状态信息,解决Spring Boot 2.x中可能出现的访问404问题。同时,详细讲解了Hystrix-DashBoard的使用步骤,如何配置并启动Hystrix监控,以及在Hystrix-DashBoard界面监控应用的/hystrix.stream信息。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



