搭建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
记得快乐