简体   繁体   中英

Unable to register services to the discovery server (EUREKA)

So when I run my service instance. It does not register itself to the discovery server. And there is no error, so I am not able to identify the problem here .

application.properties of my service looks like this and application.properties of the discovery server can be seen in the screenshot attached.

spring.application.name = service
eureka.client.service-url.defaultZone =http://localhost:8761/eureka/

Eureka dashboard at localhost:8761 shows that there are no instances available for this service.

这是控制台

You have to add this dependency in your pom.xml , that will give your service a reason to stay up:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

Moreover, I think you should refactor your application.properties file for Eureka default zone part, like that:

eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
eureka.instance.preferIpAddress=true
eureka.client.registerWithEureka=true
eureka.client.fetchRegistry=true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM