Spring Boot----整合SpringCloud
1、创建Eureka(服务注册中心) 1.1 application.properties server.port=8761 #eureka实例主机名 eureka.instance.hostname=eureka #不把自己注册到eureka上 eureka.client.register-with-eureka=false #不从eureka上获取注册信息 eureka.client.fetch-registry=false #key:defaultZone,value:http://localhost:8761/eureka eureka.client.service-url.defaultZone=http://localhost:8761/eureka 1.2 @EnableEurekaServer 启动 @EnableEurekaServer @SpringBootApplication public class EurekaApplication { public static void main(String[] args) { SpringApplication.run(EurekaApplication.class, args); } } 1.3 访问: http://localhost:8081/ 2、创建服务提供者 1、application