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?
|
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. |
|||
|
|
|
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. |
|||||
|