发布于 2015-09-14 14:51:11 | 116 次阅读 | 评论: 0 | 来源: 网络整理
The procedure outlined in this document addresses how to restore an entire sharded cluster. For information on related backup procedures consider the following tutorials describe backup procedures in detail:
The exact procedure used to restore a database depends on the method used to capture the backup. See the 系统备份策略 document for an overview of backups with MongoDB, as well as Sharded Cluster Backup Considerations which provides an overview of the high level concepts important for backing up sharded clusters.
If shard hostnames have changed, you must manually update the shards collection in the 配置数据库内容 to use the new hostnames. Do the following:
Start the three config servers by issuing commands similar to the following, using values appropriate to your configuration:
mongod --configsvr --dbpath /data/configdb --port 27019
Restore the 配置数据库内容 on each config server.
Start one mongos instance.
Update the 配置数据库内容 collection named shards to reflect the new hostnames.
Restore the following:
Restart the all the mongos instances.
Restart all the mongod instances.
Connect to a mongos instance from a mongo shell and run use the db.printShardingStatus() method to ensure that the cluster is operational, as follows:
db.printShardingStatus()
show collections