-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:Debian Squeeze 64 bit
mongoDB 3.0.6 replica set
- primary
- secondary
- hidden secondary (votes: 0)
- arbiter
Node.js 4.1.2
mongodb driver 2.0.45
mongodb-core 1.2.14
-
Empty show more show less
I tested mongodb nodejs driver with one simple query (find) and on every member (except hidden secondary with 0 TCP connections from Node.js) of replica set I saw same count of TCP connections in ESTABLISHED state (exactly 5). I understand why is it on primary and secondary, but why on arbiter?
google group conversation about this theme: https://groups.google.com/forum/#!topic/mongodb-user/6TJznalji6k
nodejs code (copy paste from mongodb driver docs) which I run in shell "node test.js":
var findDocuments = function(db, callback) {
// Get the documents collection
var collection = db.collection('blah');
// Find some documents
collection.find({}).toArray(function(err, docs)
);
}
var MongoClient = require('mongodb').MongoClient,
f = require('util').format,
assert = require('assert');
// Connection URL
var url = 'mongodb://user:password@server:27301/blah?replicaSet=replsetname';
// Use connect method to connect to the Server
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
console.log("Connected correctly to server");
findDocuments(db, function() {
});
});