Load balancer does not have available server for client问题,是因为消费端没有调用成功服务端。下面四步是必备的,可以检查一番。

1.写nacos发现的启动类注解。

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class MeetingConsumerApplication {
}

2.在两端yml文件中配置nacos地址。

server:
  port: 8002
spring:
  application:
    name: meeting-consumer
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848

3.写openfeign的接口。

@Service
@FeignClient(value = "meeting-producer")
public interface FeignService {

    @RequestMapping("/findInfo")
    public Personinfo findInfo();
}

4.开启服务端的endpoint。

management:
  endpoint:
    web:
      exposure:
        include:'*'

更多推荐

Load balancer does not have available server for client问题