Load balancer does not have available server for client問題,是因為消費端沒有調(diào)用成功服務端。下面四步是必備的,可以檢查一番。
1.寫nacos發(fā)現(xiàn)的啟動類注解。
@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的接口。文章來源:http://www.zghlxwxcb.cn/news/detail-669598.html
@Service
@FeignClient(value = "meeting-producer")
public interface FeignService {
@RequestMapping("/findInfo")
public Personinfo findInfo();
}
4.開啟服務端的endpoint。文章來源地址http://www.zghlxwxcb.cn/news/detail-669598.html
management:
endpoint:
web:
exposure:
include:'*'
到了這里,關于Load balancer does not have available server for client問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!