springCloud --Eureka
单台Eureka 1. 首选准备一台Eureka(注册中心-----淘宝电商平台) pom添加这个依赖文件 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> <version>2.2.0.RELEASE</version> </dependency> View Code yml文件 server: port: 9000 eureka: instance: hostname: localhost client: register-with-eureka: false #是否将自己注册到注册中心 fetch-registry: false #是否从eureka中获取注册信息 service-url: defaultZone: http://localhost:9000/eureka/ View Code 主程序入口 @SpringBootApplication @EnableEurekaServer public class EurekaApplication { public static void main(String[] args) { SpringApplication.run