Has any of your experienced and solved this issue on MongoDB where in it shows this error when connecting to the DB through the Mongo shell
DNSHostNotFound: Failed to look up service "":No records found for given DNS query. try 'mongo --help' for more information
I have the mongo added into the path, unfortunately this is blocking me from continuing to use MongoDB Atlas.
From the error it seems that the srv connection string is not being resolved.
Could you try to connect using the standard connection string.
Related
I am a beginer in mongoDB and learning Mongodb atlas.
In MongoDB Atlas, Under database access created username and password ( password is system generated and has no special character)
Under Network access added a public ip address (allow access from anywhere)
Under database deployment loaded sample database.
Now I wanted to see my cluster data, so wanted to connect it to vs code or MongoDB Compass. I clicked connect, selected connect using mongo db compass, copied the string.
now i opened Mongodb compass, and under New connection i.e connect to a MongoDB deployment, i entered my URL
mongodb+srv://gourav_singh:7gamf8UkL8B6MET#cluster0.9dmds.mongodb.net/test
clicked Connect
But i got error as : Unable to connect: connect ECONNREFUSED 3.6.85.199:27017
How I can fix it, Looking for kind help. Thanks in advance
I want to create a MongoDB 5.0 replica set on AWS EC2, When I create a standalone setup, it works completely fine. I can easily connect from anywhere. But when I convert this instance to a replica set with updating the mongod.conf and executing rs.initiate(), I cannot connect anymore!
My Mongo Compass gives the following error: getaddrinfo ENOTFOUND ip-172-31-14-219.eu-central-1.compute.internal
I have installed MongoDB Compass, it is installed in here:
C:\Users\User\AppData\Local\MongoDBCompass
And I'm trying to connect to Atlas Cluster, using the string which is:
mongodb+srv://my_id:<password>#cluster0-8vu0e.mongodb.net/test
I typed this in cmd and I get the following error:
The system cannot find the file specified.
I tried to the directory into path but I don't think it worked, I'm still getting an error.
What could be the issue?
Thank you in advance!
That happened to me once and it m8ght be because off the whitelist of mongo atlas.
https://docs.atlas.mongodb.com/security-whitelist/
You Can Follow This Code
mongodb+srv://my_id:usingPasswordThisPlaceMongoDBPassword#cluster0-8vu0e.mongodb.net/test
like:
mongodb+srv://my_id:12345#cluster0-8vu0e.mongodb.net/test
**When MongoDB Compass Open...Past Your Url And press Connect Button.**
Try connecting it with the standard connection string instead of the srv connection string.
You can find the standard connection string in the Atlas UI itself. while selecting for the connection string in the drop down menu of the mongoshell version select 3.4 or earlier then it will give you a connection string which is the standard one like below:
mongo "mongodb://cluster2-shard-00-00.dmku2.mongodb.net:27017,cluster2-shard-00-01.dmku2.mongodb.net:27017,cluster2-shard-00-02.dmku2.mongodb.net:27017/test?replicaSet=atlas-1ehx3j-shard-0" --ssl --authenticationDatabase admin --username <username> --password <password>
I’m trying to connect Pentaho PDI (CE) to mongoDB hosted by Atlas, but getting an error, complaining about the host name I believe.
All examples on the internet is for connecting pentaho with mongodb with host = localhost; somehow when I pass the Atlas hostname it doesn’t seem to resolve.
Anyone been able to connect pentaho to a mongodb atlas cluster that could help me please?
Oh, I’m able to connect via compass and via command line.
Any idea on what I may be doing wrong?
Thank you!
I tried setting up MongoDB for the first time and I got this error - I recently changed my DNS so I'm not sure if it's related to that. Any ideas what this might mean?
I was following a tutorial on YouTube (Video Here: https://www.youtube.com/watch?v=MIByvzueqHQ). I've seen other entries/issues similar to my one but I believe it might be different. People have said it may be ownership problems. I haven't seen one that says Connection refused - so I will change my DNS back and see if that does anything.
MongoDB shell version v4.0.9
connecting to:
mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb`
2019-07-30T16:14:05.184+1000 E QUERY
`[js] Error: couldn't connect to server 127.0.0.1:27017`,
connection attempt failed: SocketException: Error connecting to `127.0.0.1:27017` :: caused by ::
Connection refused :
`connect#src/mongo/shell/mongo.js:343:13#(connect):2:6
exception: connect failed`
I expected it to start MongoDB so I could give it a test run. This was the only error I saw.
This can happen when the mongodb service is not running on the mac.
To start it, try this:
brew services start mongodb