解析不了注册中心应用地址
来源:5-5 Feign的使用
林立
2019-08-04


详细错误
2019-08-04 23:11:04.756 INFO 21096 --- [nio-8018-exec-1] c.netflix.loadbalancer.BaseLoadBalancer : Client: product instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=product,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2019-08-04 23:11:04.762 INFO 21096 --- [nio-8018-exec-1] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
2019-08-04 23:11:04.782 INFO 21096 --- [nio-8018-exec-1] c.netflix.config.ChainedDynamicProperty : Flipping property: product.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2019-08-04 23:11:04.784 INFO 21096 --- [nio-8018-exec-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client product initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=product,current list of Servers=[product:8019],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:product:8019; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList@2b9d659b
2019-08-04 23:11:05.765 INFO 21096 --- [erListUpdater-0] c.netflix.config.ChainedDynamicProperty : Flipping property: product.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2019-08-04 23:13:28.822 ERROR 21096 --- [nio-8018-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.RetryableException: product executing GET http://product/product/list] with root cause
如果host文件里边加入
就可以用了
配置文件如下
spring:
application:
name: order
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
#instance:
hostname: order
#instance-id: ${spring.application.name}:${spring.cloud.client.ipAddress}:${spring.application.instance_id:${server.port}}
#prefer-ip-address: true
server:
port: 8018
ribbon:
ReadTimeout: 120000
ConnectTimeout: 30000
#eureka:
#enabled: true
#PRODUCTE:
#ribbon:
#NIWSServerListClassName: com.netflix.loadbalancer.RandomRule
#listOfServers: http://localhost:8019
这样需要咋解决师兄
写回答
2回答
-
这是因为电脑网卡太多导致解析混乱,一般服务器上不出出现这样的问题。
你可以在product服务加配置
eureka: instance: prefer-ip-address: true
ps: 以后发问题,代码记得格式化(慕课网这个编辑器带的功能)
012019-08-05 -
林立
提问者
2019-08-05
昨天我禁用过网卡,但是没起作用,的确用了这个配置可以访问了
在问师兄一个问题
ribbon 的请求方式以及过期时间,可以直接设置在eureka服务端吗,这样是否也同order里边作用一样
ribbon: ReadTimeout: 120000 ConnectTimeout: 30000 eureka: enabled: true PRODUCTE: ribbon: NIWSServerListClassName: com.netflix.loadbalancer.RandomRule
112019-08-07
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
SpringCloud组件实现微服务,【已升级Finchley.Release】
5674 学习 · 2489 问题
相似问题