标签:als net class gap boot auto framework active java
spring.application.name=spring-cloud-eureka server.port=8000 #是否将自己注册到Eureka Server #eureka.client.register-with-eureka=false #是否从Eureka Server获取注册信息 #eureka.client.fetch-registry=false eureka.instance.hostname=peer1 eureka.client.serviceUrl.defaultZone=http://peer2:8001/eureka/
spring.application.name=spring-cloud-eureka server.port=8001 #是否将自己注册到Eureka Server #eureka.client.register-with-eureka=false #是否从Eureka Server获取注册信息 #eureka.client.fetch-registry=false eureka.instance.hostname=peer2 eureka.client.serviceUrl.defaultZone=http://peer1:8000/eureka/
package com.lofty.cloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication @EnableEurekaServer public class SpringCloudEurekaApplication { public static void main(String[] args) { SpringApplication.run(SpringCloudEurekaApplication.class, args); } }
127.0.0.1 peer1 127.0.0.1 peer2
java -jar spring-cloud-eureka-peer.jar --spring.profiles.active=peer1
java -jar spring-cloud-eureka-peer.jar --spring.profiles.active=peer2
标签:als net class gap boot auto framework active java
原文地址:https://www.cnblogs.com/monkeybrother/p/9786068.html