【问题标题】:com.netflix.client.ClientException: Load balancer does not have available server for client: dev-view.rhines-dev.svc.cluster.localcom.netflix.client.ClientException:负载均衡器没有可用于客户端的服务器:dev-view.rhines-dev.svc.cluster.local
【发布时间】:2021-08-25 05:45:23
【问题描述】:

我可以在本地运行该应用程序,但是当我在 GCP 上部署它时出现错误提示

 com.netflix.client.ClientException: Load balancer does not have available server for client: custom-index.rhines-dev.svc.cluster.local

这是我想通过 zuul 将流量转发到的主机 url。

我的服务和路线已经注册。

zuul:
  ignoredPatterns:
    - /custom/**
  host:
    connect-timeout-millis: 4000
    socket-timeout-millis: 4000
  sensitiveHeaders:
  routes:
      serviceId: rhines
      path: /**
      url: ${GATEWAY_RHINES_ROUTE:http://localhost:8090}

分级

// netflix-zuul
implementation group: 'org.springframework.cloud', name: 'spring- cloud-starter-netflix-zuul', version: '2.2.9.RELEASE'

我一直在阅读有关 eureka 的建议,但我不需要 eureka 服务器。我正在构建一个网关,我只想让 zuul 路由我的流量。

【问题讨论】:

  • 这些服务是否部署在kubernetes集群上?如果是这样,您能否通过对同一集群中的其他 pod 执行 ssh 来检查服务(dev-view.rhines-dev.svc.cluster.local)是否可访问(使用 curl)。 GATEWAY_RhineS_ROUTE 的 url 是否包含有效的协议?
  • @null 是的,我收到 200 响应。
  • @null 答案很简单.... 将 http:// 添加到 url :( 它现在可以工作了。但是有和没有它的 curl 都可以工作。
  • 我对协议有点怀疑。

标签: spring-boot netflix-zuul


【解决方案1】:

对我来说,答案很简单,将 http:// 添加到 URL。我很惭愧。

【讨论】:

    猜你喜欢
    • 2019-03-23
    • 2021-07-26
    • 2018-07-26
    • 2017-05-15
    • 2017-06-05
    • 2018-06-07
    • 2021-04-20
    • 2019-09-18
    • 2019-02-09
    相关资源
    最近更新 更多