AWS青苗工人无法启动SQS守护AWS-sqsd [英] AWS Beanstalk Worker can't start SQS daemon aws-sqsd
问题描述
我的目标是使用AWS的魔豆,创造应用环境型工人,它将处理高负荷的任务,这名工人的基础上我们的Rails应用程序。 我创建AWS魔豆工人环境: 环境梯队:红宝石,1.9.3在64位Linux的亚马逊 环境类型:单实例 (我也尝试64位的亚马逊的Linux 2014.03 V1.0.3具有同样的失败结果运行的Ruby 2.0(彪马))
My target is using AWS Beanstalk, create application environment type 'Worker' which will handle heavy loading tasks, this worker based on our Rails application. I create AWS Beanstalk Worker Environment: Environment tier: Ruby, 1.9.3 on 64bit Amazon Linux Environment type: single instance (i did try 64bit Amazon Linux 2014.03 v1.0.3 running Ruby 2.0 (Puma) with same failed result)
解决所有的问题,GEMS和数据库连接后,我卡在启动AWS-SQS队列客户端。它应该听队列,但HTTP请求到工人的应用程序。 我已经提供AWS_ACCESS_KEY_ID和AWS_SECRET_KEY以ENV变量这名工人例如:
After solving all issues with GEMS and database connection, i stuck on starting "aws-sqs" Queue client. It should listen Queue and do HTTP requests to Worker application. I've provide AWS_ACCESS_KEY_ID and AWS_SECRET_KEY to ENV variables for this Worker instance:
$ export | grep AWS
declare -x AWS_ACCESS_KEY_ID="AK...........Q"
declare -x AWS_AUTO_SCALING_HOME="/opt/aws/apitools/as"
declare -x AWS_CLOUDWATCH_HOME="/opt/aws/apitools/mon"
declare -x AWS_ELB_HOME="/opt/aws/apitools/elb"
declare -x AWS_IAM_HOME="/opt/aws/apitools/iam"
declare -x AWS_PATH="/opt/aws"
declare -x AWS_RDS_HOME="/opt/aws/apitools/rds"
declare -x AWS_SECRET_KEY="Hp.....fI"
declare -x EB_CONFIG_SYSTEM_AWSEBAGENTID=""
declare -x EB_CONFIG_SYSTEM_AWSEBREFERRERID=""
下面是日志输出:
2014-05-19T13:58:59Z init: initializing aws-sqsd 1.0 (2013-12-23)
2014-05-19T13:58:59Z start: polling https://sqs.us-east-1.amazonaws.com/201266939336/awseb-e-dq8cqaud2z-stack-AWSEBWorkerQueue-18836XBBHNDUD
2014-05-19T13:58:59Z fatal: AWS::Errors::MissingCredentialsError:
Missing Credentials.
Unable to find AWS credentials. You can configure your AWS credentials
a few different ways:
* Call AWS.config with :access_key_id and :secret_access_key
<<<
* On EC2 you can run instances with an IAM instance profile and credentials
will be auto loaded from the instance metadata service on those
instances.
* Call AWS.config with :credential_provider. A credential provider should
either include AWS::Core::CredentialProviders::Provider or respond to
the same public methods.
= Ruby on Rails
In a Ruby on Rails application you may also specify your credentials in
the following ways:
* Via a config initializer script using any of the methods mentioned above
(e.g. RAILS_ROOT/config/initializers/aws-sdk.rb).
* Via a yaml configuration file located at RAILS_ROOT/config/aws.yml.
This file should be formated like the default RAILS_ROOT/config/database.yml
file.
另外我有配置/初始化/ AWS-sdk.rb在我与此内容Rails应用程序:
Also i have config/initializers/aws-sdk.rb in my Rails application with this content:
AWS.config(
access_key_id: ENV["AWS_ACCESS_KEY_ID"],
secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"])
守护AWS-SQS根本不启动。 我可以有机会配置AWS-SQS以其他方式?
Daemon aws-sqs don't started at all. May i have chance to configure aws-sqs in some other way?
推荐答案
您正在使用的弹性魔豆不具备所需要的工人环境的权限也许实例配置文件。
Perhaps the instance profile you are using for your Elastic Beanstalk does not have the permissions needed for worker environments.
<一个href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.roles.aeb.html#AWSHowTo.iam.policies.actions.worker" rel="nofollow">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.roles.aeb.html#AWSHowTo.iam.policies.actions.worker
您可以确保您的IAM实例配置文件在上面的链接中列出的所有权限? (复制以下供参考)
Can you make sure your IAM Instance profile has all permissions listed in the link above? (Copied below for reference)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "QueueAccess",
"Action": [
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessage",
"sqs:ReceiveMessage"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "MetricsAccess",
"Action": [
"cloudwatch:PutMetricData"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
这篇关于AWS青苗工人无法启动SQS守护AWS-sqsd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!