zoukankan      html  css  js  c++  java
  • spring cloud hystrix dashboard 没有/actuator/hystrix.stream路径解决

    首先我用的是spring boot Greenwich.SR2

    在测试hystrix-dashboard监控服务时,发现访问localhost:9001/actuator/hystrix.stream一直失败

    去网上搜了一下,发现启动类要添加一个servlet

        @Bean
        public ServletRegistrationBean getServlet(){
            HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
            ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
            registrationBean.setLoadOnStartup(1);
            registrationBean.addUrlMappings("/actuator/hystrix.stream");
            registrationBean.setName("HystrixMetricsStreamServlet");
            return registrationBean;
        }

    要引入的依赖有以下

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
                <version>2.1.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-openfeign</artifactId>
                <version>2.1.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-archaius</artifactId>
            </dependency>
            <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-actuator</artifactId>
            </dependency>
  • 相关阅读:
    二叉树计数2(卡特兰数+高精乘低精+高精除低精)
    奶牛的身高(差分约束)
    海底高铁(差分)
    假期(动态规划+单调队列)
    RY哥查字典(字符串双模hash初步)
    元素查找(hash初步)
    【模板】单源最短路径 堆优化的dijkstra
    【模板】单源最短路径spfa
    【并查集】noi2001食物链
    【带权并查集】银河英雄传说
  • 原文地址:https://www.cnblogs.com/xc-chejj/p/11316143.html
Copyright © 2011-2022 走看看