Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eureka service always registers instances with host name even though i put "prefer-ip-address: true"

I want to register my micro services in Eureka with the IP address instead of host name.

I have tried both prefer-ip-address and eureka.instance.preferIpAddress=true properties. None of those worked for me.

Here is my eureka service application .yml file.

enter image description here

This is my Authorization-server micro-service application.yml

enter image description here

But still eureka console showing my services registered with host name(localhost) instead of IP address

enter image description here

I am using Spring boot 2.2.2 version and Spring cloud Hoxton.RELEASE. I am guessing the properties aren't working properly.

Is anyone experiencing the same problem?

like image 863
Chamith Madusanka Avatar asked Sep 20 '25 17:09

Chamith Madusanka


1 Answers

Finally i figured out where i can see preferIpAddress property changes. Hover your mouse to instance. Then in the bottom left corner you can see the IP.

Before applying property preferIpAddress = true

enter image description here

After applying property preferIpAddress = true

enter image description here

like image 164
Chamith Madusanka Avatar answered Sep 22 '25 07:09

Chamith Madusanka