Before starting please have a mongo replica set initiated.
I have mongo running at localhost:27170
and elasticsearch at localhost:9200
The test dataset I used is available on the mongodb website.
I am using MongoDB 2.6 and Elasticsearch 2.2.0 on a Windows machine.
Here I have tested three cases:
- An index already exists,
mc-test-index
in this case - A template for an index exists.
mc-template
in this case - No destination index is specified
Expections:
- The documents should be directly index according to settings/mappings given in
new_template.json
formc-test-index
. - The index named
new_test_template
should be created according to the template given innew_template.json
and normal indexing should occur. - For
temp_default
, the index should have the default mappings/settings
Files:
create_template_and_index.py
creates the index and templatenew_template.json
contains the template and settings/mappings of the indices being consideredupsert_to_mongo.py
reads data from the dataset and inserts into mongo collections
TODO:
- This tool has not been tested as a service
- Source and namespace destinations when given as comma-seprated lists do not work
mongo-connector -m localhost:27017 -t localhost:9200 -o E:/mongo-connector.oplog -d elastic2_doc_manager -n test_template.dataset,test_created_index.dataset,test_default.dataset -g new_test_template.dataset,mc-test-index.dataset,test_default.dataset
seems to be unstable.