【发布时间】:2017-06-07 10:52:06
【问题描述】:
mongo 配置信息:
- mongo 版本:3.2.10
- mongo 分片,密钥为:{secretTaskId:1, time: 1}
- TTL 索引:{time: 1}, {expireAfterSeconds: 60 * 60 * 24 * 8, background: true} # 8 days
- mongo 平衡器已启用并正在运行:sh.isBalancerRunning() ===> true
问题描述
TTL 配置正常工作,文档在超时时自动删除。 但是配置数据库中的块没有更新(删除),文件消失了,块仍然存在。
例如:
js
// chunks in config database
// As the date is 2017-06-07 now, documents create in 2016 had removed, but the chunks for them are still remain. ( more old chunks can be found, not single.)
{
"_id": "****",
"lastmod": Timestamp(3, 0),
"lastmodEpoch": ObjectId("58253bbffbb3d96a85eccef1"),
"ns": "***",
"min": {"secretTaskId": "***", "time": ISODate("2016-11-11T03:32:40.045Z")},
"max": {"secretTaskId": "***", "time": ISODate("2016-11-14T09:20:45.684Z")},
"shard": "***"
}
由于块没有被删除,mongo shard cluster 不是 balance 属性。我认为平衡器对分发的实际文档并不理想,并且基于错误块无法正确工作。
经过大量搜索,我没有找到解决方案。任何人都可以帮忙吗?谢谢。
【问题讨论】: