Closed snoopy83101 closed 6 years ago
Currently you have to list each one explicitly.
I had a question : Can new collections added to database be automatically sent to elasticsearch ? considering i use wild card like : namespace-regex = '^mydb.(*\$cmd)$' so ideally it will search through all the collections. will it cater to new collections that i add?
2- Sometimes i have observed collections are not getting synced at all.
Hi it doesn’t actually maintain a list of collections but rather listens for all changes in Mongodb and then tests the namespace of the change against your regex. So yes it would pick up new collections dynamically.
Simply use ^mydb. as your regex.
If a collection is not getting synced make sure it’s db.col is a match against your configured regexes. Or remove those regexes and sync all changes.
There should be a backslash before the . In the regex. In my previous comment. It got removed when I posted.
hi thanks for quick reply so i used namespace-regex = '^my-database\.'
or namespace-regex = ^my-database\.([A-Za-z0-9\-]*\$cmd)$
Collections in my database are test1 and test2
and also tried removing regex completely just to push all data to elasticsearch but in logs i only see details related to monstache_stats index.
PS there are no indexes defined in the elasticsearch i was hoping for exception in logs that index not found etc
Have you also put all the namespaces that you currently have in the direct-read-namespaces array? If you are syncing for the first time you need to do direct reads. Or replay the oplog. By default monstache just tails the oplog for new changes.
Also if you have a dash in your db name then you need to escape it in the regex.
hi thanks for pointing out the error the replay=true did the trick. Also wanted to know that will this be capable of working in production on sharded environment ?
It does have support for sharded clusters. See the docs for mongo-url and mongo-config-url.
https://rwynn.github.io/monstache-site/config/
You would need to evaluate if this would work in your production setup. I don’t have any references at this time.
At the first synchronization I want to express all the collections in a database。 How should I write direct-read-namespaces