elasticsearch-watchdog
Version:
A watchdog of elasticsearch - cluster nodes' statuses monitor, auto restart, keep PRIMARY node unique.
23 lines (20 loc) • 476 B
JavaScript
/**
* Daemonic process
*/
var conf = process.argv[2];
try {
if (conf.search(/\{/) >= 0) {
conf = JSON.parse(conf);
} else {
conf = require('./helper').loadConfig(conf);
}
} catch (err) {
return console.error('can not parse configuration:', err.message);
}
var Watchdog = require('../watchdog');
Watchdog({
conf: conf,
uid : process.argv[4]
}).on('info', function(msg){
console[msg.type]((new Date()).toISOString() + ':', msg.message);
}).watching();