AWS 最近宣布需要:
在 2019 年 10 月 31 日之前更新您的 Amazon RDS SSL/TLS 证书
我有一个使用经典 Elastic Beanstalk 负载均衡器托管的 Rails 应用程序,它使用 RDS 连接到 Postgres 数据库。
亚马逊要求的步骤是:
( https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html )
由于我的负载均衡器是这样设置的(通过 HTTP 端口 80(不是 SSL)连接到我的 EC2 实例,这是否意味着我不需要执行第 1 步和第 2 步?只执行第 3 步?
或者我是否必须下载更新的证书并将它们手动安装/添加到我的负载均衡器或 EC 实例?不知道该怎么做。
ruby-on-rails ssl-certificate rds amazon-web-services amazon-elastic-beanstalk
此错误信息是众所周知的错误信息。(例如,请参阅https://bundler.io/blog/2019/01/04/an-update-on-the-bundler-2-release.html。)尽管我通过具有以下功能的新Elastic Beanstalk应用程序获得它Ruby 2.6.1和bundler 2.0.1。错误是:
/opt/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
from /opt/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:308:in `activate_bin_path'
from /opt/rubies/ruby-2.6.1/bin/bundle:23:in `<main>' (ElasticBeanstalk::ExternalInvocationError)
Run Code Online (Sandbox Code Playgroud)
我尝试将以下文件:01_install_bundler.config放在.ebextensions文件夹中:
container_commands:
01_install_bundler:
command: "gem install bundler —-version 2.0.1"
Run Code Online (Sandbox Code Playgroud)
尽管这永远不会运行,因为如果我看上面的错误,我可以看到它在部署过程的这一点上正在发生:
.../AppDeployStage0/AppDeployPreHook/10_bundle_install.sh] : Activity failed.
Run Code Online (Sandbox Code Playgroud)
(即在bundle installAppDeployPreHook脚本的命令期间)。请参阅https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platform-hooks.html以获取PlatformHooks的参考。
我非常确定,如果可以确保所使用的捆绑器版本至少为2.0.0,那么不会有问题。尽管我不知道如何轻松指定。目前,我正在服务器上/opt/elasticbeanstalk/hooks/appdeploy/pre/进行编辑和处理脚本。尽管我显然需要一种自动的,可重复的方法。
令人沮丧的是,ruby 2.6.1并未默认选择捆绑程序版本2.0.0。有任何想法吗?
=============================
更新:
如果我编辑文件 /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh
if [ -f Gemfile ]; then
echo "running 'bundle install' with Gemfile:"
cat Gemfile
+++ gem install bundler +++
if [ -d …Run Code Online (Sandbox Code Playgroud) ruby rubygems ruby-on-rails amazon-web-services amazon-elastic-beanstalk
当使用 ruby debug gem时,我经常看到打印出以下输出:
DEBUGGER: Attaching after process <pid1> fork to child process <pid2>
Run Code Online (Sandbox Code Playgroud)
其中<pid1>是父进程 ID(如 12345),<pid2>是新分叉的子进程 ID(如 55555)。
这里发生了什么?它与连接到Spring或Zeus等应用程序预加载器有什么关系吗?