Cannot execute request on any known serve

错误信息:

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 = "_-";

猜你喜欢

转载自blog.csdn.net/qq_42224683/article/details/109517676
今日推荐