Eureka Server перестает работать после обнаружения клиента - PullRequest
0 голосов
/ 05 июля 2018

В моем приложении Eureka Server и Client. Когда я пытаюсь запустить клиентов, сервер Eureka перестает отвечать, и я получаю этот журнал:

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 client:

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, он работает нормально, и после запуска более 1 клиента он перестает отвечать. Через некоторое время я получаю следующую ошибку на стороне клиента:

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]

В чем может быть причина?

...