【问题标题】:Openshift haproxy error with 'express' has no server available'express' 的 Openshift haproxy 错误没有可用的服务器
【发布时间】:2014-08-25 12:59:31
【问题描述】:

我从 Openshift 创建了一个基本的 Nodejs 应用程序,并且随机地,该服务在几天内自行终止了几次。我的 Nodejs 模块没有错误消息,但仅在自动安装的 haproxy 中。

来自 haproxy.log 的消息是:

[WARNING] 184/001333 (193501) : Server express/local-gear is DOWN for maintenance.
[WARNING] 184/010106 (483047) : config : log format ignored for proxy 'stats' since it has no log address.
[WARNING] 184/010106 (483047) : config : log format ignored for proxy 'express' since it has no log address.
[WARNING] 184/010106 (483047) : Server express/local-gear is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 184/010106 (483047) : proxy 'express' has no server available!
[WARNING] 184/010110 (483047) : Server express/local-gear is DOWN for maintenance.
[WARNING] 184/010115 (483047) : Server express/local-gear is UP (leaving maintenance).
[WARNING] 184/010116 (483047) : Server express/local-gear is DOWN, reason: Layer7 wrong status, code: 500, info: "Internal Server Error", check duration: 43ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 184/010116 (483047) : proxy 'express' has no server available! 

haproxy_ctld.log

E, [2014-07-03T12:12:59.557445 #97055] ERROR -- : Could not connect to the application.  Check if the application is stopped.
E, [2014-07-03T12:13:04.557968 #97055] ERROR -- : Could not connect to the application.  Check if the application is stopped.
E, [2014-07-03T12:13:09.558480 #97055] ERROR -- : Could not connect to the application.  Check if the application is stopped.

【问题讨论】:

    标签: node.js express openshift haproxy


    【解决方案1】:

    检查这个:Openshift Layer4 connection, App Won't Start

    问题可能是您在 express 应用程序的根目录中没有提供任何服务,因此您需要修改 haproxy 配置文件,找到提及 express 和 httpchk 的文件,并将 / 更改为响应请求的内容。

    或者,只需在 / 上提供一些东西,这样 HAProxy 就不会不断重启您的服务。

    【讨论】:

    • 完美解决了我的问题。添加了一个虚假的 index.html,然后一切都开始工作了。
    【解决方案2】:

    您确定流量可以让您的应用保持正常运行吗?如果没有请求,它应该“放气”齿轮。任何后续请求都应将其“膨胀”回来,但最终可能会导致“服务不可用”。

    Re @Dids 回答,虽然正确,但 RedHat 建议 不要 更改 HaProxy keepalive URL,因为 Openshift 的未来更新可能会覆盖配置。我自己修改了应用程序以在根目录下提供简单的 Hello。

    【讨论】:

      猜你喜欢
      • 2022-10-13
      • 1970-01-01
      • 1970-01-01
      • 2014-11-29
      • 2016-04-08
      • 2021-12-06
      • 2015-06-02
      • 2021-07-29
      • 2014-10-10
      相关资源
      最近更新 更多