Openshift Layer4连接,应用程序无法启动 [英] Openshift Layer4 connection, App Won't Start

查看:229
本文介绍了Openshift Layer4连接,应用程序无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Openshift上将一组对node.js的更改推送到了一个应用程序.该应用程序在我的本地计算机上运行良好,非常接近Openshift部署的原始示例. Openshift haproxy日志具有以下最后一行:

I recently pushed a set of node.js changes to an app on Openshift. The app runs fine on my local machine and is pretty close to the vanilla example deployed by Openshift. The Openshift haproxy log has this final line:

[fbaradar-hydrasale.rhcloud.com日志]> [警告] 169/002631(93881): 服务器快速/本地齿轮关闭,原因:第4层连接问题, 信息:连接被拒绝",检查持续时间:0ms. 0活动和0备份 剩下的服务器.活动会话0个,重新排队0个,队列中剩余0个.

[fbaradar-hydrasale.rhcloud.com logs]> [WARNING] 169/002631 (93881) : 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.

nodejs.log具有以下最后一行,并且在此行之前没有错误消息:DEBUG: Program node server.js exited with code 8

The nodejs.log has this final line and no error mesages before this line: DEBUG: Program node server.js exited with code 8

我进行了高低搜寻,似乎找不到任何遇到类似问题的人,也没有找到如何解决此问题的提示.显然,当尝试通过网络访问该应用时,上述导致503服务不可用.

I have searched high and low and can't seem to find anyone with a similar problem or hints at how to resolve this issue. Obviously, the above result in a 503 Service Unavailable when trying to access the app over the web.

推荐答案

看着这个问题,因为您没有在根目录'/'上配置任何路由,所以我认为这正在发生. OpenShift使用HAProxy作为可伸缩应用程序中的负载平衡器. HAProxy配置为对根"/" URL进行ping操作以进行运行状况检查,以确定您的应用程序是启动还是关闭.在您的应用程序中,您尚未在根URL上配置任何内容,因此,当HAProxy ping'/'时,它将获得503,因此您的应用程序的行为如下.有两种方法可以解决此问题

Looking at the question I think it is happening because you don't have any routes configured at root '/'. OpenShift uses HAProxy as a load balancer in scalable applications. HAProxy is configured to ping root '/' url for health checks to determine whether your application is up or down. In your application, you have not configured anything at the root url so when HAProxy pings '/' it gets 503, hence your application behaves like this. There are two ways you can fix this problem

  1. 创建一个index.html并将其推送到OpenShift应用程序
  2. 更好的解决方案是配置HAProxy配置文件.使用rhc ssh --app命令通过SSH进入主机,然后将目录更改为haproxy/conf,然后将option httpchk GET /更新为option httpchk GET /valid_location,最后使用rhcette-restart --cartridge haproxy重新启动HAProxy.您可以通过访问 http://myapp-myusername.rhcloud.com/haproxy-status 来检查齿轮的状态. a>.
  1. Create an index.html and push it to OpenShift application
  2. The better solution is to configure HAProxy configuration file. SSH into the main gear using rhc ssh --app command, then change directory to haproxy/conf, and then update option httpchk GET / to option httpchk GET /valid_location, and finally restart the HAProxy using rhc cartridge-restart --cartridge haproxy. You can check the status of your gears by going to http://myapp-myusername.rhcloud.com/haproxy-status.

希望这会对您有所帮助.

Hope this will help you.

这篇关于Openshift Layer4连接,应用程序无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆