简体   繁体   English

elasticsearch:从 mongodb 重新同步索引

[英]elasticsearch: resyncing the indexes from mongodb

I have following situation need some help:我有以下情况需要帮助:

  • running mongodb replicaSet with 3 instances having multiple dbs and collections使用 3 个具有多个数据库和集合的实例运行 mongodb replicaSet
  • running elasticsearch运行弹性搜索
  • in order to trigger sync between elasticsearch and mongodb i run the following command >mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager And it worked perfectly all the data from mongodb synced to elasticsearch nice and sweet.为了触发 elasticsearch 和 mongodb 之间的同步,我运行以下命令>mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager它完美地将 mongodb 的所有数据同步到>mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager .
  • things were working in perfect harmony....事情在完美的和谐中运作......
  • till the time i deleted all indices from elastic search for resolving another problem.直到我从弹性搜索中删除所有索引以解决另一个问题。

Problem: As i deleted all the indices from my elasticsearch.问题:因为我从我的 elasticsearch 中删除了所有索引。 when i re run this command >mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager it doesnt sync data from mongodb to elasticsearch.当我重新运行此命令时>mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager它不会将数据从 mongodb 同步到>mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager I also tried mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager -n {db}.{collection_name} -g {djangodb}.{spiderCollection1} But it doesnt work.我也试过mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager -n {db}.{collection_name} -g {djangodb}.{spiderCollection1}但它不起作用。

What can i do to retrigger the sync of collections/documents in elasticsearch from mongodb?我该怎么做才能从 mongodb 重新触发 elasticsearch 中集合/文档的同步? Or how can i perform re-syncing of data from mongodb to elasticsearch或者如何将数据从 mongodb 重新同步到 elasticsearch

no versions of db or elasticsearch has been changed/modified.没有更改/修改 db 或 elasticsearch 版本。

Will appreciate your help.将感谢您的帮助。

Thanks,谢谢,

Worked, by recreating the db in the mongodb again.通过再次在 mongodb 中重新创建数据库来工作。 But if any one knows anyother alternative workaround, please feelfree to share without having to create the db again in mongodb.但是,如果有人知道任何其他替代解决方法,请随时分享而无需在 mongodb 中再次创建数据库。 thanks,谢谢,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM