Skip to content
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

Document running exporter with --no-mongodb.direct-connect and multiple mongo servers in uri #971

Open
bareksml opened this issue Nov 20, 2024 · 0 comments

Comments

@bareksml
Copy link

bareksml commented Nov 20, 2024

Describe the bug

There is no mongodb_exporter deployment pattern for clusters provided in documentation. I can run my exporter on HA platform and i want to get cluster state. For that reason i have tried:

mongodb_exporter --mongodb.uri="mongodb://10.0.3.222:27017,10.0.1.210:27017,10.0.2.101:27017/?replicaSet=rs0"  --collect-all

Result is:

ERRO[0000] Cannot connect to MongoDB: invalid MongoDB options: a direct connection cannot be made if multiple hosts are specified

I can get single exporter process working with my cluster by using --no-mongodb.direct-connect. Some posts from Percona guys suggests we should have one exporter per node. This would complicate scraping and later on i will have metrics tripled (extra dimension being particular exporter). This is kind of dirty so it would be great to have some information about the deployment pattern. Also answer for a qestion:

Can i run with multiple cluster nodes and --no-mongodb.direct-connect without risk of having broken metrics?

To Reproduce
Steps to reproduce the behavior:
Try running exporter against 3 node replicaset cluster.

Expected behavior
Answer provided and documentation updated.

Environment

  • Linux
  • mixed
  • MongoDB 4.x however i feel question is quite generic

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant