Eureka高可用注册中心(解决单点故障)

修改hosts

拷贝一份EurekaService1000

修改两个的

1000application.yml

server:
  port: 1000
eureka:
  instance:
    hostname: peer1
  client:
    registerWithEureka: false #禁用注册中心向自己注册
    fetchRegistry: false  #不让注册中心获取服务的注册列表
    serviceUrl:
      defaultZone: http://peer2:1001/eureka/
      #注册中心的注册地址 ,其他微服务需要向这个地址注册

1001application.yml

server:
  port: 1001
eureka:
  instance:
    hostname: peer2
  client:
    registerWithEureka: false #禁用注册中心向自己注册
    fetchRegistry: false  #不让注册中心获取服务的注册列表
    serviceUrl:
      defaultZone: http://peer1:1000/eureka/
      #注册中心的注册地址 ,其他微服务需要向这个地址注册

和主配置类名称

成功页面

 

猜你喜欢

转载自www.cnblogs.com/xiaoruirui/p/11925988.html