Is there any way to make my mongodump output to be send directly into
remote machine folder? For example I have two machines A and B, I want to
put my mongodump from machine A directly to machine B "/backup" folder what
should I put after --out parameter?
Could you just run mongodump from machine_b? As long as you can connect to machine_a from machine_b (which I assume you can, if you are trying to drop files there) you could just run the command you have given from machine_b and give the --out as the "/backup" directory.
On Tuesday, October 23, 2012 1:29:20 PM UTC+11, Martinus Martinus wrote:
> Hi,
> Is there any way to make my mongodump output to be send directly into > remote machine folder? For example I have two machines A and B, I want to > put my mongodump from machine A directly to machine B "/backup" folder what > should I put after --out parameter?
Thanks for your answer. Yeah, that could also be a solution. And if I have
2 shards where each shard has 3 replicaSets, can I do this to make
mongodump for my shard 1 and shard 2 (without lock, because mongodump can't
be used when the database is locked) :
> Could you just run mongodump from machine_b? As long as you can connect
> to machine_a from machine_b (which I assume you can, if you are trying to
> drop files there) you could just run the command you have given from
> machine_b and give the --out as the "/backup" directory.
> Regards,
> André
> On Tuesday, October 23, 2012 1:29:20 PM UTC+11, Martinus Martinus wrote:
>> Hi,
>> Is there any way to make my mongodump output to be send directly into
>> remote machine folder? For example I have two machines A and B, I want to
>> put my mongodump from machine A directly to machine B "/backup" folder what
>> should I put after --out parameter?
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
You are able to take a mongodump from the primaries while they are running if you wish, but you should be aware of the load that this process will put on your node. It might be better to take the backups from a secondary node, or a secondary hidden node. If you back up from secondaries, not only will there be less pressure on your primary but you will also be able to lock the secondaries if needed. If necessary you could even stop the process on the secondary entirely.
You should also be aware that you must stop the balancer (and wait for chunk migrations to finish) before doing any of the backups. If you skip this step, then you might find duplicate or spurious data.
Either of your techniques for backing up the config DB should be okay, as long as the balancer is off at the time.
Thanks for your answer. I remember if I put a lock on the secondary node
and shut it down, I can't use mongodump to make a backup out of it. Can you
explain more about secondary hidden node? and after I stop the balancer
from mongos, how do I know if the chunk migrations is already finish or not
before I do the backup process on shard servers? Because currently I just
followed the steps explained in mongodb website : 1. stop the balancer and
2. mongodump the config db.
Thanks.
On Thu, Oct 25, 2012 at 12:15 PM, Andre de Frere <andre.defr...@10gen.com>wrote:
> You are able to take a mongodump from the primaries while they are running
> if you wish, but you should be aware of the load that this process will put
> on your node. It might be better to take the backups from a secondary
> node, or a secondary hidden node. If you back up from secondaries, not
> only will there be less pressure on your primary but you will also be able
> to lock the secondaries if needed. If necessary you could even stop the
> process on the secondary entirely.
> You should also be aware that you must stop the balancer (and wait for
> chunk migrations to finish) before doing any of the backups. If you skip
> this step, then you might find duplicate or spurious data.
> Either of your techniques for backing up the config DB should be okay, as
> long as the balancer is off at the time.
> Regards,
> André
>> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
You can still use mongodump to dump databases even if the secondary is down. This is done through the --dbpath option which allows mongodump to connect directly to the db files without the mongod process. You can find more information at the documentation: http://docs.mongodb.org/manual/reference/mongodump/
A hidden node is one that has a priority of 0 (so it cannot be elected primary) and also cannot have client read requests directed to it. It will still take part in elections, even if it cannot become primary. You can find more information in the documentation here: http://docs.mongodb.org/manual/administration/replica-sets/#replica-s...
You can check the locks collection in the config database to see if the balancer is currently doing a migration. In 2.2 this is taken care of with the "sh.stopBalancer()" shell function, but in prior versions you can do something similar with:
On Thursday, October 25, 2012 6:23:30 PM UTC+11, Martinus Martinus wrote:
> Hi Andre,
> Thanks for your answer. I remember if I put a lock on the secondary node > and shut it down, I can't use mongodump to make a backup out of it. Can you > explain more about secondary hidden node? and after I stop the balancer > from mongos, how do I know if the chunk migrations is already finish or not > before I do the backup process on shard servers? Because currently I just > followed the steps explained in mongodb website : 1. stop the balancer and > 2. mongodump the config db.
> Thanks.
> On Thu, Oct 25, 2012 at 12:15 PM, Andre de Frere <andre....@10gen.com<javascript:>
> > wrote:
>> Hi Martinus,
>> You are able to take a mongodump from the primaries while they are >> running if you wish, but you should be aware of the load that this process >> will put on your node. It might be better to take the backups from a >> secondary node, or a secondary hidden node. If you back up from >> secondaries, not only will there be less pressure on your primary but you >> will also be able to lock the secondaries if needed. If necessary you >> could even stop the process on the secondary entirely.
>> You should also be aware that you must stop the balancer (and wait for >> chunk migrations to finish) before doing any of the backups. If you skip >> this step, then you might find duplicate or spurious data.
>> Either of your techniques for backing up the config DB should be okay, as >> long as the balancer is off at the time.
>> Regards,
>> André
>>> -- >> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongod...@googlegroups.com<javascript:>
>> To unsubscribe from this group, send email to
>> mongodb-user...@googlegroups.com <javascript:>
>> See also the IRC channel -- freenode.net#mongodb
> You can still use mongodump to dump databases even if the secondary is
> down. This is done through the --dbpath option which allows mongodump to
> connect directly to the db files without the mongod process. You can find
> more information at the documentation:
> http://docs.mongodb.org/manual/reference/mongodump/
> A hidden node is one that has a priority of 0 (so it cannot be elected
> primary) and also cannot have client read requests directed to it. It will
> still take part in elections, even if it cannot become primary. You can
> find more information in the documentation here:
> http://docs.mongodb.org/manual/administration/replica-sets/#replica-s...
> You can check the locks collection in the config database to see if the
> balancer is currently doing a migration. In 2.2 this is taken care of with
> the "sh.stopBalancer()" shell function, but in prior versions you can do
> something similar with:
> On Thursday, October 25, 2012 6:23:30 PM UTC+11, Martinus Martinus wrote:
>> Hi Andre,
>> Thanks for your answer. I remember if I put a lock on the secondary node
>> and shut it down, I can't use mongodump to make a backup out of it. Can you
>> explain more about secondary hidden node? and after I stop the balancer
>> from mongos, how do I know if the chunk migrations is already finish or not
>> before I do the backup process on shard servers? Because currently I just
>> followed the steps explained in mongodb website : 1. stop the balancer and
>> 2. mongodump the config db.
>> Thanks.
>> On Thu, Oct 25, 2012 at 12:15 PM, Andre de Frere <andre....@10gen.com>wrote:
>>> Hi Martinus,
>>> You are able to take a mongodump from the primaries while they are
>>> running if you wish, but you should be aware of the load that this process
>>> will put on your node. It might be better to take the backups from a
>>> secondary node, or a secondary hidden node. If you back up from
>>> secondaries, not only will there be less pressure on your primary but you
>>> will also be able to lock the secondaries if needed. If necessary you
>>> could even stop the process on the secondary entirely.
>>> You should also be aware that you must stop the balancer (and wait for
>>> chunk migrations to finish) before doing any of the backups. If you skip
>>> this step, then you might find duplicate or spurious data.
>>> Either of your techniques for backing up the config DB should be okay,
>>> as long as the balancer is off at the time.
>>> Regards,
>>> André
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongod...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> mongodb-user...@**googlegroups.com
>>> See also the IRC channel -- freenode.net#mongodb
>> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
The two commands you have listed are functionally equivalent.
If you have a look at the sh.stopBalancer() command you will see that it does sh.setBalancerState(false) (which is equivalent of db.getSiblingDB("config").settings.update({_id:"balancer"},{$set:{stopped:t rue}},true) ) and then also waits for the locks to resolve.
The waiting for the locks to resolve is the new functionality in sh.stopBalancer() from 2.2.
> On Fri, Oct 26, 2012 at 12:39 PM, Andre de Frere <andre....@10gen.com<javascript:>
> > wrote:
>> Hi Martinus,
>> You can still use mongodump to dump databases even if the secondary is >> down. This is done through the --dbpath option which allows mongodump to >> connect directly to the db files without the mongod process. You can find >> more information at the documentation: >> http://docs.mongodb.org/manual/reference/mongodump/
>> A hidden node is one that has a priority of 0 (so it cannot be elected >> primary) and also cannot have client read requests directed to it. It will >> still take part in elections, even if it cannot become primary. You can >> find more information in the documentation here:
>> http://docs.mongodb.org/manual/administration/replica-sets/#replica-s...
>> You can check the locks collection in the config database to see if the >> balancer is currently doing a migration. In 2.2 this is taken care of with >> the "sh.stopBalancer()" shell function, but in prior versions you can do >> something similar with:
>> On Thursday, October 25, 2012 6:23:30 PM UTC+11, Martinus Martinus wrote:
>>> Hi Andre,
>>> Thanks for your answer. I remember if I put a lock on the secondary node >>> and shut it down, I can't use mongodump to make a backup out of it. Can you >>> explain more about secondary hidden node? and after I stop the balancer >>> from mongos, how do I know if the chunk migrations is already finish or not >>> before I do the backup process on shard servers? Because currently I just >>> followed the steps explained in mongodb website : 1. stop the balancer and >>> 2. mongodump the config db.
>>> Thanks.
>>> On Thu, Oct 25, 2012 at 12:15 PM, Andre de Frere <andre....@10gen.com>wrote:
>>>> Hi Martinus,
>>>> You are able to take a mongodump from the primaries while they are >>>> running if you wish, but you should be aware of the load that this process >>>> will put on your node. It might be better to take the backups from a >>>> secondary node, or a secondary hidden node. If you back up from >>>> secondaries, not only will there be less pressure on your primary but you >>>> will also be able to lock the secondaries if needed. If necessary you >>>> could even stop the process on the secondary entirely.
>>>> You should also be aware that you must stop the balancer (and wait for >>>> chunk migrations to finish) before doing any of the backups. If you skip >>>> this step, then you might find duplicate or spurious data.
>>>> Either of your techniques for backing up the config DB should be okay, >>>> as long as the balancer is off at the time.
>>>> Regards,
>>>> André
>>>>> -- >>>> You received this message because you are subscribed to the Google
>>>> Groups "mongodb-user" group.
>>>> To post to this group, send email to mongod...@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> mongodb-user...@**googlegroups.com
>>>> See also the IRC channel -- freenode.net#mongodb
>>> -- >> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongod...@googlegroups.com<javascript:>
>> To unsubscribe from this group, send email to
>> mongodb-user...@googlegroups.com <javascript:>
>> See also the IRC channel -- freenode.net#mongodb
> The two commands you have listed are functionally equivalent.
> If you have a look at the sh.stopBalancer() command you will see that it
> does sh.setBalancerState(false) (which is equivalent of
> db.getSiblingDB("config").settings.update({_id:"balancer"},{$set:{stopped:t rue}},true)
> ) and then also waits for the locks to resolve.
> The waiting for the locks to resolve is the new functionality in
> sh.stopBalancer() from 2.2.
> Regards,
> André
> On Friday, October 26, 2012 5:55:45 PM UTC+11, Martinus Martinus wrote:
>> Hi Andre,
>> Thank you for your complete explanations. I already use mongo 2.2.0, so
>> if I do sh.stopBalancer() will it be the same as doing :
>> On Fri, Oct 26, 2012 at 12:39 PM, Andre de Frere <andre....@10gen.com>wrote:
>>> Hi Martinus,
>>> You can still use mongodump to dump databases even if the secondary is
>>> down. This is done through the --dbpath option which allows mongodump to
>>> connect directly to the db files without the mongod process. You can find
>>> more information at the documentation: http://docs.** >>> mongodb.org/manual/reference/**mongodump/<http://docs.mongodb.org/manual/reference/mongodump/>
>>> You can check the locks collection in the config database to see if the
>>> balancer is currently doing a migration. In 2.2 this is taken care of with
>>> the "sh.stopBalancer()" shell function, but in prior versions you can do
>>> something similar with:
>>> On Thursday, October 25, 2012 6:23:30 PM UTC+11, Martinus Martinus wrote:
>>>> Hi Andre,
>>>> Thanks for your answer. I remember if I put a lock on the secondary
>>>> node and shut it down, I can't use mongodump to make a backup out of it.
>>>> Can you explain more about secondary hidden node? and after I stop the
>>>> balancer from mongos, how do I know if the chunk migrations is already
>>>> finish or not before I do the backup process on shard servers? Because
>>>> currently I just followed the steps explained in mongodb website : 1. stop
>>>> the balancer and 2. mongodump the config db.
>>>> Thanks.
>>>> On Thu, Oct 25, 2012 at 12:15 PM, Andre de Frere <andre....@10gen.com>wrote:
>>>>> Hi Martinus,
>>>>> You are able to take a mongodump from the primaries while they are
>>>>> running if you wish, but you should be aware of the load that this process
>>>>> will put on your node. It might be better to take the backups from a
>>>>> secondary node, or a secondary hidden node. If you back up from
>>>>> secondaries, not only will there be less pressure on your primary but you
>>>>> will also be able to lock the secondaries if needed. If necessary you
>>>>> could even stop the process on the secondary entirely.
>>>>> You should also be aware that you must stop the balancer (and wait for
>>>>> chunk migrations to finish) before doing any of the backups. If you skip
>>>>> this step, then you might find duplicate or spurious data.
>>>>> Either of your techniques for backing up the config DB should be okay,
>>>>> as long as the balancer is off at the time.
>>>>> Regards,
>>>>> André
>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "mongodb-user" group.
>>>>> To post to this group, send email to mongod...@googlegroups.com
>>>>> To unsubscribe from this group, send email to
>>>>> mongodb-user...@**googlegroups.**com
>>>>> See also the IRC channel -- freenode.net#mongodb
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongodb-user" group.
>>> To post to this group, send email to mongod...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> mongodb-user...@**googlegroups.com
>>> See also the IRC channel -- freenode.net#mongodb
>> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb