错误信息:
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known serve
解决方案:
加上下面的配置,如果不配置,
eureka:
client:
registerWithEureka: false
fetchRegistry: false
原因是默认为true,会自动注册和拉取服务
public EurekaClientConfigBean() {
this.serviceUrl.put("defaultZone", "http://localhost:8761/eureka/");
this.gZipContent = true;
this.useDnsForFetchingServiceUrls = false;
this.registerWithEureka = true;
this.preferSameZoneEureka = true;
this.availabilityZones = new HashMap();
this.filterOnlyUpInstances = true;
this.fetchRegistry = true;
this.dollarReplacement = "_-";