Springcloud中,zuul网关报错
com.netflix.zuul.exception.ZuulException: Forwarding error
Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: app-shop-weixin
原因:
报错是因为spring.application.name,错误的yml配置如下
spring:
###服务名称(服务注册到eureka名称)
application:
name: app-shop-weixin
###设置redis集群
spring:
redis:
cluster:
nodes: 192.168.1.81:7000,192.168.1.81:7001,192.168.1.81:7002
timeout: 20000
pool:
max-idle: 100
min-idle: 1
max-active: 1000
max-wait: -1
解决:
正确的yml配置如下
spring:
###服务名称(服务注册到eureka名称)
application:
name: app-shop-weixin
###设置redis集群
redis:
cluster:
nodes: 192.168.1.81:7000,192.168.1.81:7001,192.168.1.81:7002
timeout: 20000
pool:
max-idle: 100
min-idle: 1
max-active: 1000
max-wait: -1
重启服务完美解决。
注:只能有一个spring