阅读背景:

Spring Boot / Spring Cloud - Eureka服务器

来源:互联网 

I am trying out the eureka cloud registry for the first time and looking for your help on it

我是第一次尝试eureka云注册表并寻找你的帮助

To register sample Eureka client to the eureka server The code for Eureka Server is in the following location https://github.com/vijayakumar-psg587/EurekaServer.git

将示例Eureka客户端注册到eureka服务器Eureka Server的代码位于以下位置https://github.com/vijayakumar-psg587/EurekaServer.git

This is the Client I am trying to register https://github.com/vijayakumar-psg587/EurekaClient1.git

这是我试图注册的客户端https://github.com/vijayakumar-psg587/EurekaClient1.git

But the client is not getting registered

但是客户没有注册

Request execution failure with status code 404; retrying on another server if available
2017-09-17 00:11:04.433 ERROR 17432 --- [           main] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EUREKACLIENT1/EurekaClient1 - 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) ~[eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) ~[eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1030) [eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:944) [eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:444) [eureka-client-1.4.12.jar:1.4.12]
    at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:304) [eureka-client-1.4.12.jar:1.4.12]
    at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:51) [spring-cloud-netflix-eureka-client-1.2.7.RELEASE.jar:1.2.7.RELEASE]
    at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:192) [spring-cloud-netflix-eureka-client-1.2.7.RELEASE.jar:1.2.7.RELEASE]
    at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$ed07235b.CGLIB$eurekaClient$1(<generated>) [spring-cloud-netflix-eureka-client-1.2.7.RELEASE.jar:1.2.7.RELEASE]

I use Spring Boot - 1.4.6 version.

我使用Spring Boot - 1.4.6版本。

I have a similar eureka server which runs on the port 8880 and if I try to register my client there it works perfectly. not sure what I am missing in the new server I've written

我有一个类似的eureka服务器,它运行在端口8880上,如果我尝试在那里注册我的客户端,它可以很好地工作。不知道我写的新服务器中缺少什么

Is there something to do with the server port series ? The working one has the port configured as 8880 whereas the one I am having trouble is configured as 9000 . Please let me know your thoughts

是否与服务器端口系列有关?工作端口的端口配置为8880,而我遇到问题的端口配置为9000。请让我知道你的想法

Working EurekaServer- https://github.com/vijayakumar-psg587/CloudConfigEurekaServer.git

使用EurekaServer-https://github.com/vijayakumar-psg587/CloudConfigEurekaServer.git

1 个解决方案

#1


0  

In EurekaClient1/bootstrap.yml, use:

在EurekaClient1 / bootstrap.yml中,使用:

defaultZone: https://localhost:9000/eureka/

instead of:

defaultZone: https://localhost:9000/eurekaServer/

分享到: