• springcloud系列10 整合Hystrix遇到的坑:


    首先配置类:

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

    这个地方忘记加了

    第二主机名写出了locahost后台报错

    java.net.UnknownHostException: loclahost
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_192]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[na:1.8.0_192]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[na:1.8.0_192]
        at java.net.InetAddress.getAllByName0(InetAddress.java:1277) ~[na:1.8.0_192]
        at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[na:1.8.0_192]
        at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[na:1.8.0_192]
        at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) ~[httpclient-4.5.6.jar:4.5.6]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.6.jar:4.5.6]
        at org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardConfiguration$ProxyStreamServlet.doGet(HystrixDashboardConfiguration.java:177) ~[spring-cloud-netflix-hystrix-dashboard-2.1.0.RELEASE.jar:2.1.0.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-embed-core-9.0.14.jar:9.0.14]

    这两个不加会报错:

    Unable to connect to Command Metric Stream.

    还有就是那个界面之后不知道如何操作:

  • 相关阅读:
    ubuntu VirtualBox 网络配置
    Linux Lsof命令详解
    自然用户界面
    [Java]读取文件方法大全
    java设计模式_命令模式 两个不同风格的实现
    创建线程的方法 Thread Runnable
    程序员每天到底可以写几行代码?
    eclipse Javadoc 汉化成中文
    linux jna调用so动态库
    使用GNU Make来管理Java项目,IDE神马都是浮云
  • 原文地址:https://www.cnblogs.com/xiufengchen/p/10333421.html
Copyright © 2020-2023  润新知