我的Eureka配置文件如下:
---
spring:
profiles: peer1
application:
name: eureka-server
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
fetch-registry: true
register-with-eureka: false
serviceUrl:
defaultZone: http://localhost:8762/eureka/
---
spring:
profiles: peer2
application:
name: eureka-server
server:
port: 8762
eureka:
instance:
hostname: localhost
client:
fetch-registry: true
register-with-eureka: false
serviceUrl:
defaultZone: http://localhost:8761/eureka/
运行时启动两个实例,profiles分别为peer1和peer2。
启动后访问localhost:8761,eureka界面如下:
1.png
访问localhost:8762,界面如下:
<