Mongo connector is lag behind mongodb
See original GitHub issueHi guys, We are using mongo-connector to feed data from mongodb to elasticsearch. Everything went well until today we have a big insert / update to mongodb and mongo-connector started falling behind and taking hours to catch-up. Here is the mongo-connector config:
"mainAddress": "10.a.b.c:27017",
"oplogFile": "/var/log/mongo-connector/oplog.timestamp",
"noDump": false,
"batchSize": -1,
"verbosity": 2,
"continueOnError": true,
"docManagers": [
{
"docManager": "elastic2_doc_manager",
"targetURL": "10.x.y.z:9200",
"bulkSize": 1000,
"__uniqueKey": "_id",
"args": {
"clientOptions": {"timeout": 60}
}
}
Elasticsearch is setup as cluster of 3 servers. I’m looking for anyway to make mongo-connector tailing and update data faster.
Thanks everyone.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:42 (1 by maintainers)
Top Results From Across the Web
Mongo Replica Lag Falls behind - - Replication - MongoDB
I have a mongo cluster that has the same hardware across 3 servers. It is currently set to Master, Secondary Secondary, and the...
Read more >How to find the cause of replication lag on a particular ...
I have one more thought about this: replication lag was typically caused because the secondary cannot process the incoming writes fast enough, ...
Read more >Troubleshoot Replica Sets — MongoDB Manual
Replication lag can be a significant issue and can seriously affect MongoDB replica set deployments. Excessive replication lag makes "lagged" members ...
Read more >Replication Lag on Secondary in 3 node mongodb Cluster
Hi Mongo DB Team, We have a 3-node MongoDB Replication cluster with mongo version ... servers is lag behind the primary (sometimes 2-5...
Read more >Replication lag for more than 10 hours - MongoDB
Your insert operation is asking for WriteConcern: “majority”, and it has a timeout of 15 seconds, meaning if the system can't write to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good to hear! 😃 Thank you for your patience. Now it is time to prepare some tests and make a pull request. I will do that soon.
@luisobo @behackett I have been out of town for a few weeks, but I will try and see if I tidy up my solution and make an upstream PR.
@luisobo it’s not just the upserts that can/should be batched, it’s every operation. ElasticSearch allows a “bulk indexing operation” with any number of inserts/updates/deletes that will be run in the order specified (see: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html).
Mongo Connector is just passing each oplog operation to the doc manager to handle it however it sees fit. In order to properly replicate the database state, the operations must be run “one at a time” in the exact order they happened. So if Mongo Connector tried to do any batching logic, it may not be correct for how the downstream data store needs to handle the operations. But since we know we can batch them in a bulk indexing request and that they will be run in order, we can do that for ES to prevent unnecessary network calls.