Spring Eureka集群复制问题[版本eureka-Brixton.SR1]

时间:2017-05-31 03:02:36

标签: spring-cloud netflix-eureka

我正在尝试设置一个包含服务器的eureka群集。 (我的设置在本地机器上)

每个eureka服务器的配置如下:

server1的:

firebase.auth().getRedirectResult().then(function(result) {
  if (result.user) {
   // Additional user info like first name, last name,
   // Facebook account url, gender, etc.
   console.log(result.additionalUserInfo.profile);
   // Facebook access token returned in the process
   // for the scopes requested.
   console.log(result.credential.accessToken);
 }

服务器2:

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/

服务器3:

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/

每个服务器都彼此对等,因此注册信息将在服务器之间复制。

但是,当我检查日志服务器时,它总是抛出异常为beblow:

enter image description here

我还检查了eureka服务器的仪表板,如下所示:

enter image description here

我不知道为什么注册的副本( http://localhost:8761/eureka/ )即使我已经配置也没有改变

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/

我已经设置了微服务并注册到eureka集群,但是由于某种方式服务信息只在eureak服务器上注册,我希望这些信息也可以复制到其他人身上

有没有人遇到同样的问题,我一直在尝试搜索,但找不到适合我案例的正确答案。

高度建议任何建议?

1 个答案:

答案 0 :(得分:0)

我找到了问题。我把serviceUrl放在错误的部分(服务器)。

它应该在客户端部分。

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