会出现这个问题是导入 spring-cloud-loadbalancer后nacos中 pring-cloud-starter-netflix-ribbon会与它冲突,造成loadbalanc包失效
所以在common的pom文件中剔除掉nacos中的spring-cloud-starter-netflix-ribbon
<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <exclusions> <exclusion> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> </exclusion> </exclusions> </dependency>