Hystrix监控

一、受监控的项目添加依赖,之前遇到的问题:访问流的连接一直获取不到数据,结果是版本问题。

<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-core</artifactId>
    <version>1.5.12</version>
</dependency>
<dependency>
            <groupId>com.netflix.hystrix</groupId>
            <artifactId>hystrix-metrics-event-stream</artifactId>
            <version>1.5.12</version>

</dependency>

 

二、监控面板配置:

1、启动hystrix-dashboard监控面板
java -jar -DserverPort=7979 -DbindAddress=localhost standalone-hystrix-dashboard-1.5.3-all.jar
注意:其中的serverPort、bindAddress是可选参数,若不添加,默认是7979和localhost

2、浏览器输入http://localhost:7979/hystrix-dashboard/,出现小熊页面就是正确了。

 

三、turbine集合监控流

turbine下载:https://github.com/downloads/Netflix/Turbine/turbine-web-1.0.0.war(或者搜turbine-web-1.0.0.war

1、配置tomcat(192.33.33.33)的webapps下的turbine/WEB-INF/classes/config.properties

InstanceDiscovery.impl=com.netflix.turbine.discovery.ConfigPropertyBasedDiscovery
#cluster
turbine.aggregator.clusterConfig=default
#turbine.aggregator.clusterConfig=myboot
turbine.instanceUrlSuffix=:8001/hystrix.stream //受监控项目hystrix流地址后缀
turbine.ConfigPropertyBasedDiscovery.default.instances=192.11.11.11,192.22.22.22 //受监控项目ip地址

说明:turbine.aggregator.clusterConfig=default与turbine.ConfigPropertyBasedDiscovery.default.instances中的default对应。

2、启动turbine

  • 如果需要tomcat的关闭过程可能不会关闭干净,使用ps -ef | grep tomcat,之后进行kill就好。

3、分别启动两台机器上的hystrix项目192.11.11.11,192.22.22.22

4、浏览器输入

  • 在上面启动的监控面板"localhost:7979/hystrix-dashboard"中添加"192.33.33.33:8080/turbine/turbine.stream"进行监控

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值