From c1504bacafaa9c8be5ada5e68fc5c7628e12d96c Mon Sep 17 00:00:00 2001 From: zeus Date: Tue, 24 Nov 2020 18:19:20 +0200 Subject: [PATCH] mongo tail --- swarmlab-app/src/run/app.js | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 467ce0e..5b69564 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -383,37 +383,16 @@ function onCollection(err, collection) { }, 1000); } -//function onConnected(err, db) { -// db.collection('log', onCollection); -//} -//var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/?replicaSet=rs1" -//var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/?replicaSet=rs1&authSource=admin" -//var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/fluent?replicaSet=rs1&authSource=admin" var mongourl = "mongodb://playgrounduser:efvvnuioervefSDFSGYGHRDFVsdfergvssppiiedifhwincvinviw_dbfjbsifbsdkjfswuunscfudfgbbfvibqefwrvnine@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/fluent?replicaSet=rs1" const OPTS = { useNewUrlParser: true }; //var mongolab_uri = "mongodb://:@:,:/?replicaSet="; var mongooptions = { - //server: { - // socketOptions: { autoReconnect: true, keepAlive: 1, connectTimeoutMS: 30000, socketTimeoutMS: 0 - //authSource: admin, - // } - //}, - /* - replSet: { - socketOptions: { - keepAlive: 1, - connectTimeoutMS: 30000, - socketTimeoutMS: 0 - } - } - */ } -//MongoClient.connect(mongourl, mongooptions, function(err, client){ MongoClient.connect(mongourl, OPTS, function(err, client){ if(err){ console.log(err); @@ -430,17 +409,6 @@ MongoClient.connect(mongourl, OPTS, function(err, client){ } }); -//MongoClient.connect(mongourl,mongooptions).then((client) => { -/* -MongoClient.connect(mongourl).then((client) => { - const db = client.db('fluent'); - db.collection('log', onCollection); - // do database things -}).catch((error) => { - console.log("connect_error_mongo " +JSON.stringify(error)) - // handle connection errors -}); -*/ io.on('connection', s => { console.error('socket connection');