mongodb - Mongo w/ Mongoose on Express connection closes -
my connection mongo database close or timeout if left in active. i'm getting following error when leave app in active "no open connections"
my mongo db running in replication set on aws. i'm using following options when connecting using mongoose. i'm unsure if other flags should set. basing options on teh monodo node driver doc @ http://mongodb.github.io/node-mongodb-native/api-generated/server.html.users in applicaiton 8+ hours @ time , don't want timout when go lunch or leave meeting.
mongooptions : { user: 'root', pass: '********', replset: { auto_reconnect: true, poolsize: 25, socketoptions: { keepalive: 1 }, ssl: true, sslcert: fs.readfilesync('./server/config/ssl/mongodb-cert.crt'), sslkey: fs.readfilesync('./server/config/ssl/mongodb-cert.key')} } mongoose.connect('mongodb://server.com:27017', config.mongooptions);
the connection getting closed turned out issue causing problem.
we have replicate set running w/ ssl , able keep connection days using following config:
mongooptions : { user: 'ssssss', pass: 'xxxxxx', replset: { auto_reconnect: false, poolsize: 10, socketoptions: { keepalive: 1 }, ssl: true, sslcert: fs.readfilesync('./server/config/ssl/mongodb-cert.crt'), sslkey: fs.readfilesync('./server/config/ssl/mongodb-cert.key')} }
Comments
Post a Comment