Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eureka: How do I disable/configure peer replication?

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.

like image 408
Klaus Avatar asked Jul 05 '15 12:07

Klaus


People also ask

How do I disable Eureka client?

To disable the Eureka Discovery Client, you can set eureka. client. enabled to false .

What is Eureka client serviceUrl defaultZone?

serviceUrl. defaultZone = http://localhost:8761/eureka eureka. client.

What is @EnableEurekaServer?

You can use Spring Cloud's @EnableEurekaServer to stand up a registry with which other applications can communicate. This is a regular Spring Boot application with one annotation ( @EnableEurekaServer ) added to enable the service registry.

What are registered replicas Eureka?

Replication with Eureka Microservices register with Eureka and then send heartbeats every 30 seconds. If the client cannot renew the heartbeat for a few times, the registration information and the renewals are replicated to all the Eureka nodes in the cluster. This mecanism is called Peer Awareness.


1 Answers

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

like image 144
hi_my_name_is Avatar answered Dec 05 '22 04:12

hi_my_name_is