发布于 2015-09-14 14:51:11 | 107 次阅读 | 评论: 0 | 来源: 网络整理

Overview

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.

Procedure

  1. Stop all mongod and mongos processes.

  2. If shard hostnames have changed, you must manually update the shards collection in the 配置数据库内容 to use the new hostnames. Do the following:

    1. 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
      
    2. Restore the 配置数据库内容 on each config server.

    3. Start one mongos instance.

    4. Update the 配置数据库内容 collection named shards to reflect the new hostnames.

  3. Restore the following:

    • Data files for each server in each shard. Because replica sets provide each production shard, restore all the members of the replica set or use the other standard approaches for restoring a replica set from backup. See the Restore a Snapshot and Restore a Database with mongorestore sections for details on these procedures:
    • Data files for each config server, if you have not already done so in the previous step.
  4. Restart the all the mongos instances.

  5. Restart all the mongod instances.

  6. 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
    
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务