>>>>>>> cn
翻译或纠错本页面

恢复一个单独的分片

On this page

概述

在不影响其他分片的情况下恢复一个分片的数据需要一些注意事项和实践.这篇文档列出了在恢复一个单独分片的数据时需要考虑的额外的工作.

参考以下文档获得一般情况下备份的信息以及对一个分片进行备份还原的信息:

过程

Always restore sharded clusters as a whole. When you restore a single shard, keep in mind that the balancer process might have moved chunks to or from this shard since the last backup. If that’s the case, you must manually move those chunks, as described in this procedure.

1

Restore the shard as you would any other mongod instance.

See MongoDB备份方案 for overviews of these procedures.

2

Manage the chunks.

For all chunks that migrate away from this shard, you do not need to do anything at this time. You do not need to delete these documents from the shard because the chunks are automatically filtered out from queries by mongos. You can remove these documents from the shard, if you like, at your leisure.

For chunks that migrate to this shard after the most recent backup, you must manually recover the chunks using backups of other shards, or some other source. To determine what chunks have moved, view the changelog collection in the Config Database.