【发布时间】:2017-03-24 04:21:41
【问题描述】:
当我在 Google 数据存储上运行 update_indexes 时,我收到以下消息。它告诉我通过查看 GUI 来确定哪些索引有误,然后删除这些索引。
在 200 个索引中,我有 51 个错误的索引,从 GUI 中复制它们是不可行的。
(编辑:通过费力地从 datastore-indexes.xml 中删除和添加索引,我们确定了一个有问题的索引。)
良好的 devops 程序要求我们自动执行此类操作。
如何以编程方式确定哪些索引出错? (Python、bash 甚至 Java 都可以。)
Cannot build indexes that are in state ERROR.To vacuum and rebuild your indexes:
1. Create a backup of your index.yaml specification.
2. Determine the indexes in state ERROR from your admin console: https://appengine.google.com/datastore/indexes?&app_id=s~myproject
3. Remove the definitions of the indexes in ERROR from your index.yaml file.
4. Run "appcfg.py vacuum_indexes your_app_dir/"
5. Wait until the ERROR indexes no longer appear in your admin console.
6. Replace the modified version of your index.yaml file with the original.
7. Run "appcfg.py update_indexes your_app_dir/"
【问题讨论】:
标签: google-app-engine google-cloud-datastore devops database-indexes