toystars / node-elasticsearch-sync

ElasticSearch and MongoDB sync module for node
MIT License
17 stars 11 forks source link

Trying to run first sync and not data is written in the elasticsearch #20

Open shyperets opened 7 years ago

shyperets commented 7 years ago

Hello , Mongo information : DB name : fortitude , collection name : nodes , number of documents : 19 ES cluster information : http://ip:9200/

This is my main.js : ( main.js )

var ESMongoSync = require('node-elasticsearch-sync');

let transformFunction = (watcher, document, callBack) => { document.name = document.firstName + ' ' + document.lastName; callBack(document); }

let sampleWatcher = { collectionName: 'nodes', index: 'fortitude', type: 'nodes', transformFunction: null, // can be null fetchExistingDocuments: true, priority: 0 };

// the "collectionName" and "type" fields in watchers MUST be the same. This might change in later versions.

let watcherArray = []; watcherArray.push(sampleWatcher);

// The following env_vars are to be defined. Error will be thrown if any of the env_var is not defined

ESMongoSync.init(watcherArray, null);

This is the output of my code ,

root@eslogs.test.capriza.com:/opt/node_modules/node-elasticsearch-sync #node main.js

ESMongoSync: Connected to ElasticSearch successfully! ESMongoSync: Connected to MONGO server successfully. ESMongoSync: Beginning batch creation ESMongoSync: Processing watchers on priority level 0 ESMongoSync: Processing nodes collection ESMongoSync: Batch creation complete. Processing... ESMongoSync: Number of documents in batch - 100 ESMongoSync: Batch processing complete! ESMongoSync: Oplog tailing connection successful.

Nothing is written in the Elastic Search .

toystars commented 7 years ago

@shyperets did you export the required ENV_VARS as stated in the README?

shyperets commented 7 years ago

Yes , As you can see from the logs the script start with success , when some of the env are missing the script fail ... @shyperets

On 17 November 2016 at 13:42, Mustapha Babatunde notifications@github.com wrote:

@shyperets https://github.com/shyperets did you export the required ENV_VARS as stated in the README?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/toystars/node-elasticsearch-sync/issues/20#issuecomment-261226365, or mute the thread https://github.com/notifications/unsubscribe-auth/AE0sR8hST4qyp6Yxafep5ZLV_7yq_lCPks5q_D3AgaJpZM4KzqmK .

toystars commented 7 years ago

Let me try to reproduce that. I'll get back with my results.