Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

This is the console

like image 722
HMT Avatar asked Nov 19 '25 10:11

HMT


1 Answers

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
like image 159
veben Avatar answered Nov 21 '25 02:11

veben