微服务架构
user-server示例 1.导入依赖 <!--客户端--> < dependency > < groupId > org.springframework.cloud </ groupId > < artifactId > spring-cloud-starter-netflix-eureka-client </ artifactId > </ dependency > <!--web--> < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-web </ artifactId > </ dependency > 2.主配置类注解开启@EnableEurekaClient 可以不加注解–默认开启 @SpringBootApplication @EnableEurekaClient public class UserApplicationConfig { public static void main ( String [ ] args ) { SpringApplication . run ( UserApplicationConfig . class ) ; } } 3.application.yml eureka : client