0

I am trying to setup a eureka cluster which comprise of there servers. (my setup is on local machine)

Configurations for each eureka server as below:

server1:

server:
  port: 8764
eureka:
  instance:
     metadataMap:
       instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
  client:
    registerWithEureka: true
    fetchRegistry: true
    # availabilityZones: zone1,zone1,zone1
  server:
    waitTimeInMsWhenSyncEmpty: 0
    serviceUrl:
     defaultZone: http://localhost:8762/eureka/,http://localhost:8763/eureka/,http://localhost:8764/eureka/

server2:

server:
  port: 8762
eureka:
  instance:
     metadataMap:
       instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
  client:
    registerWithEureka: true
    fetchRegistry: true
  server:
    waitTimeInMsWhenSyncEmpty: 0
    serviceUrl:
      defaultZone: http://localhost:8762/eureka/,http://localhost:8763/eureka/,http://localhost:8764/eureka/

server3:

server:
  port: 8763

eureka:
  instance:
     metadataMap:
       instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
  client:
    registerWithEureka: true
    fetchRegistry: true
  server:
    waitTimeInMsWhenSyncEmpty: 0
    serviceUrl:
      defaultZone: http://localhost:8762/eureka/,http://localhost:8763/eureka/,http://localhost:8764/eureka/

each server is peering to each others, so registration info will be replicated among servsers.

But, when I checked the logs server, it always throw exception as beblow:

enter image description here

I also checked dashboard of eureka server and it shown as below:

enter image description here

I dont know why the registered replicas (http://localhost:8761/eureka/) did not change even I have configured

serviceUrl:
      defaultZone: http://localhost:8762/eureka/,http://localhost:8763/eureka/,http://localhost:8764/eureka/

I have setup a micro services and register to the eureka cluster, but for somehow the service info only is registered on one of eureak server, I am expecting that info also replicated to others as well

is there anyone suffering from same issue, I have been trying searching a lot but could not find the right answer for my case.

High appreicate for any advice?

Joey Trang
  • 1,105
  • 2
  • 23
  • 44

1 Answers1

0

I have found the issues. I have put serviceUrl in wrong section (server).

it should be in the client part.

server:
  port: 8763

eureka:
  instance:
     metadataMap:
       instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
  client:
    registerWithEureka: false
    fetchRegistry: false
   serviceUrl:
      defaultZone:     http://localhost:8762/eureka/,http://localhost:8763/eureka/,http://localhost:876
  server:
    waitTimeInMsWhenSyncEmpty: 0
Joey Trang
  • 1,105
  • 2
  • 23
  • 44