GAE同步生产和开发数据存储

时间:2012-08-25 00:06:14

标签: google-app-engine google-cloud-datastore database-backups

我可以下载我的生产GAE数据存储的备份,但我无法将备份上传到我的开发应用程序。以下是我的尝试:

从生产中下载商店,按预期工作:

appcfg.py download_data --application=s~myApp --url=http://myApp.appspot.com/_ah/remote_api --filename=backup1

将备份扩展到dev存储,失败:

appcfg.py upload_data --application=dev~myApp  --url=http://localhost:8080/_ah/remote_api --filename=backup1
Uploading data records.
[INFO    ] Logging to bulkloader-log-20120823.225047
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20120823.225047.sql3
Please enter login credentials for localhost
Email: myemail@gmail.com
Password for myemail@gmail.com: 
[INFO    ] Connecting to localhost:8080/_ah/remote_api
[INFO    ] Starting import; maximum 10 entities per post
............................................................................................................................................................[INFO    ] Unexpected thread death: WorkerThread-5
[INFO    ] An error occurred. Shutting down...
.........[ERROR   ] Error in WorkerThread-5: <urlopen error [Errno 61] Connection refused>

[INFO    ] 2670 entities total, 0 previously transferred
[INFO    ] 1650 entities (1207416 bytes) transferred in 431.1 seconds
[INFO    ] Some entities not successfully transferred

似乎错误61是端口错误。该应用程序正在运行,我已通过浏览器以管理员身份登录,并且我还在CLI命令中输入了我的电子邮件/密码。一些记录总是上传,然后上传过程被切断。

1 个答案:

答案 0 :(得分:1)

我总是发现将数据上传到本地数据存储更可靠,将线程数设置为1.记住dev服务器本质上是单线程的。尝试使用--num_threads=1运行它。

我还建议设置--db_filename=DB_FILENAME来创建进度数据库,这意味着如果它失败,你可以从它到达的地方重新启动。

在尝试编写大型实体时,我有时也不得不减少批量大小。

干杯