Hystrix Dashboard是Hystrix的仪表盘组件,主要用来实时监控Hystrix的各项指标信息,通过界面反馈的信息可以快速发现系统中存在的问题。

整合快速体验:

pom.xml(这个是F系之后的依赖)

    <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>

之前的使用:

<dependency>   
 <groupId>org.springframework.cloud</groupId>  
  <artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>   
 <groupId>org.springframework.cloud</groupId> 
   <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency><dependency>  
  <groupId>org.springframework.boot</groupId>  
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

启动类上加

启动类配置@EnableHystrixDashboard注解

启动类加配置:

package com.cxy;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import com.netflix.loadbalancer.BestAvailableRule;
import com.netflix.loadbalancer.IRule;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate; /***
* @ClassName: PersonApplication
* @Description:
* @Auther: 陈绪友
* @Date: 2019/1/2816:30
* @version : V1.0
*/
@EnableCircuitBreaker
@SpringBootApplication
@EnableEurekaClient //开启注解,注册服务
@MapperScan("com.cxy")
@EnableFeignClients
@EnableHystrixDashboard
public class UserApplication {
public static void main(String[] args) { SpringApplication.run(UserApplication.class,args);
}
@Bean
// @LoadBalanced //使用负载均衡器Ribbon
public RestTemplate getRestTemplate(){
return new RestTemplate();
} /*@Bean
public IRule myRule(){
//return new RoundRobinRule();//轮询
// return new RetryRule();//重试
return new BestAvailableRule();
}*/
@Bean
public ServletRegistrationBean getServlet(){
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup();
registrationBean.addUrlMappings("/actuator/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
}

http://127.0.0.1:8082/actuator/hystrix.stream  这个路径配置千万不要写localhost

不然控制台报错:

java.net.UnknownHostException: loclahost
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_192]
at java.net.InetAddress$.lookupAllHostAddr(InetAddress.java:) ~[na:1.8.0_192]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:) ~[na:1.8.0_192]
at java.net.InetAddress.getAllByName0(InetAddress.java:) ~[na:1.8.0_192]
at java.net.InetAddress.getAllByName(InetAddress.java:) ~[na:1.8.0_192]
at java.net.InetAddress.getAllByName(InetAddress.java:) ~[na:1.8.0_192]
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:) ~[httpclient-4.5..jar:4.5.]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:) ~[httpclient-4.5..jar:4.5.]
at org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardConfiguration$ProxyStreamServlet.doGet(HystrixDashboardConfiguration.java:) ~[spring-cloud-netflix-hystrix-dashboard-2.1..RELEASE.jar:2.1..RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:) [tomcat-embed-core-9.0..jar:9.0.]

点击mointor

springcloud系列九 整合Hystrix Dashboard的更多相关文章

  1. springcloud系列10 整合Hystrix遇到的坑:

    首先配置类: @Bean public ServletRegistrationBean getServlet(){ HystrixMetricsStreamServlet streamServlet ...

  2. springcloud系列八 整合Hystrix

    feign本身是支持Hystrix的,所以不需要引入其他依赖: 我们可以看看feign这个项目的依赖,就是引入这个依赖的pom.xml 要想看这个很简单,点击那个依赖进去就可以了 点进去就可以看到 & ...

  3. 微服务SpringCloud之熔断监控Hystrix Dashboard和Turbine

    Hystrix-dashboard是一款针对Hystrix进行实时监控的工具,通过Hystrix Dashboard我们可以在直观地看到各Hystrix Command的请求响应时间, 请求成功率等数 ...

  4. SpringCloud系列七:Hystrix 熔断机制(Hystrix基本配置、服务降级、HystrixDashboard服务监控、Turbine聚合监控)

    1.概念:Hystrix 熔断机制 2.具体内容 所谓的熔断机制和日常生活中见到电路保险丝是非常相似的,当出现了问题之后,保险丝会自动烧断,以保护我们的电器, 那么如果换到了程序之中呢? 当现在服务的 ...

  5. SpringCloud断路器监控面板——Hystrix Dashboard

    一.简介 Hystrix Dashboard是Hystrix的一个组件,Hystrix Dashboard提供一个断路器的监控面板,可以使我们更好的监控服务和集群的状态,仅仅使用Hystrix Das ...

  6. SpringCloud系列九:SpringCloudConfig 基础配置(SpringCloudConfig 的基本概念、配置 SpringCloudConfig 服务端、抓取配置文件信息、客户端使用 SpringCloudConfig 进行配置、单仓库目录匹配、应用仓库自动选择、仓库匹配模式)

    1.概念:SpringCloudConfig 基础配置 2.具体内容 通过名词就可以发现,SpringCloudConfig 核心作用一定就在于进行配置文件的管理上.也就是说为了更好的进行所有微服务的 ...

  7. SpringCloud系列十七:Hystrix的监控

    1. 回顾 上文讲解了使用Hystrix为Feign添加回退,并通过Fallback Factory检查回退原因以及如何为Feign客户端禁用Hystrix. 2. Hystrix的监控 除实现容错外 ...

  8. springcloud系列七 整合slueth,zipkin 分布式链路调用系统:

    首先在代码里面引入依赖: <dependency> <groupId>org.springframework.cloud</groupId> <artifac ...

  9. springcloud系列六 整合security

    一 Eureka注册中心认证: Eureka自带了一个管理界面,如果不加密,所有人都可以进行访问这个地址,这样安全问题就来了,所以需要对其进行加密认证: 那么该如何进行整合呢: 1 在注册中心模块添加 ...

随机推荐

  1. python metaclass(元类)

    metaclass(元类) 一.创建类的执行流程 二.元类的认识 什么是元类呢?在Python3中继承type的就是元类 二.元类的示例 方式一: # 方式一 class MyType(type): ...

  2. 正则表达式 notes

    nfs 网络文件系统 存储类型:块存储,对象存储,文件存储 nfs属于文件存储 crond 分钟小时日月周 命令:绝对路径 命令是由crond解释 /bin/bash a.sh */2 * * * * ...

  3. HDLM工具介绍

    HDLM提供了以下一些工具,以方便HDLM多路径管理. 1. dlmgetras hdlm信息收集工具,用来收集hdlm相关的各种日志.trace.配置等文件,以方便进行hdlm故障分析. 命令格式 ...

  4. Json-lib 进行java与json字符串转换之一

    这篇文章主要介绍了在java中,JSON字符串与java对象的相互转换实例详解,非常不错,具有参考借鉴价值,需要的朋友可以参考下. 在开发过程中,经常需要和别的系统交换数据,数据交换的格式有XML.J ...

  5. ping 127.0.0.1请求超时的解决办法?

    转自:http://blog.51cto.com/dengyong/1429699 打开网络连接,你很有可能启用了虚拟wifi.若有无线网卡就把无线网卡关掉,然后本地连接那里(就是有线网卡的那个连接) ...

  6. os.path.join合并 os.path.dirname返回上一级目录 os.path.exists(path) os.stat('path/filename')获取文件/目录信息

    import os str1 = "grsdgfd" str2 = "wddf" str3 = "gddgs" # print(str1 + ...

  7. Docker的Gitlab镜像的使用

    Gitlab是一款非常强大的开源源码管理系统.它支持基于Git的源码管理.代码评审.issue跟踪.活动管理.wiki页面,持续集成和测试等功能.基于Gitlab,用户可以自己搭建一套类似Github ...

  8. sharepoint文档库中日期显示详细日期,不显示几天前

    文档库---库设置----栏

  9. day70-oracle 12-Java调用存储过程和存储函数

    我们现在调用的是存储过程和存储函数.用CallableSatement调用存储函数和存储过程. RDBMS:关系数据库.使用标准方式调用存储过程.也就是说:在mysql中调用和在oracle中调用的写 ...

  10. [Elasticsearch2.x] 多字段搜索 (一) - 多个及单个查询字符串 <译>

    多字段搜索(Multifield Search) 本文翻译自官方指南的Multifield Search一章. 查询很少是只拥有一个match查询子句的查询.我们经常需要对一个或者多个字段使用相同或者 ...