3
votes

I've got a nice set of Spring Cloud -applications running but the actual applications register with wrong port to the DiscoveryServer.

I've got a Config-server, Eureka-server and a Zuul-server, which all talk to each other nicely and everything's shiny.

Then I added my actual app and everything wasn't shiny no more. My app runs on port 9001 and it works, but somehow it registers with Eureka on port 8080.

I'm totally baffled as to what is going on.

gradle file: https://gist.github.com/2ee0b2b9a8490e6f25c0

application.yml: https://gist.github.com/f0e811d01eae83020bad

bootstrap.yml: https://gist.github.com/e947ac49a01ca1dfad0e

1
Are you running multiple applications on the same host? I don't see any server instanceId configuration, so the 8080 server is probably a different app. - Dave Syer
@DaveSyer Yes, I'm running multiple applications on the same host. All have different ports, so that they don't clash. The thing is, that there is nothing running on 8080. - deiga

1 Answers

3
votes

See docs on how to make the Eureka instance ID unique. If you are running multiple servers on the same host, you need to configure an instanceId in the eureka.intance.metadataMap. Also, since you are using Eureka to discover the config server, all the eureka config should go in bootstrap.yml, including server.port so that the right metadata is sent by the client on startup.