[英]How Elastic Beanstalk starts Ruby on Rails application? How to debug it?
I'm using Ruby Puma 2.5 instance and I'm quite new to this. 我正在使用Ruby Puma 2.5实例,对此我还很陌生。 I have created new rails app so nothing specific here, just right route to welcome page.
我已经创建了新的Rails应用程序,因此这里没有具体内容,只是通往欢迎页面的正确方法。 When I do
eb deploy
, rails app is correctly deployed to /var/app/current
, but there is no rails process running! 当我执行
eb deploy
,rails应用程序已正确部署到/var/app/current
,但是没有正在运行的rails进程! If I change user to root
(as a test only), change directory to that one and run rails server -p 3000
, the page is available and worked as expected. 如果我将用户更改为
root
(仅作为测试),则将目录更改为该目录,然后运行rails server -p 3000
,该页面可用并按预期工作。 So how can I debug EB to find why app is not started or how can I start it automatically? 那么,如何调试EB来查找为什么未启动应用程序或如何自动启动它? I'm curious how EB does that for example where is the script located which runs
rails server
from correct dir and what is the right way to manipulate with options for example -p 3000
. 我很好奇EB如何做到这一点,例如,脚本位于哪里,该脚本从正确的目录运行
rails server
,以及使用-p 3000
选项进行操作的正确方法是什么? Many thanks if someone can point to look at correct place and understand this better. 如果有人可以指向正确的地方并对此有所了解,我将非常感谢。
You don't need to log into backend instance(EC2 instance) of Elastic Beanstalk to launch Ruby on Rails server manually. 您无需登录到Elastic Beanstalk的后端实例(EC2实例)即可手动启动Ruby on Rails服务器。 Once you deploy your application, either with Elastic Beanstalk console or AWS CLI or EB CLI, some scripts in the instance will be executed to make deployment process.
使用Elastic Beanstalk控制台或AWS CLI或EB CLI部署应用程序后,将执行实例中的一些脚本以进行部署过程。 A script is used to launch Rails server.
脚本用于启动Rails服务器。
Besides eb logs
, you can go to the Elastic Beanstalk console and download the deployment logs. 除了
eb logs
,您还可以转到Elastic Beanstalk控制台并下载部署日志。 The logs are retrieved from backend instances and is a bundled of directory /var/log
, that means the content of the bundled logs is the same as logs in the system. 日志是从后端实例检索的,并且是目录
/var/log
的捆绑包,这意味着捆绑的日志内容与系统中的日志相同。 You can reference to this document for more detail: 您可以参考此文档以获取更多详细信息:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.