• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Y-wee
博客园    首页    新随笔    联系   管理     

搭建eureka集群

搭建eureka集群

搭建三个eureka-server服务,参考文档:https://www.cnblogs.com/Y-wee/p/14129138.html

修改eureka01配置文件

spring:
  application:
    name: eureka01
    
server:
  port: 7001
  
eureka:
  instance:
    hostname: eureka7001.com
  client:
    service-url:
      # 配置其他eureka-server服务地址
      defaultZone:  http://eureka7002.com:7002/eureka/,http://eureka7003.com:7003/eureka/
    register-with-eureka: false
    fetch-registry: false

修改eureka02配置文件

spring:
  application:
    name: eureka02
    
server:
  port: 7002
 
eureka:
  instance:
    hostname: eureka7002.com
  client:
    service-url:
      defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7003.com:7003/eureka/
    register-with-eureka: false
    fetch-registry: false

修改eureka03配置文件

spring:
  application:
    name: eureka03
    
server:
  port: 7003

eureka:
  instance:
    hostname: eureka7003.com
  client:
    service-url:
      defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7002.com:7002/eureka/
    register-with-eureka: false
    fetch-registry: false

修改windows的hosts文件实现ip映射(C:\Windows\System32\drivers\etc\hosts)

127.0.0.1 eureka7001.com
127.0.0.1 eureka7002.com
127.0.0.1 eureka7003.com
记得快乐
posted @ 2020-12-13 21:52  Y-wee  阅读(102)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3