feign 请求 连接被拒绝
Feign报错Caused by: com.netflix.client.ClientException: Load balancer does not have available server f 1.引入Eureka依赖2.@AuthorizedFeignClient注解中name写错<dependency> <groupId>org.
·
- Feign报错Caused by: com.netflix.client.ClientException: Load balancer does not have available server f
- 1.引入Eureka依赖
-
2.@AuthorizedFeignClient注解中name写错
- <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency>
- 3
ribbon: eureka: enabled: true
或者com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
原因如下:
在默认设置下,Eureka服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为。
禁止方式如下:在application.properties配置文件中增加以下内容
eureka.client.register-with-eureka=
false
eureka.client.fetch-registry=
false
更多推荐
已为社区贡献2条内容
所有评论(0)