Eureka Server 集群配置

Posted tianciliangen

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eureka Server 集群配置相关的知识,希望对你有一定的参考价值。

注册中心:

 

debug: true
spring:
  application:
    name: eureka-server
logging:
  level:
    com.netflix.eureka: off
    com.netflix.discovery: off
---
spring:
  profiles: manager1
server:
  port: 8100
eureka:
  instance:
    prefer-ip-address: true #以IP地址注册到服务中心,相互注册使用IP地址
    #ip-address: 192.168.1.1 #强制指定IP地址,默认会获取本机的IP地址
  client:
    service-url:
      defaultZone: http://192.168.1.2:8100/eureka/,http://192.168.1.3:8100/eureka/
---
spring:
  profiles: manager2
server:
  port: 8100
eureka:
  instance:
    prefer-ip-address: true
  client:
    service-url:
      defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.3:8100/eureka/
---
spring:
  profiles: manager3
server:
  port: 8100
eureka:
  instance:
    prefer-ip-address: true
  client:
    service-url:
      defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.2:8100/eureka/

 

微服务端:

debug: true
spring:
  application:
    name: eureka-client
server:
  port: 8110
eureka:
  instance:
    prefer-ip-address: true #以IP地址注册到服务中心
    #instance-id: http://192.168.1.4:8110 #服务中心的信息显示(如果IP地址不显示的话,进行配置)
  client:
    service-url:
      defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.2:8100/eureka/,http://192.168.1.3:8100/eureka/

 

以上是关于Eureka Server 集群配置的主要内容,如果未能解决你的问题,请参考以下文章

Eureka Server 集群配置

eureka集群高可用配置

Eureka集群

Eureka集群

创建Eureka Server集群

3Spring Cloud - Eureka(高可用Eureka Server集群)