要搭建多节点Eureka Server其实比较简单,只需要在单节点Eureka Server的基础上对配置文件application.yml
进行修改。具体可参考Spring Cloud官网的Peer Awareness这部分内容。
搭建双节点Eureka Server
- 修改配置文件application.yml
spring:
application:
name: coupon-eureka
---
spring:
profiles: server1
server:
port: 8000
eureka:
instance:
hostname: server1
prefer-ip-address: false
client:
serviceUrl: