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/

 

posted @ 2019-10-10 19:23  天王星天  阅读(777)  评论(0编辑  收藏  举报