FIM
FIM

Reputation: 33

20 mongodbs servers centralized to only 1

I would like to know how I can make 20 instances of mongodb, each with a database with the name that is a unique number, synchronize these databases and their data to a central database.

Eg:

Server 1 - Database 1
Server 2 - Database 2
...
Server 20 - Database 20
Central Server - Database 1, 2, 3, ..., 20

Can anybody provide me with some articles? Github repo? I'm tring to use the: https://github.com/yougov/mongo-connector But I'm having a lot of problems with the authentication part... Each server need to have their own user so each server will only see their data. Already tried to create a custom role in my authSource/database with the following privileges: createCollection, find, insert, update, listCollections and listDatabases. But it didn't work either.

I'll appreciate your help!

Upvotes: 0

Views: 56

Answers (1)

Joe Drumgoole
Joe Drumgoole

Reputation: 1348

Create a Change Stream from each of the discrete databases and setup a listener on each of those streams that can write all changes to central database. you need MongoDB 3.6 or greater to use Change Streams.

Upvotes: 2

Related Questions