percona / mongodb_exporter

A Prometheus exporter for MongoDB including sharding, replication and storage engines
Apache License 2.0
1.16k stars 425 forks source link

Exporter0.40.0 cannot connect to mongodb 4.0.3 with SSL enabled #756

Closed yuanbanlin closed 9 months ago

yuanbanlin commented 9 months ago

Describe the bug Does version 0.40.0 support monitoring of SSL starting with the mongodb 4.0 kernel. Why is the following connection string feasible in version 0.39.0, but not in version 0.40.0?

To Reproduce /data/console-deploy/mongodb/mongodb_exporter_package/mongodb_exporter --mongodb.uri=mongodb://root:***@172.16.4.82:9901/admin?authSource=admin&tls=true&tlsCertificateKeyFile=/data/dds/346462402175370545/mongo4.0_mirror/mongo-4.0.3-deploy/conf/mongodb.pem&tlsInsecure=true --mongodb.global-conn-pool --compatible-mode --web.listen-address=:9216 --log.level=error --collector.diagnosticdata --collector.collstats --collector.dbstats --collector.dbstatsfreestorage --collector.topmetrics --collector.indexstats --collector.collstats --collector.profile

cannot connect to MongoDB: cannot connect to MongoDB: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: 172.16.4.82:9901, Type: Unknown, Last error: connection(172.16.4.82:9901[-12]) socket was unexpectedly closed: EOF },

Expected behavior I hope that after enabling SSL on MongoDB, Exporter 0.40.0 can connect to MongoDB

Logs cannot connect to MongoDB: cannot connect to MongoDB: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: 172.16.4.82:9901, Type: Unknown, Last error: connection(172.16.4.82:9901[-12]) socket was unexpectedly closed: EOF },

Environment

BupycHuk commented 9 months ago

Hi @yuanbanlin , I see that you closed this issue. Does that mean that issue was resolved? If it is, what was the problem?

yuanbanlin commented 9 months ago

Hi @yuanbanlin , I see that you closed this issue. Does that mean that issue was resolved? If it is, what was the problem?

Yes, the problem has been solved.There is a problem with the CA file.And mongodb.uri's content should be included by “”