Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Does MonogDB supports replication where I have many machines with MongoDB that have different data and I want to replicate this data to one, and only one MongoDB?

share|improve this question

2 Answers 2

By the literal interpretation of your question, this can't be done. A secondary/slave cannot be secondary/slave to multiple MongoDB instances.

However, what you could do (and still is far from ideal and not recommended in production) is set up multiple MongoDB masters, each with one slave. These slaves all reside on the one server but each runs on a different port, thus giving you multiple MongoDBs but all on the one server. Master/slave is described here.

There will undoudtedly be memory and i/o issues but it could (in theory) be configured.

share|improve this answer

Although I havn't tested it, you should be able to add one node to multiple replica sets. Be careful that none of your replicasets share the same databases as this may screw up your "backup" node. Same applies to your collections within a database (Maybe MongoDB even disallows this, but I'm not sure.).

Anyway I'm not so sure if you should replicate multiple nodes to one as this would cause huge load on the single backup node. Why do you want exactly one Node to replicate to? Maybe you want to take a look at this: https://github.com/micahwedemeyer/automongobackup.

share|improve this answer
    
I think about transfering/merge many MongoDB databases into one. I have many machines with local MongoDB and one client that need pull data from all. So I wonder if could be easier if client pull data from one local database that have data from others –  userbb May 12 '12 at 18:08
    
Hmm I'm not sure if MongoDB is the right choice then. You may consider to use couchdb in that case as this is written for distributed dbs which are located at several not always connected systems. mongodb.org/display/DOCS/Comparing+Mongo+DB+and+Couch+DB but other requirements of your application may prefer mongodb... Please check this link and CouchDB to see if this would fit better. –  philnate May 12 '12 at 20:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.