Mongo-Connector,MongoDB OPLOG和ElasticSearch配置

时间:2017-11-01 00:11:19

标签: mongodb elasticsearch

我有一个简单的问题,只有专家才能回答。这种配置是否可行?

  • host1 - 运行mongo-connector
  • host2 - 运行ElasicSearch
  • host3 - 运行MongoDB(replicamode)

百万美元的问题是:我可以使用mongo-connector将MongoDb中发生的更改传播到ElasticSearch吗?底层问题是MongoDB opLog文件。 Mongo-Connector使用该文件来检测对ElasticSearch的crud操作。如何在这种配置下工作?

1 个答案:

答案 0 :(得分:0)

在做了涉及两个macbooks的简单测试后回答了我自己的问题。

I did the following to test.
  1. 在macBook上运行mongo-connector。
  2. 将mongo-connector配置为连接到在不同Macbook上运行的MongoDB ..并连接到在不同macBook上运行的ElasticSearch引擎。
  3. 请注意,mongoDB和Elastic Search Engine在此配置中位于同一个框中。
  4. what I observed:
    Mongo-connector was able to monitor the mongodb running remotely and was able to
     update Elastic search with all changes that hit the MongoDB. I started with 
    an empty ElasticSearch. Mongo-Connector was able to load all historical data 
    and then proceeded to load any real-time inserts/updates and deletes on 
    Mongodb into Elastic Search.
    ---- SO IT WORKS ----
    The trick is this: Use REAL IP ADDRESSES IN YOUR CONFIGURATION FILES.