nacos配置记录
一、服务注册/服务发现
1、pom添加依赖
<!--服务注册/服务发现--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency>
2、在spring cloud 启动类中标注@EnableDiscoveryClient,表明此项目是一个注册发现客户端
@EnableFeignClients(basePackages = "com.syf.gulimall.member.feign") @SpringBootApplication @EnableDiscoveryClient public class GulimallMemberApplication { public static void main(String[] args) { SpringApplication.run(GulimallMemberApplication.class, args); } }
3、配文文件