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.
Related
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.
I am either misusing mongodump or it has a bug, but I'm not sure which. I typically use mongo connection strings in my applications and scripts, e.g.
mongo mongodb://username:ps#myhostname/dbname this works
The mongodump tool supposedly supports URL strings, but every time I try to use it it starts and then does nothing:
mongodump --uri mongodb://username:ps#myhostname/dbname this runs but stops and does nothing with no CPU usage.
I've tried using -vvvvv and there is no interesting data shown.
If I do the exact same thing using the "old" parameters, it works, but then I'd have to parse URIs and that makes me sad:
mongodump --host myhostname --username username --password ps -d dbname this works
1) Am I doing this wrong?
2) If this is a bug, where would I file a ticket?
3) Is there a tool that would parse a mongodb:// URI back into pieces so that I can keep using URIs in my automation stack?
$ mongodump --version
mongodump version: r3.6.8
git version: 6bc9ed599c3fa164703346a22bad17e33fa913e4
Go version: go1.8.5
os: linux
arch: amd64
compiler: gc
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
db.version() in a connected shell also returns 3.6.8
I ran into this same issue, and likewise, was quite sad. However, I'm happy again because I realized you MUST append the following two options to your connection string:
?ssl=true&authSource=admin
Pop those bad boys on your uri and you should be smooth sailing.
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
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!
I have a Meteor App running on Modulus.net server. The App is using by many people, So I want to use the same Database Locally. I'm using Ubuntu 12.
I read other SO Posts, but none of them found useful.
I tried this code
$ export MONGO_URL=mongodb://user:pass#mongo.onmodulus.net/dbId?autoReconnect=true&connectTimeoutMS=60000
$ meteor run
It throws an Error
Unexpected mongo exit code 45. Restarting.
Can't start mongod
MongoDB cannot open or obtain a lock on a file
I have also tried sudo mrt as I have installed meteorite, now the app is running but the database not changed.
I'm a newbie to Terminal, Is there any way to do that?
Did you replace user:pass and dbId to your username, password, and dbID?
You can use mongo mongodb://user:pass#mongo.onmodulus.net/dbId to check whether you can access it or not first.
Update
Sorry for the misleading answer, mongo shell has a bug to log in while you enter the url like so. You can see here
Your code runs successfully on my computer. You can try to delete .meteor/local and then execute meteor run again.
If you want to use sudo to execute it, add the argument -E so that the environment variables will not be reset:
sudo -E meteor run