系统相关
首页 > 系统相关> > ruby-on-rails-Rails-Elastick Beanstalk nginx / error.log

ruby-on-rails-Rails-Elastick Beanstalk nginx / error.log

作者:互联网

尝试将我的Rails应用程序上传到弹性beantalk.我已经成功部署了我的应用程序并创建了postgres数据库.我的应用程序可在开发服务器上的sqlite3上运行.

我的eb状态已准备就绪,健康状况良好.

我的eb日志文件;

/var/log/nginx/error.log
-------------------------------------
2016/05/27 11:15:44 [warn] 2797#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:40:48 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:40:49 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"



-------------------------------------
/var/log/puma/puma.log
-------------------------------------
=== puma startup: 2016-05-27 11:52:07 +0000 ===
=== puma startup: 2016-05-27 11:52:07 +0000 ===
[23871] - Worker 0 (pid: 23875) booted, phase: 0
[23871] - Gracefully shutting down workers...
[23871] === puma shutdown: 2016-05-27 12:36:32 +0000 ===
[23871] - Goodbye!
=== puma startup: 2016-05-27 12:36:35 +0000 ===
=== puma startup: 2016-05-27 12:36:35 +0000 ===
[24886] - Worker 0 (pid: 24890) booted, phase: 0

我对eb很陌生,所以我想知道是否由于以下原因而发生了问题;

>我尚未安装节点,因此无法连接
>或者我在安全组方面遇到问题.如图所示,我总共有4个.
enter image description here

我的网络接口;
enter image description here
当我尝试分离RDS安全组时,即使我以root用户身份登录,它也给出未授权错误.
enter image description here
我已经尝试解决这个问题了几个小时,非常感谢您的帮助!

编辑
我认为我遇到了与here相同的问题.但无法理解如何解决

解决方法:

从Nginx日志中,您的问题非常清楚:

connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream

内容为:

没有相应的文件和目录

这意味着您的套接字在此路径中不存在:

/var/run/puma/my_app.sock

>您需要将路径设置为与Rails / Puma中的路径相同
上游(即配置)
>当您这样做时,请不要忘记确保该Nginx用户
可以访问该套接字,它将需要RW访问.

标签:ruby-on-rails,nginx,amazon-web-services,postgresql,elastic-beanstalk
来源: https://codeday.me/bug/20191009/1877881.html