JamesOsgood / mongodb-grafana

MongoDB plugin for Grafana
MIT License
464 stars 213 forks source link

hello,why can I not connect the mongodb? #80

Closed yuanyixu closed 4 years ago

yuanyixu commented 4 years ago
屏幕快照 2019-12-02 下午7 27 41
ghost commented 4 years ago

Hi ! Were you able to fix this issue? What was the Mongo URL you used?

boogity commented 4 years ago

For those who run into this issue the relevant settings with basic auth do not need user:password in the mongoDB URL and you should only have the MongoDB URL of your server end at :port/ The marked over fields above look as follows on my setup and work:

Two things stick out to me in the above screenshot:

  1. The user:password may or may not be interfering with the connection (but leaving it there in plaintext, why bother with a password at all then?) but you shouldn't need it.
  2. The mongoDB url appears to include at least the database name in the URL, possibly more. Looks like this plugin concatenates all that info (including password/user) for you so leaving it right there in the URL is sure to cause connection issues.