Ribbon实现点对点直连出现Server stats: [[Server:192.168.73.129:9091; Zone:UNKNOWN; 问题

SpringCloud:Hoxton.RELEASE  

SpringBoot:2.2.1

我先是按照老版本的做法禁用eureka,发现这句话并不起作用,导致报连接异常以及标题中的错误信息

application.properties

spring.application.name=zxwdotconsumer
server.port=9091

#禁用 eureka
ribbon.eureka.enabled=false
#指定具体的服务实例清单
zxwEurekaProvider.ribbon.listOfServers=192.168.73.129:9090

错误信息:

,Server stats: [[Server:192.168.73.129:9090;	Zone:UNKNOWN;	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:com.netflix.loadbalancer.ConfigurationBasedServerList@337202b5

新版本应该是开启ribbon的饥饿模式

spring.application.name=zxwdotconsumer
server.port=9091

#禁用 eureka
ribbon.eager-load.enabled=true
#指定具体的服务实例清单
zxwEurekaProvider.ribbon.listOfServers=192.168.73.129:9090

之后,避开eureka注册中心,点对点成功!

你可能感兴趣的:(SpringCloud)