Openshift可扩展Rails 4的新应用程序使503服务器不可用 [英] Openshift Scalable Rails 4 new application renders 503 Server Unavailable

查看:91
本文介绍了Openshift可扩展Rails 4的新应用程序使503服务器不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月前,我在openshift上成功部署了Rails单齿轮应用程序.我现在正在尝试部署可伸缩的应用程序.设置应用程序,连接git,将极简项目推到openshift后,我收到503 Server Unavailable错误.经过大量研究后,我推测我的问题可能与HAProxy有关.以下帖子此处详细介绍了haproxy和如何处理cfg.我的本地齿轮和后端确实有相同的DOWN齿轮,按照haproxy.cfg文件中的建议进行修改无法解决我的问题,但是列出的博客文章引用的是Java项目,因此没有比较相同的环境.

I successfully deployed a rails single gear application on openshift a few months ago. I am now attempting to deploy a scalable application. After setting up the app, connecting with git, pushing a minimalist project to openshift, I am getting a 503 Server Unavailable error. After doing quite a bit of research, I speculate my problem may be related to the HAProxy. The following post here goes into some detail about the haproxy and dealing with the cfg. I do have the same DOWN gears for my local-gear and backend, working with modifications as suggested on the haproxy.cfg file did not resolve my issue, but the listed blog post is referring to a Java project, so were not comparing same environments.

该应用程序在本地主机上按预期运行,并且通过ssh进入rhc到该应用程序中,我可以运行必要的rake任务,迁移以及不执行的任务.

The app runs as expected on my local host, and rhc via ssh into the app, I can run necessary rake tasks, migrations and what not.

还有其他人遇到类似的问题吗?如果可以,那么任何人都可以纠正该问题吗?

Has anyone else run into a similar problem? If so has anyone been able to correct the issue?

推荐答案

问题已死,但无论如何都必须解决.所以这是交易,以防它可以帮助某人.基本上,我发现有两件事在可调用的Rails 4.1.x应用程序中引起问题.

Question is dead, but had to figure it out anyway. So here's the deal in case if it could help someone. Basically I've found two things that causes problems in scallable rails 4.1.x application.

  • 今天,在Gemfile中必须定义了gem 'rake'(它将在不定义rake的情况下在本地运行,但不能在openshift上运行).如果您看到某些'block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)错误,可能就是这样.

  • As for today there must be gem 'rake' defined in Gemfile (it will work locally without rake defined, but not on openshift). If you see some 'block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound) error that's probably it.

您必须在routes.rb中定义根路径,例如:root 'users#index'-haproxy balancer不会在未定义根路径的情况下启动红宝石齿轮.如果您看到某些Layer7 wrong status, code: 404错误,可能就是这样.

You have to define your root route in routes.rb, like that for example: root 'users#index' - haproxy balancer won't start your ruby gear without root route defined. If you see some Layer7 wrong status, code: 404 error that's probably it.

如果您需要进一步的调试,请尝试转到http://yourappname-yourdomainname.rhcloud.com/haproxy-status/.在这里,您可以查看齿轮及其真实状态.

If you need some further debugging try going to http://yourappname-yourdomainname.rhcloud.com/haproxy-status/. There you can see your gears and their real status.

还请确保您在database.yml中具有正确的数据库配置.如果参数不正确,则在大多数情况下,齿轮将无法启动. (最好的方法是在其中放置初始的sqlite3配置以进行测试,一旦一切恢复正常,请使用您的真实数据库.)

Also make sure you have proper database configuration in database.yml. If parameters are incorrect the gear - in most cases - won't start. (Best approach is to put there initial sqlite3 config for testing, and once everything is up again go with your real database.)

作为旁注:到目前为止,没有选择在openshift上安装rails 4.2.至少没有社区墨盒,但我还没有找到任何有效的墨盒.如果看到有关rack 1.5.2的错误,则可能意味着您需要降级到Rails 4.1.0.一切就绪后-尝试转到4.1.9,看看是否可行.

As a side note: As for today there is no option to install rails 4.2 on openshift. At least without a community cartridge, but I haven't found any working one. If you see some errors about rack 1.5.2 that probably means you need to downgrade to to rails 4.1.0. Once everything is up - try going to 4.1.9 and see if it works.

祝你好运!

这篇关于Openshift可扩展Rails 4的新应用程序使503服务器不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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