OplogThread: Last entry no longer in oplog cannot recover!
来源:互联网 发布:2014matlab中对角矩阵 编辑:程序博客网 时间:2024/06/01 10:35
mongo-connector 和 es同步数据时出现如下错误
mongo_connector.oplog_manager:202 - OplogThread: Last entry no longer in oplog cannot recover! Collection(Database(MongoClient(host=
可能需要
Resyncing the Connector
https://github.com/mongodb-labs/mongo-connector/wiki/Resyncing-the-Connector
This page describes when and how to re-sync mongo-connector. You'll need to do this if you see the error message Last entry no longer in oplog cannot recover!. The most common reason to need to re-sync mongo-connector is that it couldn't replicate operations from the oplog fast enough. This can happen when there is a lot of write activity happening in MongoDB, such as when using mongoimport
. Because the oplog is a capped collection, older records are overwritten when the collection is full.
Avoiding Oplog Rollover
Mongo-connector can be more tolerant to short bursts of high write activity by increasing the oplog size in MongoDB. The greater oplog time allows mongo-connector to "catch up" when there is less write activity.
How to Perform a Re-Sync
The only way to ensure that the data in your external system is consistent with what is in MongoDB is to delete and re-index all documents in the target. After all data is removed, you may delete the oplog progress file (usually called "oplog.timestamp") and re-start mongo-connector. Mongo-connector will then perform a collection dump, re-indexing all your data. Be careful and double-check that you are deleting only and exactly what you mean to delete.
MongoDB
The simplest and fastest way to remove data from MongoDB is to drop the database:
mongo> db.getSisterDB("<database name>").dropDatabase(){ "dropped" : "<database name>", "ok" : 1 }
Or only drop a collection:
> db.getSisterDB("<database name>").<collection name>.drop()true
Solr
You can remove all data by sending a GET request to a URL:
http://<hostname>:<port>/solr/<core name>/update?commit=true&stream.body=<delete><query>*:*</query></delete>
Elasticsearch
You can remove all data quickly and efficiently by deleting the index and re-creating it:
curl -XDELETE http://<hostname>:<port>/<index name>curl -XPUT http://<hostname>:<port>/<index name>
After this, you should refresh the index to make these changes visible:
curl -XPOST http://<hostname>:<port>/<index name>/_refresh
Alternatives
There aren't any other methods to restore a consistent state with the source MongoDB replica set or cluster. However, you can get mongo-connector simply running again by deleting the oplog progress file and restarting mongo-connector. This causes mongo-connector to perform a collection dump, re-saving the latest versions of all documents, then start tailing the oplog. This does not bring your target to a consistent state but may be suitable for pure insert/update use cases. If any delete operations were clobbered by the oplog collection rollover, mongo-connector cannot catch them without a proper re-sync (described above)
- OplogThread: Last entry no longer in oplog cannot recover!
- 解决OplogThread: Failed during dump collection cannot recover!方案
- SharePoint Designer Check In and Check Out Error – Cannot perform this operation.The file is no longer check out or has been del
- ReadConsoleInputA no longer works correctly with DBCS in Windows 8.1
- No. 14 - Last Number in a Circle
- Fix for Cannot recover key error in JAVA
- Journal Entry NO.1 - The Election in Iraq
- No entry for BW_USER in table RSADMIN available
- Oplog
- oplog
- Error: The project file ' ' has been renamed or is no longer in the solution
- 关于ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc
- VS2010 The project file ' ' has been renamed or is no longer in the solution
- the project file '' has been renamed or is no longer in the solution 解决办法
- How to Delete [This is no longer located in Directory] Files
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- iOS开发 ☞ 关于带系统导航栏坐标的问题
- 20行代码能干嘛?
- Android中建造者(builder)模式
- Redis中RDB持久化
- Android SurfaceFligner Vsync信号 Jni/C++调用实现
- OplogThread: Last entry no longer in oplog cannot recover!
- 堆排序算法的实现(HeapSort)
- 转-C++快速入门
- scrapy爬虫的暂停与重启
- 面向对象状态机框架
- 如何做到phpmyadmin中最大限制:2,048KB 解决办法
- OpenCV-将图像作平滑处理并显示
- Wait waitpid
- 【Android】 点击空白处隐藏(收起)键盘