What's in Local.* files?

510 views
Skip to first unread message

JonW

unread,
Oct 7, 2010, 6:08:33 PM10/7/10
to mongodb-user
I'm looking at the pages on promoting a slave to a master and one of
the steps says to copy the new master's local.* files to the new slave
db. What's contained in those Local.* files? Why does this need to
occur?

Also, if there are other existing slaves in that cluster, should I
also be replacing their Local.* files too?

Thanks.

Kristina Chodorow

unread,
Oct 7, 2010, 7:23:40 PM10/7/10
to mongod...@googlegroups.com
The local database contains replication info: the configuration and the recent operations that have been applied to the master.  Copying the local files over gives all of the replication info from the master to the slave.

Yes, you should replace all of the slaves' local files with the new master's, as this will update their configurations (who they're syncing from).  You'll get errors about your source not being correct if you leave the old ones there.  Or you could remove them and let new local files be created if you don't mind waiting for them to be allocated/populated.

Incidentally, you can use the local database in your application for any data you don't want replicated.  It's not a reserved database or anything.



--
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.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Markus Gattol

unread,
Oct 8, 2010, 5:00:04 AM10/8/10
to mongod...@googlegroups.com

JonW> I'm looking at the pages on promoting a slave to a master and one
JonW> of the steps says to copy the new master's local.* files to the
JonW> new slave db. What's contained in those Local.* files? Why does
JonW> this need to occur?

Have a look at those links

http://www.markus-gattol.name/ws/mongodb.html#oplog
http://www.markus-gattol.name/ws/mongodb.html#can_i_upgrade_the_master_without_the_slave_needing_to_resync

Reply all
Reply to author
Forward
0 new messages