首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法连接到hystrix仪表板中的命令度量流

无法连接到hystrix仪表板中的命令度量流
EN

Stack Overflow用户
提问于 2018-07-04 16:18:26
回答 1查看 3.2K关注 0票数 1

我正在尝试使用Netflix eureka服务发现和hystrix断路器来构建简单的spring云应用程序。

断路器业务:

代码语言:javascript
复制
@EnableCircuitBreaker
@SpringBootApplication
@EnableEurekaClient
public class PluralsightEurekaFastpassConsoleApplication {

    public static void main(String[] args) {
        SpringApplication.run(PluralsightEurekaFastpassConsoleApplication.class, args);
    }
}

pom.xml

代码语言:javascript
复制
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

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

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>


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

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

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


</project>

Hystrix仪表板

代码语言:javascript
复制
@EnableHystrixDashboard
@SpringBootApplication
@EnableDiscoveryClient
public class PluralsiteHystrixDashboardApplication {

    public static void main(String[] args) {
        SpringApplication.run(PluralsiteHystrixDashboardApplication.class, args);
    }
}

pom.xml

代码语言:javascript
复制
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

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

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

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


</project>

hystrix仪表板

控制台日志

2018-07-04 20:15:25.051 INFO 17516 -- nio-8088-exec-1 ashboardConfiguration$ProxyStreamServlet :代理打开连接到:http://localhost:8088/actuator/hystrix.stream 2018-07-04 20:15:25.052 INFO 17516 - nio-8088-exec-6 ashboardConfiguration$ProxyStreamServlet:http://localhost:8088/actuator/hystrix.stream 2018-07-04 20:15:25.058警告17516 -- nio-8088-exec-1 ashboardConfiguration:与http://localhost:8088/actuator/hystrix.stream的打开连接失败: 404 : HTTP/1.1 4042018-07-04 20:15:25.058警告17516 -- nio-8088-exec-6 -配置$ProxyStreamServlet:打开到http://localhost:8088/actuator/hystrix.stream的连接失败: 404 :HTTP/1.1404

我试过Unable to connect to Command Metric Stream for Hystrix Dashboard with Spring Cloud

但问题仍然存在。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-04 19:16:50

问题没有提供足够的信息,所以最好的办法可能是确保:

  1. 断路器服务在8088端口上运行
  2. 断路器服务中的弹簧引导驱动器端点确实在actuator上下文路径下部署和访问。为了检查执行器的实际位置,分析启动日志,如果没有部署端点的信息,将--debug添加到微服务的应用程序启动中。

看来第二步将揭示真正的问题。然后可以使用management.context-path设置执行器上下文路径,或者应该定制hystix仪表板。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51177728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档