Eureka: How do I disable/configure peer replication?

Klaus picture Klaus · Jul 5, 2015 · Viewed 9.7k times · Source

When I run Eureka on port 8761, everything works great. The config server can register to Eureka without problem. When I change eureka port to 7001, however, things stop working and I can't seem to figure out how to fix them.

The issue seems to revolve around Eureka not being able to find a peer node running at: http://localhost:8761/eureka. The exception is:

2015-07-05 08:00:47.301 ERROR 4140 --- [egister-process] 
c.netflix.eureka.cluster.PeerEurekaNode  : PeerEurekaNode: 
http://localhost:8761/eureka/apps/: CONFIGSERVER/localhost:Register

Indeed when Eureka starts, it says: Adding replica node: http://localhost:8761/eureka/. It seems thus that somewhere the a replica node is assumed to be running at 8761.

Is there a way to disable Eureka looking for replica nodes? Or how do I control if and when and where replica should happen? I looked at the EurekaServerConfig class (http://netflix.github.io/eureka/javadoc/eureka-core/index.html) but I could not find anything that goes in this direction.

This is with Spring Cloud 1.0.2.RELEASE.

Answer

freakman picture freakman · Jul 6, 2015

You have to configure eureka.client.serviceUrl.defaultZone property in application.yml file.