我无法运行动态动态守护进程
$> dynamic-dynamodb
$>./dynamic-dynamodb -run
2015-09-11 09:32:44,238 - dynamic-dynamodb - ERROR - Failed to connect to DynamoDB. Retrying in 5 seconds
2015-09-11 09:32:49,244 - dynamic-dynamodb - ERROR - Failed to connect to DynamoDB. Retrying in 5 seconds
2015-09-11 09:32:54,249 - dynamic-dynamodb - ERROR - Failed to connect to DynamoDB. Retrying in 5 seconds
^CTraceback (most recent call last):
File "./dynamic-dynamodb", line 22, in <module>
import dynamic_dynamodb
File "/root/dynamic-dynamodb/dynamic_dynamodb/__init__.py", line 29, in <module>
from dynamic_dynamodb.aws import dynamodb
File "/root/dynamic-dynamodb/dynamic_dynamodb/aws/dynamodb.py", line 688, in <module>
DYNAMODB_CONNECTION = __get_connection_dynamodb()
File "/root/dynamic-dynamodb/dynamic_dynamodb/aws/dynamodb.py", line 616, in __get_connection_dynamodb
time.sleep(5)
我已将IAM政策添加到我的EC2
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:DescribeTable",
"dynamodb:ListTables",
"dynamodb:UpdateTable",
"cloudwatch:GetMetricStatistics"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"sns:Publish"
],
"Resource": [
"arn:aws:sns:*::dynamic-dynamodb"
]
}
]
}
如果我这样做:
$> ./dynamic-dynamodb --run
我没有得到任何回复,并且我的dynamodb表没有进行任何更改
我在这里缺少什么!启动dynamic-dynamodb守护进程的正确方法是什么? 我使用pip而不是CloudFormation模板获得动态dynamodb。 感谢
答案 0 :(得分:0)
我通过pip在EC2服务器上安装了dynamic_dynamodb。一切似乎都在起作用,所以我只会告诉你我为了让它作为一个守护进程运行所遵循的步骤。
dynamic-dynamodb --daemon start -c dynamic_dynamodb.conf
在守护程序模式下启动dynamic_dynamodb根据您的环境,您可能需要更改命令以正确查看文件,特别是如果您想从cron启动它。