You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Percona Operator for MongoDB to deploy a MongoDB cluster on Kubernetes. I'm trying to add a sidecar container running mongodb_exporter to collect metrics. Here is my current configuration for the sidecar:
The MongoDB cluster is already up and running with other applications successfully connected to it.
I’m setting the --mongodb.uri argument to connect to the MongoDB instance.
I included the port in the URI, though I’m not sure if it’s necessary.
I'm using environment variables to pass MONGODB_USER and MONGODB_PASSWORD for the clusterAdmin role.
The problem is that the exporter cannot connect to the MongoDB instance. Here's the logs:
time="2024-10-31T13:58:07Z" level=error msg="Cannot connect to MongoDB: cannot connect to MongoDB: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: mongodb://mongodb-cluster-a9901-mongodb-replicaset.mongodb-cluster.svc.cluster.local:27017, Type: Unknown, Last error: dial tcp: lookup mongodb://mongodb-cluster-a9901-mongodb-replicaset.mongodb-cluster.svc.cluster.local on 10.43.0.10:53: no such host }, ] }"
I'd appreciate any insights you can offer into why the exporter is failing to connect.
Thank you.
The text was updated successfully, but these errors were encountered:
We met the same issue. Our exporter is out of k8s. Now we rollback to 0.40.0. It works fine. I guess new version has detected the mongo replicaset cluster. Without the dns in k8s, exporter can find mongo's ip never.
I'm using the Percona Operator for MongoDB to deploy a MongoDB cluster on Kubernetes. I'm trying to add a sidecar container running
mongodb_exporter
to collect metrics. Here is my current configuration for the sidecar:Note that:
--mongodb.uri
argument to connect to the MongoDB instance.MONGODB_USER
andMONGODB_PASSWORD
for the clusterAdmin role.The problem is that the exporter cannot connect to the MongoDB instance. Here's the logs:
I'd appreciate any insights you can offer into why the exporter is failing to connect.
Thank you.
The text was updated successfully, but these errors were encountered: