The available documentation for MongoDB here is oddly targeted. I’m looking for information on connecting to a ReplicaSet. This doesn’t seem to be covered here or anywhere. Am I missing something obvious?
Nothing in the /python.d/mongodb file, nor the documentation here, nor any Google search result, tells me how to connect to a ReplicaSet. I cannot imagine anyone is using MongoDB and Netdata together in production, while the Mongo is running on a local instance. Anyone doing these things simultaneously should definitely not be allowed to do either. Unfortunately your provided documentation here is only targeted to these wildly irresponsible individuals.
Could someone please just tell me how to fit a ReplicaSet connection string into the /python.d/mongodb file. The fact that the word “Replica” doesn’t even appear in this file is itself feels like a red flag.
I realize you’re using PyMongo for this, and the way that I connect to my cluster with PyMongo is with a string like this:
client = MongoClient('mongodb://user:pass@set-member1:28018,'
'set-member2:28018,set-member3:28018',
connectTimeoutMS=30000, socketTimeoutMS=None, socketKeepAlive=True, connect=False,
maxPoolsize=1, replicaSet='replicaSetName')
According to Mongo’s official documentation, a correctly formed MongoDB URI for ReplicaSets should look like:
mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?replicaSet=myRepl
So my /python.d/mongodb file includes this for the connection:
auth:
name : 'MongoDB - Gnubesoft'
uri : 'mongodb://mongodb0.example.com:28017,mongodb1.example.com:28017,mongodb0.example.com:28017/?replicaSet=myReplicaSet'
authdb : 'admin'
user : 'netdata'
pass : 'password_goes_here'
There is a further omission from the documentation discussing where this file is supposed to be placed. I have 9 machines in my NetData. 3 of these are members of a MongoDB ReplicaSet cluster. Do I upload this file to all 9 machines? All 3 of the MongoDB ReplicaSet members? Just 1 random machine out of all 9?
After wasting so much time on this problem I just decided to upload the file to everything and restarted netdata on all 9 machines. I have no idea if it worked. I was expecting to see a MongoDB thing pop up in the side of NetData, like Postfix does. There’s nothing new there, and I can’t see any other places to monitor this from so I guess it failed?