application-peer1.properties
server.port=1111
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
spring.application.name=eureka-server
info.app.name=spring-cloud-eureka
info.app.version=0.0.1
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=false
eureka.server.enable-self-preservation=false
eureka.instance.hostname=peer1
#eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
eureka.client.serviceUrl.defaultZone=http://peer2:1112/eureka/
application-peer2.properties
server.port=1112
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
spring.application.name=eureka-server
info.app.name=spring-cloud-eureka
info.app.version=0.0.1
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=false
eureka.server.enable-self-preservation=false
eureka.instance.hostname=peer2
#eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
eureka.client.serviceUrl.defaultZone=http://peer1:1111/eureka/
交叉注册