【问题标题】:Why its 0.0 ELB instances?为什么是 0.0 ELB 实例?
【发布时间】:2015-11-08 12:39:39
【问题描述】:

我已成功完成将我的 rails 应用程序部署到我的环境中,但是当我看到监控仪表板中有 0.0 个 ELB 实例时,这是为什么呢?

这是我部署时的日志:

INFO: Deploying new version to instance(s).                         
INFO: New application version was deployed to running EC2 instances.
INFO: Environment update completed successfully.                    

目前我在访问我的应用时只得到空白页面,我认为那是因为我有 0.0 个 ELB 实例

我将如何解决这个问题?

这是一个快照:

编辑,活动日志:

[2015-08-23T17:18:03.570Z] INFO  [18661] - [Application update/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Starting activity...
[2015-08-23T17:18:04.993Z] INFO  [18661] - [Application update/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Completed activity. Result:
  + service passenger restart
  According to the PID file '/var/app/support/pids/passenger.pid',
  Phusion Passenger Standalone doesn't seem to be running.

  If you know that Phusion Passenger Standalone *is* running then one of these
  might be the cause of this error:

   * The Phusion Passenger Standalone instance that you want to stop isn't running
     on port 80, but on another port. If this is the case then you
     should specify the right port with --port.
     If the instance is listening on a Unix socket file instead of a TCP port,
     then please specify the PID file's filename with --pid-file.
   * The instance that you want to stop has stored its PID file in a non-standard
     location. In this case please specify the right PID file with --pid-file.
  /opt/elasticbeanstalk/support/conf/nginx_config_healthd.erb:49:in `block in write_nginx_config_file': undefined local variable or method `location_config_filename' for #<PhusionPassenger::Standalone::StartCommand:0x007f7ab$
        from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/erb.rb:863:in `eval'
        from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/erb.rb:863:in `result'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command/nginx_engine.rb:120:in `block in write_nginx_config_file'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command/nginx_engine.rb:113:in `open'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command/nginx_engine.rb:113:in `write_nginx_config_file'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command/nginx_engine.rb:41:in `start_engine_real'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command.rb:609:in `start_engine'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command.rb:80:in `run'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/main.rb:50:in `run!'
        from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/bin/passenger:44:in `<top (required)>'
        from /opt/rubies/ruby-2.2.2/bin/passenger:23:in `load'
        from /opt/rubies/ruby-2.2.2/bin/passenger:23:in `<main>'
[2015-08-23T17:18:04.993Z] INFO  [18661] - [Application update/AppDeployStage1/AppDeployEnactHook] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/enact.

【问题讨论】:

  • 可以附上截图吗?不知道 0.0 个实例是什么意思。
  • 请看上方

标签: ruby-on-rails amazon-elastic-beanstalk


【解决方案1】:

您有 0 个实例正在运行,这就是您的应用未运行的原因。您需要单击 EC2 并重新启动与您的 Elastic Beanstalk 关联的实例。

【讨论】:

    【解决方案2】:

    看起来您正在使用增强健康。您可以单击仪表板链接。您将看到一个原因按钮。单击原因按钮,它将告诉您为什么您的环境健康状况很严重。在此处查看用于定位原因按钮的示例屏幕截图:https://aws.amazon.com/blogs/aws/elastic-beanstalk-update-enhanced-application-health-monitoring/

    【讨论】:

    • 什么是增强健康?原因按钮说明不了什么,它说“ELB 运行状况失败或不适用于所有实例。所有实例上的服务受损。”
    • 控制台当前不显示实例运行状况...同时,您可以使用 sdk 或 aws cli 使用 beanstalk 中的 DescribeInstancesHealth api。似乎 nginx 代理未在您的服务器上运行。服务受损可能意味着代理或应用程序未运行。您可以单击日志以从实例中获取快照日志吗?然后你就可以看到详细的写消息了。
    • 我在日志中看到:根据 PID 文件 '/var/app/support/pids/passenger.pid',Phusion Passenger Standalone 似乎没有运行。但是部署成功后不是自动启动的吗?
    • 它应该自动启动。查看 /var/log/eb-activity.log
    猜你喜欢
    • 2016-08-05
    • 1970-01-01
    • 2018-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-06-11
    • 2013-09-06
    • 1970-01-01
    • 2014-05-28
    相关资源
    最近更新 更多