MongoDB: Atlas connection problems with Mongo Tools - mongodb

Hey I am learning how to use a Mongodb Atlas using shell commands.
I can successfully connect to my Atlas cluster via Mongo Shell. Unfortunately I can't do it with Mongo Tools (mongoimport, mongoexport, mongostat).
If I execute this command:
mongostat --uri mongodb+srv://m001-student:m#####s#sandbox.####.###.mongodb.net
I receive:
error parsing command line options: error parsing uri:
lookup sandbox.#####.mongodb.net on 127.0.0.53:53: cannot unmarshal DNS message
The same problem repeat itself for other commands. I don't know if it is important but I use Ubuntu 18.04 on a uni network.
I tried to search for any solutions but I couldn't find anything useful. Changing resolv.conf as was suggested here did not achieve anything except cutting my network connection :P
Anyone have any idea?

Well it is more of a workaround than real answer but my solution is to not use command line tools provided by Atlas website and don't use srv connection.
mongostat --host "sandbox-shard-####.gcp.mongodb.net:27017,
sandbox-shard-####.gcp.mongodb.net:27017,
sandbox-shard-#####.gcp.mongodb.net:27017"
--authenticationDatabase admin --ssl --username ##### --password #####
Worked for me.

Related

mongodump from rasberry OS

I am trying to create a mongodump of my atlas database, but I get the following error:
error parsing command line options: error parsing uri (mongodb+srv://blablabla:123#blablabla.blabla.blala.mongodb.net/DATABASENAME): scheme must be "mongodb"
try 'mongodump --help' for more information
Any idea, I am trying to automate my backups using a bash script.
I tried to change the url from mongodb+srv to mongodb but nothing happen
You are using an old version of mongodump that doesn't recognize mongodb+srv URIs. Upgrade mongodump or use a non-SRV URI.

Can't connect mongodb to mongolab

So I am unable to connect to mongolab inside the mongo shell for some reason. In specifics, when I run mongo ds041643.mongolab.com:41643/teamsavage -u <dbuser> -p <dbpassword> inside the mongo shell, and ofcourse replace the brackets with my proper database credentials, as soon as I hit enter, it brings me to a new line with 3 dots and nothing after that.
I ran through the troubleshooting connections guide found under docs.mongolab.com/connecting/#help to try to figure the problem out and that did not help either.
I followed the guide step-by-step and the following occurred.
So it first said to ping the mongolab host, and I did with the following:
ping ds041643.mongolab.com and successfully got responses back
I then ran nc -w 3 -v ds041643.mongolab.com 41643 and got the following response back
Connection to ds041643.mongolab.com 41643 port [tcp/*] succeeded!
I am officially stuck with no further documentation to run through to fix my persistent problem. Please help!

MongoLab error - 'mongo not found'

I am hosting an app on heroku and I'm trying to connect it to the MongoDB database using the MongoLab addon. One of the steps is to type:
mongo ds044064-a0.mongolab.com:44064/heroku_w6fhwppg -u <dbuser> -p <dbpassword>
But I keep getting the error "mongo not found" Anyone have any ideas why? The add-on is installed.
Thanks!
mongo refers to the mongo shell binary, which you'll need to install locally. It, along with all the other MongoDB binaries, can be downloaded here:
https://www.mongodb.org/downloads

Mongorestore command not found with meteor

Ok guys I receive a bunch of files of a mongodb (.bson and .json) I want to replace my current meteor mongodb, I have read al this post about it:
meteor: how can I backup my mongo database
Mongorestore, from meteor production server to local
Restore a mongodb in meteor production server
MongoDB: mongorestore: command not found (this actually have nothing to do with my problem)
and I end writing in my terminal while meteor app was running
mongorestore -h 127.0.0.1:3001 --port 3001 -d meteor ~/Github/mongo/mongoDBRESTORE/admin/
but the problem its that terminal output is not command found
does anybody know what Im doing wrong, what its the right way to do this?
As #rgoomar pointed in the comments I need to download https://www.mongodb.org/downloads the mongodb bin files then I simple execute ~/mongodb/bin/mongorestore -h 127.0.0.1:3001 -db meteor ~/Github/mongo/mongoDBRESTORE/admin
and worked!

mongoDB test error

I came to know about mongoDB and looked for test.So I made it install and then for test when I used command mongo on terminal it showed an error like this
MongoDB shell version: 1.8.2
connecting to: test
Sun Jul 31 01:06:07 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79
exception: connect failed
So can someone tell me what is the problem.I am using ubuntu 11.04.For installation instruction I had used this site.I am newbie to this mongoDB so please helpe me.Any help will be highly appreciable.
All you need to do is open 2 terminal tabs. In one, run
mongod
which starts the MongoDB server.
In the other, run
mongo
which is the shell that connects to your MongoDB server.
It looks like MongoDB isn't running. Can you connect to the web interface in your browser?
http://localhost:28017
Also, do you see the process running on your machine? You should see an entry for mongod when running ...
$ top
or
$ ps aux
why not install mongodb from 10gen's own debian repository? much easier and more likely to work
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
To see if mongodb is running, this also helps:
sudo service mongodb status
if it is running, and you still get the same error, then it must be the weird localhost bug that mongodb has. it assumes localhost is 127.0.1.1 for some reason. try
mongo 127.0.1.1
I had the same problem. Just try to create folder c:\data and next c:\data\db