欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

eurake双机部署(eurake真机部署)

程序员文章站 2022-03-08 22:23:22
在网上,书上查阅的资料大多数都是单机模拟部署eurake。经过多次实验后感觉真机有所不同。贴一下配置server: port: 8000eureka: client: register-withEureka: true fetch-registry: truespring: application: name: seesea-eureka cloud: inetutils: timeout-seconds: 10 profiles:...

在网上,书上查阅的资料大多数都是单机模拟部署eurake。经过多次实验后感觉真机有所不同。
贴一下配置

server:
  port: 8000
eureka:
  client:
    register-withEureka: true
    fetch-registry: true
spring:
  application:
    name: seesea-eureka
  cloud:
    inetutils:
      timeout-seconds: 10
  profiles:
    active: local
---
spring:
  profiles: service
eureka:
  instance:
    preferIpAddress: true
    hostname: eureka-server
  client:
    service-url:
#      defaultZone: http://192.168.3.4:8000/eureka/,http://192.168.3.6:8000/eureka/
      defaultZone: http://192.168.3.4:8000/eureka/
      instance:
        hostname: 192.168.3.3
        appname: eureka-server
---
spring:
  profiles: pi
eureka:
  instance:
    preferIpAddress: true
    hostname: eureka-pi
  client:
    service-url:
#      defaultZone: http://192.168.3.3:8000/eureka/,http://192.168.3.6:8000/eureka/
      defaultZone: http://192.168.3.3:8000/eureka/
      instance:
        hostname: 192.168.3.4
        appname: eureka-pi

开始使用三机部署eurake 分别为Debian树莓派(192.168.3.4), centos8 (192.168.3.3). window10 (192.168.3.6) 部署但是两台Linux系统一直显示window10 上的节点为 unavailable-replicas 而window10上显示都是可用节点。未找到原因。

主要设置

eureka:
  client:
    register-withEureka: true
    fetch-registry: true
eureka:
  instance:
    preferIpAddress: true

网上大多数资料都是单机改host不可能做到高可用。真机部署资料比较少,但是关于eurake的配置实在太多,所以只是摸索的实验部署,如果有真机部署的文档或资料请联系博主,因为博主只是做到了部署可用但是没有甚解。

本文地址:https://blog.csdn.net/thewaiting/article/details/107327058