Zuul报告config-server-1应用程序在eureka报告已启动的地方不可用

时间:2019-06-27 12:22:59

标签: spring-cloud netflix-eureka netflix-zuul spring-cloud-netflix

在config-server到达Eureka的UP状态后不久,我就间歇地启动Zuul。 Zuul报告说没有可用的configserver应用程序。

在启动Zuul来查询eureka的config-server-1应用程序之前,我已经添加了curl。这证实了eureka肯定具有Zuul报告该应用程序不可用的应用程序。

Zuul配置:

spring:
  cloud:
    circuit:
      breaker:
        enabled: true

eureka:
  client:
    registerWithEureka: true

server:
  port: 8080

zuul:
  ignoredServices: '*'
  routes:
    # Platform Services
    eureka:
      path: /discovery/**
      serviceId: eureka-server-1
      stripPrefix: false
      retryable: true
    some-test:
      path: /some-test/**
      serviceId: some-test
      stripPrefix: true
      retryable: true
    config:
      path: /config/**
      serviceId: config-server-1
      stripPrefix: true
      retryable: true

Eureka查询config-server-1的响应:

Thu Jun 27 14:19:15 SAST 2019 - http://localhost:8889/eureka/apps/config-server-1
<application>
  <name>CONFIG-SERVER-1</name>
  <instance>
    <instanceId>quintin-sonic.discovery.holdings.co.za:config-server-1:8888</instanceId>
    <hostName>10.11.43.207</hostName>
    <app>CONFIG-SERVER-1</app>
    <ipAddr>10.11.43.207</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8888</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1561637956001</registrationTimestamp>
      <lastRenewalTimestamp>1561637956001</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1561637956002</serviceUpTimestamp>
    </leaseInfo>
    <metadata>
      <instanceId>config-server-1:PID-9348</instanceId>
      <management.port>8888</management.port>
    </metadata>
    <homePageUrl>http://10.11.43.207:8888/</homePageUrl>
    <statusPageUrl>http://10.11.43.207:8888/actuator/info</statusPageUrl>
    <healthCheckUrl>http://10.11.43.207:8888/actuator/health</healthCheckUrl>
    <vipAddress>config-server-1</vipAddress>
    <secureVipAddress>config-server-1</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1561637956002</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1561637955651</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

在zuul服务器中记录输出:

[2019-06-27 14:19:21.957][ERROR][o.s.boot.SpringApplication              ] Application run failed
java.lang.IllegalStateException: No instances found of configserver (config-server-1)
        at org.springframework.cloud.config.client.ConfigServerInstanceProvider.getConfigServerInstances(ConfigServerInstanceProvider.java:25)
        at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.refresh(DiscoveryClientConfigServiceBootstrapConfiguration.java:84)
        at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.startup(DiscoveryClientConfigServiceBootstrapConfiguration.java:69)

如果config-server-1处于启动状态,则预计zuul服务器将始终成功启动。

我发现间歇性的zuul服务器报告config-server-1应用程序不可用。

Zuul core version: 1.3.1
Eureka core version: 1.9.2
Config server version: 2.0.0.RELEASE

0 个答案:

没有答案