0

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?

  • You didn't do the change right if it broke your networking. – D. SM Oct 15 '20 at 14:32
  • Well I would delve more into resolv.conf change if I couldn't fully to connect to the cluster, but as I said it is working fine for mongo shell just not for mongoimport/export etc. – AggresiveHayBale Oct 16 '20 at 07:29

1 Answers1

0

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.