-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to collect data from MongoDB Arbiter with auth enabled #4163
Comments
I do have this working on an arbiter, though it doesn't have the storage fully turned off as it was just a regular replica that was added as an arbiter.
Can you add a user with the appropriate permissions to the admin database on the arbiter?:
|
I am afraid the creation of users on Arbiter is not allowed. From here:
|
Thanks for the update. I guess you will either need to turn off authentication or you could try doing what I did: setup a real replica set member and then convert it to and arbiter, which seems to keep the users intact. |
I think I found a solution. I will just create the user on the "arbiter" while the server is still running in a stand-alone mode and not part of a replica set. Once the arbiter is configured I can login with the user I have created and telegraf no longer complains. |
By the way, the problem is only reproducible with Telegraf 1.6.x. On another server where Telegraf is 1.5.2 there are no issues. I just upgraded to Telegraf 1.6.3 on that server and BOOM:
Back to 1.5.2 and no issues again:
|
That makes sense, we only added these shard stats in 1.6. Due to how hard it is to setup the user in this case perhaps we should ignore the error. |
With Telegraf 1.8.0 I get one additional error message:
Is there an option I could use to either suppress these error messages in the log file or even better to disable these data collections that are not relevant for the arbiter? It would have been nice if the mongo plugin itself does not try to collect this data if it detects that the Mongo node is an arbiter. Removing all our Mongo Arbiters from their replica set only to create a user to make Telegraf happy seems excessive to me. Telegraf collects all the data we need from our Mongo Arbiters even with the error messages every 10 seconds. |
Sorry, there is no option to disable the logging, we will get it fixed. |
Relevant telegraf.conf:
System info:
Telegraf 1.6.2
CentOS 7.5.1804
Three MongoDB 3.2.20 nodes configured with "auth=true" and "keyFile=/var/lib/mongo-keyfile" - primary, secondary and arbiter
Steps to reproduce:
Expected behavior:
No errors in telegraf.log.
Actual behavior:
E! Error getting database shard stats (not authorized on admin to execute command { shardConnPoolStats: 1 })
Additional info:
I have "u1" user in "prod" db. On Mongo Primary and Secondary nodes I can successfully run Telegraf with no errors with the following configuration:
But the Arbiter has no "prod" db and neither it has "admin" db.
How am I supposed to do this on the Arbiter?
I am sorry if this is not a bug but just a user misconfiguration instead.
The text was updated successfully, but these errors were encountered: