Hi,
I have my cluster configuration like this :
shard 1 replica set :
- cluster1:10001 /data/cluster1/set1 master
- cluster1:10002 /data/cluster1/set2
- cluster1:10003 /data/cluster1/set3
shard 2 replica set :
- cluster2:10004 /data/cluster2/set1 master
- cluster2:10005 /data/cluster2/set2
- cluster2:10006 /data/cluster2/set3
config servers :
- cluster1:20001 /data/config1
- cluster1:20002 /data/config2
- cluster2:20003 /data/config3
mongos servers :
- cluster1:27017
And below is the step I used to backup my file :
1. I go into the mongos server and do :
mongos> use config
mongos> db.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true );
2. Then I use mongodump to dump the config database on mongos server :
mongodump --host cluster1 --port 27017 --db config
3. Then I go into each cluster and do the mongodump :
cluster1 :
mongodump --host cluster1 --port 10001 --out /backup/mongodump-set1 --oplog
cluster2 :
mongodump --host cluster1 --port 10004 --out /backup/mongodump-set2 --oplog
So basically until here I have all the backup and I turn back on the balancer :
use config
db.settings.update( { _id : "balancer" }, { $set : { stopped : false }}, true);
Then I tried to delete the existing collection and tried to restore using the backup, so far so good for the other mongod, but when I tried to do this on config mongod server in cluster2 I got something like this :
bin/mongorestore --host cluster2 --port 20003 --db config /mongodb/mongodb-linux-x86_64-2.2.0/dump/config
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Could someone tell me what to do to make all the data can be restored and run again normally?
Thanks.