<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class RanRegisterApplication {
public static void main(String[] args) {
SpringApplication.run(RanRegisterApplication.class, args);
}
}
spring.application.name=ran-register
#表示是否将自己注册到Eureka Server
eureka.client.register-with-eureka=false
#表示是否从Eureka Server中获取注册的服务信息
eureka.client.fetch-registry=false