zoukankan      html  css  js  c++  java
  • springcloud的Turbine配置监控多个服务的一些坑!!!!InstanceMonitor$MisconfiguredHostException,No message available","path":"/actuator/hystrix.stream,页面不显示服务或者一直loading

    踩了几个小时坑,使用仪表盘监控单个服务的时候很容易,但是一到多个服务,瞬间坑就来了,大概碰到下面三个:

    1InstanceMonitor$MisconfiguredHostException, No message available","path":"/actuator/hystrix.stream:

    因为我用的是springboot2.0.6版本,这个版本默认路径不是/hystrix.stream,而turbine默认路径是这个,所以要修改一下,可以有两种修改方式:

    一: 配置Bean,设置路径

        /**
         * springboot 版本如果是2.0则需要添加 ServletRegistrationBean
         * 因为springboot的默认路径不是 "/hystrix.stream"
         * @return
         */
        @Bean
        public ServletRegistrationBean getServlet() {
            HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
            ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
            registrationBean.setLoadOnStartup(1);
            registrationBean.addUrlMappings("/hystrix.stream");
            registrationBean.setName("HystrixMetricsStreamServlet");
            return registrationBean;
        }
    

      

    二: 配置文件配置Bean

    页面不显示服务:

    这个问题挺坑的,具体原因是因为监控的服务不光要开启熔断和仪表盘,同样也要开启turbine,即启动类需要以下注解,缺一不可:

    一直loading:

    最后是这个,实际中发现无论怎么访问接口,就是没监控数据,后台测试发现,你所访问的接口必须要有熔断,即普通方法要有fallback:

    访问其他方法是不会有监控数据的;

    feign接口也要有fallback实现类,才会监控到数据!!!!!!

  • 相关阅读:
    #线段树,矩阵乘法#LOJ 3264「ROIR 2020 Day 2」海报
    #线段树#洛谷 4428 [BJOI2018]二进制
    #Trie#洛谷 7717 「EZEC-10」序列
    shell脚本生成双色球号码
    k8s的tomcat多pod session会话保持配置
    国产系统优麒麟系统使用
    grdi报错--grid的asm磁盘丢失处理方法
    centos7上安装oracle的sqlplus客户端
    linux挂载
    linux占用100%cpu的java处理
  • 原文地址:https://www.cnblogs.com/houzheng/p/9906800.html
Copyright © 2011-2022 走看看