美文网首页
spring cloud dashboard 连接不上

spring cloud dashboard 连接不上

作者: ontheway_sh | 来源:发表于2020-12-23 11:07 被阅读0次

    spring cloud 项目添加了仪表盘,但一直连接不上
    Unable to connect to Command Metric Stream.

    image.png
    后面发现控制台中有一行警告日志
    WARN 23796 --- [nio-8080-exec-1] ashboardConfiguration$ProxyStreamServlet : Origin parameter: http://localhost:8080/actuator/hystrix.stream is not in the allowed list of proxy host names. If it should be allowed add it to hystrix.dashboard.proxyStreamAllowList.
    image.png
    估计是新的版本的原因
    我用的版本如下
    # springboot :
    <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.3.7.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
     </parent>
    # spring-cloud
    <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR9</version>
                <type>pom</type>
                <scope>import</scope>
    </dependency>
    

    解决方式
    配置文件中添加配置

    hystrix:
      dashboard:
        proxy-stream-allow-list: "*"
    

    添加配置重启


    image.png
    image.png

    完成

    相关文章

      网友评论

          本文标题:spring cloud dashboard 连接不上

          本文链接:https://www.haomeiwen.com/subject/tosynktx.html