function redisReady(id, name, ip) { var exec = require('ssh-exec'); var c = exec.connection({ user: '******', host: ip, password: global.password }); console.log('updating target domain'); builder.updateDomainTarget(builder.mainDomainResources['redis'].resourceId, ip, function () { console.log('executing data'); exec('redis-server --port 6379 --bind redis.whoscoding.net &', c).pipe(process.stdout); exec('redis-server --port 6380 --bind redis.whoscoding.net &', c).pipe(process.stdout); console.log("Ready! " + name, ip, id); }); }
function clusterNodeReady(id, name, ip) { var exec = require('ssh-exec'); var c = exec.connection({ user: '******', host: ip, password: global.password }); exec('/usr/local/src/cluster.sh &', c).pipe(process.stdout); console.log('cluster done'); }
function mainNodeReady(id, name, ip) { console.log('updating target domain'); builder.updateDomainTarget(builder.mainDomainResources[''].resourceId, ip, function (err, res) { if (err) { console.log(err); throw err; } }); builder.updateDomainTarget(builder.mainDomainResources['www'].resourceId, ip, function (err, res) { if (err) { console.log(err); throw err; } }); builder.updateDomainTarget(builder.mainDomainResources['head'].resourceId, ip, function (err, res) { if (err) { console.log(err); throw err; } }); var exec = require('ssh-exec'); var c = exec.connection({ user: '******', host: ip, password: global.password }); exec('/usr/local/src/main.sh &', c).pipe(process.stdout); console.log('main node done'); }