将Zuul连接到Eureka(Netflix)

时间:2017-01-13 15:49:57

标签: java tomcat netflix-zuul netflix-eureka

当我将Zuul连接到Eureka时,我收到以下错误:

 [err] 42622092 [pool-2-thread-1] ERROR com.netflix.discovery.DiscoveryClient - Can't get a response from https://sd-eureka-01.th.net:8443/eureka/v2/apps/ZUUL/x.x.x.x
    Can't contact any eureka nodes - possibly a security group issue?
    [err] com.sun.jersey.api.client.ClientHandlerException: org.apache.http.NoHttpResponseException: sd-eureka-01.th.net:8443 failed to respond
    [err]   at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
    [err]   at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
    [err]   at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:28)
    [err]   at com.sun.jersey.api.client.Client.handle(Client.java:652)
    [err]   at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
    [err]   at com.sun.jersey.api.client.WebResource.put(WebResource.java:213)
    [err]   at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1108)
    [err]   at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1065)
    [err]   at com.netflix.discovery.DiscoveryClient.access$500(DiscoveryClient.java:110)
    [err]   at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1630)
    [err]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [err]   at java.util.concurrent.FutureTask.run(FutureTask.java:267)
    [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1143)
    [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:618)
    [err]   at java.lang.Thread.run(Thread.java:785)
    [err] Caused by:
    [err] org.apache.http.NoHttpResponseException: sd-eureka-01.th.net:8443 failed to respond
    [err]   at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    [err]   at [internal classes]
    [err]   at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
    [err]   ... 14 more
    [err] 42622098 [pool-2-thread-1] ERROR com.netflix.discovery.DiscoveryClient - DiscoveryClient_ZUUL/x.x.x.x - was unable to send heartbeat!
    [err] com.sun.jersey.api.client.ClientHandlerException: org.apache.http.NoHttpResponseException: sd-eureka-01.th.net:8443 failed to respond
    [err]   at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
    [err]   at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
    [err]   at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:28)
    [err]   at com.sun.jersey.api.client.Client.handle(Client.java:652)
    [err]   at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
    [err]   at com.sun.jersey.api.client.WebResource.put(WebResource.java:213)
    [err]   at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1108)
    [err]   at com.netflix.discovery.DiscoveryClient.makeRemoteCall(DiscoveryClient.java:1065)
    [err]   at com.netflix.discovery.DiscoveryClient.access$500(DiscoveryClient.java:110)
    [err]   at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1630)
    [err]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [err]   at java.util.concurrent.FutureTask.run(FutureTask.java:267)
    [err]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1143)
    [err]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:618)
    [err]   at java.lang.Thread.run(Thread.java:785)
    [err] Caused by:
    [err] org.apache.http.NoHttpResponseException: sd-eureka-01.th.net:8443 failed to respond
    [err]   at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    [err]   at [internal classes]
    [err]   at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
    [err]   ... 14 more

然而,当我检查我的尤里卡Sever时,我看到Zuul经常向Eureka发送心跳,其状态显示为up。我在Tomcat上运行Zuul和Eureka。这个问题可能是由于HttpClient在一段空闲时间后关闭了连接,但是Zuul并不知道它。一旦收到错误,它就会创建一个新连接并再次发送请求。

Zuul每隔30秒向Eureka发送一次心跳。是否可以在Tomcat上更改一些不关闭连接的设置?

0 个答案:

没有答案