0


Load balancer does not have available server for client问题

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:'*'
标签: java spring spring boot

本文转载自: https://blog.csdn.net/LiangDongPath/article/details/127405542
版权归原作者 画时 所有, 如有侵权,请联系我们删除。

“Load balancer does not have available server for client问题”的评论:

还没有评论