zoukankan      html  css  js  c++  java
  • 解决Hystrix dashboard Turbine 一直 Loading…… 及其他坑

    问题一、请求 /hystrix.stream 报错,我这里以端口9001为例

      请求 http://localhost:9001/hystrix.stream 报404

      

       是因为Srping Boot 2.0以后仪表盘的默认路径不在是 /hystrix.stream,这时就需要我们自己去设置,在主类中添加以下代码:

      @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;
        }

      重启项目,访问 http://localhost:9001/hystrix.stream ,大功告成

    问题二、 Hystrix dashboard 一直 Loading……

      如果访问 http://localhost:9001/hystrix.stream  报错,请先移驾 问题一  设置 仪表盘路径

      否则 就是需要 通过负载均衡调用服务了,现在没调用,所以什么都没监控到,掉完服务再去仪表盘看就会有如下信息

    问题三、Turbine 启动报错 EL1008E: Property or field 'default' cannot be found on object of type 'com.netflix.appinfo.InstanceInfo

     这是配置的问题 将 "default"  修改为  new String("default") ,再启动,一切正常

     问题四、Turbine 一直 Loading……

     总结起来就以下几方面:

      1、保证问题一、二、三都已经解决

      2、检查服务名(app-config )配置是否正确

      3、检查  cluster-name-expression: new String("default")  配置是否正确

      4、检查 instanceUrlSuffix: /hystrix.stream   配置是否正确

    修改配置后记得重启项目(没有配热部署的情况下)

    调用服务再去仪表盘查看就OK 了

    如有不对之处,请各位大佬指教, 如果还是有问题,可以联系我

  • 相关阅读:
    shell内置命令eval的具有什么作用
    openwrt中如何在一个软件包中使能busybox中的工具
    go语言中strings包中的Trim函数的作用是什么
    RedisTemplate的各种操作(set、hash、list、string)
    Spring data redis-StringRedisTemplate 用法
    Spring-data-redis 第一天
    Java操作Redis数据
    BootStrap之X-editable插件使用
    bootstrap editable有默认值
    bootstrap editable初始化后表单
  • 原文地址:https://www.cnblogs.com/bert227/p/12901016.html
Copyright © 2011-2022 走看看