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>
  • 相关阅读:
    likely(x)与unlikely(x) __builtin_expect
    c++ ScopeExitGuard
    c++ 11 bind function
    boost shared_ptr weak_ptr
    PL/SQL:使用pragma restrict_references限制包权限
    Nginx的事件处理机制
    读书笔记-HBase in Action-第二部分Advanced concepts-(1)HBase table design
    谈谈工作
    [Java 8] (5) 使用Lambda表达式进行设计
    How to delete a large number of data in SharePoint for List when refreshing data?
  • 原文地址:https://www.cnblogs.com/xc-chejj/p/11316143.html
Copyright © 2011-2022 走看看