修改电脑的hosts文件
添加127.0.0.1 peer1 peer2
在application.yml添加`spring:
application:
name: newServer
eureka:
client:
service-url:
defaultZone: http://peer2:8761/eureka/
instance:
hostname: peer1
server:
port: 8762
spring:
profiles: peer1
eureka:
client:
service-url:
defaultZone: http://peer1:8762/eureka/
instance:
hostname: peer2
server:
port: 8761
spring
profiles: peer2`
在拧一个服务器添的qpplication.yml的defaultZone后面添加 http://peer2:8761/eureka/,http://peer1:8762/eureka/