rwynn / monstache

a go daemon that syncs MongoDB to Elasticsearch in realtime. you know, for search.
https://rwynn.github.io/monstache-site/
MIT License
1.28k stars 180 forks source link

Can I run monstache with single Mongodb Instance? #285

Open junwu9333 opened 5 years ago

junwu9333 commented 5 years ago

We have an environment which only has single mongodb instance deployed, and we do not have mongodb replica set, how can i run Monstache to sync data from mongo to Elastic?

rwynn commented 5 years ago

@junwu9333 first option would be to convert your standalone to a single node replica set using the following:

https://docs.mongodb.com/manual/tutorial/convert-standalone-to-replica-set/

If, for some reason, you don't want any replica set then you would need to run monstache with the following settings:

disable-change-events = true
direct-read-namespaces = ["db1.col1", "db1.col2", "db2.col1"]
exit-after-direct-reads = true

In that configuration, you would only be able to do full sync of the named collections and you would not be able to resume from previous points in time. You could run this process periodically, but it would do a full sync each time.