- springcloud注册中心
pom文件
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
</dependencies>
- EurekaServerApplication
@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
- application.properties
server.port=7000
eureka.instance.hostname=eureka-server
#eureka.client.register-with-eureka=false
#eureka.client.fetch-registry=false
部署启动报错参照: 学习笔记-Eureka