AWS无法使用awscli创建Elastic beanstalk Node.js Worker

时间:2016-03-09 11:31:46

标签: amazon-web-services elastic-beanstalk amazon-dynamodb aws-sdk aws-cli

我想使用aws CLI命令创建一个弹性beanstalk工作层实例,并且我收到了以下错误。

[Instance: i-d848c050] Command failed on instance. Return code: 1 Output: missing required parameter params[:table_name] - (ArgumentError). Hook /opt/elasticbeanstalk/addons/sqsd/hooks/firstboot/02-start-sqsd.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

并在/var/log/eb-activity.log

init: missing required parameter params[:table_name] (ArgumentError)
at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/aws-sdk-core/param_validator.rb:26:in `validate!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/aws-sdk-core/param_validator.rb:11:in `validate!'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/aws-sdk-core/plugins/param_validator.rb:20:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb:112:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/aws-sdk-core/plugins/param_converter.rb:21:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/seahorse/client/plugins/response_target.rb:21:in `call'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/seahorse/client/request.rb:70:in `send_request'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sdk-core-2.1.23/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/vendor/AWSMACLE/lib/leader_election/storage_manager.rb:81:in `update_registration'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/vendor/AWSMACLE/lib/leader_election/storage_manager.rb:19:in `verify_table'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/vendor/AWSMACLE/lib/leader_election/daemon.rb:37:in `initialize'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/vendor/AWSMACLE/lib/leader_election.rb:8:in `new'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/vendor/AWSMACLE/lib/leader_election.rb:8:in `create'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/lib/aws-sqsd/cron.rb:241:in `leader_election_daemon'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/lib/aws-sqsd/cron.rb:30:in `initialize'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/lib/aws-sqsd/daemon.rb:44:in `new'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/lib/aws-sqsd/daemon.rb:44:in `initialize'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/bin/aws-sqsd:34:in `new'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/bin/aws-sqsd:34:in `start'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/bin/aws-sqsd:83:in `launch'
from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.2.0/gems/aws-sqsd-2.0/bin/aws-sqsd:111:in `<top (required)>'
from /opt/elasticbeanstalk/lib/ruby/bin/aws-sqsd:23:in `load'
from /opt/elasticbeanstalk/lib/ruby/bin/aws-sqsd:23:in `<main>'

以下是我在powershell脚本文件中运行的命令。

#Cretae an application
aws elasticbeanstalk create-application --application-name sample-ebs-app

aws elasticbeanstalk check-dns-availability --cname-prefix sample-ebs-cname

aws elasticbeanstalk describe-application-versions --application-name sample-ebs-app --version-label v1

aws elasticbeanstalk create-configuration-template --application-name sample-ebs-app --template-name v1 --solution-stack-name  "64bit Amazon Linux 2015.09 v2.0.6 running Node.js"

aws elasticbeanstalk create-environment --application-name sample-ebs-app --template-name v1 --environment-name sample-ebs-env --tier file://ebs-tier.json --option-settings file://ebs-options.json

以下是ebs-tier.json

{
"Version": " ",
"Type": "SQS/HTTP",
"Name": "Worker"
}

和ebs-options.json

[
 {
    "OptionName": "Availability Zones", 
    "Namespace": "aws:autoscaling:asg", 
    "Value": "any"
}, 
{
    "OptionName": "Cooldown", 
    "Namespace": "aws:autoscaling:asg", 
    "Value": "360"
}, 
{
    "OptionName": "MaxSize", 
    "Namespace": "aws:autoscaling:asg", 
    "Value": "10"
}, 
{
    "OptionName": "MinSize", 
    "Namespace": "aws:autoscaling:asg", 
    "Value": "1"
}, 
{
    "OptionName": "BlockDeviceMappings", 
    "Namespace": "aws:autoscaling:launchconfiguration"
}, 
{
    "OptionName": "EC2KeyName", 
    "Namespace": "aws:autoscaling:launchconfiguration", 
    "Value": ""
}, 
{
    "OptionName": "IamInstanceProfile", 
    "Namespace": "aws:autoscaling:launchconfiguration", 
    "Value": "aws-elasticbeanstalk-ec2-role"
}, 
{
    "OptionName": "InstanceType", 
    "Namespace": "aws:autoscaling:launchconfiguration", 
    "Value": "t1.micro"
}, 
{
    "OptionName": "EnvironmentType", 
    "Namespace": "aws:elasticbeanstalk:environment", 
    "Value": "LoadBalanced"
}]

0 个答案:

没有答案