我的应用程序中有Eureka Server和Client。当我尝试启动客户端时,Eureka Server停止响应,并显示以下日志:
2018-07-05 18:18:22.926 DEBUG 19374 --- [nio-8761-exec-9] o.s.c.n.eureka.server.InstanceRegistry : renew AUTH-SERVER serverId 192.168.3.180:auth-server:8999, isReplication {}false
2018-07-05 18:18:54.308 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:19:54.308 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:20:54.308 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:21:54.309 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:22:54.309 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:23:54.309 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:24:54.309 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:25:54.309 INFO 19374 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-07-05 18:26:54.059 WARN 19374 --- [eerNodesUpdater] c.n.eureka.cluster.PeerEurekaNodes : The replica size seems to be empty. Check the route 53 DNS Registry
下面是客户端和服务器配置:
客户端主类:
@SpringBootApplication
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
@EnableFeignClients
public class NyotaPlateformApplication {
public static void main(String[] args) {
SpringApplication.run(NyotaPlateformApplication.class, args);
}
}
application.properties客户端:
server.port= ${PORT:4445}
spring.application.name= nyota-plateform
spring.main.banner-mode=off
security.oauth2.resource.user-info-uri= http://localhost:8999/user
eureka.client.serviceUrl.defaultZone= http://localhost:8761/eureka/
服务器主类:
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
应用程序属性:
server.port: 8761
spring.application.name: discovery-server
logging.level.org.springframework.cloud.netflix.eureka: TRACE
eureka.instance.hostname: localhost
eureka.client.registerWithEureka: false
eureka.client.fetchRegistry: false
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
其他客户端具有相同的配置。当我仅启动eureka Server时,它可以正常工作,并且在启动多个客户端之后,它将停止响应。 一段时间后,我在客户端收到以下错误消息:
DiscoveryClient_FSP-MARKETPLACE/192.168.3.180:fsp-marketplace:4444 - 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:112) ~[eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getDelta(EurekaHttpClientDecorator.java:149) ~[eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$7.execute(EurekaHttpClientDecorator.java:152) ~[eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getDelta(EurekaHttpClientDecorator.java:149) ~[eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.DiscoveryClient.getAndUpdateDelta(DiscoveryClient.java:1085) [eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:967) [eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1471) [eureka-client-1.9.0.jar:1.9.0]
at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1438) [eureka-client-1.9.0.jar:1.9.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_101]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
可能是什么原因?