我正在使用Netflix Eureka
为我的微服务实现服务注册表。但是,当我尝试在eureka-server.war
服务器中部署Tomcat
时,它会在日志中抛出以下错误:
2017-03-08 04:44:47,982 WARN com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient:127 [DiscoveryClient-CacheRefreshExecutor-0] [execute] Request execution failure with status code 404; retrying on another server if available
2017-03-08 04:44:47,984 WARN com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient:127 [DiscoveryClient-CacheRefreshExecutor-0] [execute] Request execution failure with status code 404; retrying on another server if available
2017-03-08 04:44:47,984 ERROR com.netflix.discovery.DiscoveryClient:934 [DiscoveryClient-CacheRefreshExecutor-0] [fetchRegistry] DiscoveryClient_EUREKA/{my hostname here} - was unable to refresh its cache! status = Cannot execute request on any known server
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1013)
at com.netflix.discovery.DiscoveryClient.getAndUpdateDelta(DiscoveryClient.java:1055)
at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:929)
at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1451)
at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1418)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
我似乎无法找到解决此错误的方法,也不知道为什么会出现此错误。
请帮我成功解决此问题。我认为这可能与某些https /代理问题有关。但我似乎无法找到它。
答案 0 :(得分:0)
看起来您的服务器充当客户端。确保使用正确的注释(如果使用弹簧启动)