【发布时间】:2015-03-17 14:13:09
【问题描述】:
我正在尝试将 DynamoDB 表备份到 S3。由于出于某种原因通过 AWS 控制台上的导出操作 does not work 并且由于表不是那么大,因此我尝试使用基于 boto 的脚本来执行此操作。这是我的脚本的主要部分:
import boto.dynamodb2
from boto.dynamodb2.table import Table
c_ddb2 = boto.dynamodb2.connect_to_region(...)
table = Table("myTable",connection=c_ddb2)
# also connect to S3
scanres = table.scan()
for item in scanres:
# process and store next item
我收到以下异常:
Traceback (most recent call last):
File "/home/.../ddb2s3.py", line 155, in <module>
main()
File "/home/.../ddb2s3.py", line 124, in main
for it in scanres:
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/results.py", line 62, in next
self.fetch_more()
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/results.py", line 144, in fetch_more
results = self.the_callable(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/table.py", line 1213, in _scan
**kwargs
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 1712, in scan
body=json.dumps(params))
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 2100, in make_request
retry_handler=self._retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 932, in _mexe
status = retry_handler(response, i, next_sleep)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb2/layer1.py", line 2134, in _retry_handler
response.status, response.reason, data)
boto.dynamodb2.exceptions.ProvisionedThroughputExceededException: ProvisionedThroughputExceededException: 400 Bad Request
{u'message': u'The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API', u'__type': u'com.amazonaws.dynamodb.v20120810#ProvisionedThroughputExceededException'}
读取配置的吞吐量设置为 1000,因此应该足够了。当我运行脚本并遇到异常时,写入配置的 t/p 设置为低值,我不想调整它,因为它会干扰偶尔批量写入表中,但为什么我需要触摸它?
为什么会出现此错误? MyTable 的 AWS 控制台监控显示的读取很少,因此远低于预置的 1000。我做错了什么?
【问题讨论】:
标签: amazon-web-services amazon-dynamodb boto throughput