Unable to connect to Command Metric Stream.

我使用的版本是springcloud2.0 (最后面贴上pom文件配置)

在网上参考别人的博客(https://blog.csdn.net/forezp/article/details/69934399)进行spring clound入门,在进行到Hystrix Dashboard 这部分的时候,(使用的是ribbon负载均衡客户端),后台配置好之后启动工程 并访问http://localhost:8764/hystrix

Unable to connect to Command Metric Stream._第1张图片   

输入http://localhost:8764/hystrix.stream  和title 并点击按钮出现如下界面:Unable to connect to Command Metric Stream.

Unable to connect to Command Metric Stream._第2张图片网上也是查阅各种资料,都没有找到解决办法,今天早上看到一个网友推荐的链接(https://kgoralski.github.io/post/hystrix-springboot/)Unable to connect to Command Metric Stream._第3张图片


于是我在工程中加了这个类,然后启动访问并按上面的步骤访问


Unable to connect to Command Metric Stream._第4张图片此时需要 访问下当前工程的接口,才会显示有效的信息:

Unable to connect to Command Metric Stream._第5张图片再看上面的页面,就会有显示了


Unable to connect to Command Metric Stream._第6张图片

工程结构:

Unable to connect to Command Metric Stream._第7张图片

pom文件信息:

xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0modelVersion>

   <groupId>com.scgroupId>
   <artifactId>consumer-ribbonartifactId>
   <version>0.0.1-SNAPSHOTversion>
   <packaging>jarpackaging>

   <name>consumer-ribbonname>
   <description>consumer-ribbon project for Spring Bootdescription>

   <parent>
      <groupId>org.springframework.bootgroupId>
      <artifactId>spring-boot-starter-parentartifactId>
      <version>2.0.0.RELEASEversion>
      <relativePath/> 
   parent>

   <properties>
      <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>
      <java.version>1.8java.version>
      <spring-cloud.version>Finchley.M9spring-cloud.version>
   properties>

   <dependencies>
      <dependency>
         <groupId>org.springframework.bootgroupId>
         <artifactId>spring-boot-starter-webartifactId>
      dependency>

      <dependency>
         <groupId>org.springframework.bootgroupId>
         <artifactId>spring-boot-starter-testartifactId>
         <scope>testscope>
      dependency>


      <dependency>
         <groupId>org.springframework.cloudgroupId>
         <artifactId>spring-cloud-starter-netflix-eureka-clientartifactId>
      dependency>

      
      <dependency>
         <groupId>org.springframework.cloudgroupId>
         <artifactId>spring-cloud-starter-hystrixartifactId>
         <version>1.4.4.RELEASEversion>
      dependency>

      
      <dependency>
         <groupId>org.springframework.bootgroupId>
         <artifactId>spring-boot-starter-actuatorartifactId>
         <version>2.0.0.RELEASEversion>
      dependency>


      
      <dependency>
         <groupId>org.springframework.cloudgroupId>
         <artifactId>spring-cloud-starter-hystrix-dashboardartifactId>
         <version>1.4.4.RELEASEversion>
      dependency>

   dependencies>

   <dependencyManagement>
      <dependencies>
         <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-dependenciesartifactId>
            <version>${spring-cloud.version}version>
            <type>pomtype>
            <scope>importscope>
         dependency>
      dependencies>
   dependencyManagement>

   <build>
      <plugins>
         <plugin>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-maven-pluginartifactId>
         plugin>
      plugins>
   build>

   <repositories>
      <repository>
         <id>spring-milestonesid>
         <name>Spring Milestonesname>
         <url>https://repo.spring.io/milestoneurl>
         <snapshots>
            <enabled>falseenabled>
         snapshots>
      repository>
   repositories>

project>
希望能帮助到遇到此问题的盆友

你可能感兴趣的:(spring,boot,spring,cloud,hystrix,ribbon,Unable,to,connect,to,Command,M)