Maintaining capped collection in Master but not in Slave.

183 views
Skip to first unread message

kumar

unread,
May 1, 2012, 11:03:16 AM5/1/12
to mongodb-user

Hi All,

We are going to use "Master/Slave" configuration.

Is it possible to make one collection as capped collection in Master
and maintaining all documents of same collection in Slave?

Thanks,
Kumar

Scott Hernandez

unread,
May 1, 2012, 11:07:51 AM5/1/12
to mongod...@googlegroups.com
No, there is no option for that. The goal of replication it have the
*same* data on all nodes.

If you wanted to do this you could but it would require stopping the
slave and starting up in non-slave mode, changing the collection to
not be capped, and then starting it in slave mode again. Replication
does not check the state of the collection once replication has been
established -- it just replicates data changes.

This is not something suggested or supported.
> --
> 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.
>

Manan Shah

unread,
Sep 30, 2013, 5:45:02 PM9/30/13
to mongod...@googlegroups.com
Not true. My system.profile collection and all the _bkp versions of it didnt get replicated for the data part on the secondaries although the name of such collections did get replicated. Very strange!

Interestingly the system.profile capped collection itself isnt getting replicated. Any idea why?

group:PRIMARY> db.system.profile.count()
28358

group:SECONDARY> db.system.profile.count()
0

group:PRIMARY> db.system.profile_rockmongo_bk_52461190e998a.count()

869423

group:SECONDARY> db.system.profile_rockmongo_bk_52461190e998a.count()

0




Jeff Lee

unread,
Sep 30, 2013, 7:27:34 PM9/30/13
to mongod...@googlegroups.com


--
--
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 unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages