…and if yes, what should I do?
I am learning how to use mongodump
to export data from a collection. I tried two ways:
- The first way
mongodump --uri mongodb+srv://<USERNAME>:<PASSWORD>@sandbox.4izby.mongodb.net/sample_mflix
I got the following error:
|2021-04-06T13:54:17.235+0800|error parsing command line options: error parsing uri: lookup sandbox.4izby.mongodb.net on 127.0.0.53:53: cannot unmarshal DNS message|
|—|---|
|2021-04-06T13:54:17.235+0800|try ‘mongodump --help’ for more information|
- The second way
mongodump --host="Sandbox/sandbox-shard-00-00.4izby.mongodb.net:27017,sandbox-shard-00-01.4izby.mongodb.net:27017,sandbox-shard-00-02.4izby.mongodb.net:27017" --db="sample_mflix" --collection="movies"
I got the following error:
2021-04-06T13:38:46.923+0800 Failed: can't create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: sandbox-shard-00-00.4izby.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : connection(sandbox-shard-00-00.4izby.mongodb.net:27017[-181]) incomplete read of message header: EOF }, { Addr: sandbox-shard-00-01.4izby.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : connection(sandbox-shard-00-01.4izby.mongodb.net:27017[-182]) incomplete read of message header: EOF }, { Addr: sandbox-shard-00-02.4izby.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : connection(sandbox-shard-00-02.4izby.mongodb.net:27017[-180]) incomplete read of message header: EOF }, ] }
I looked around the forum and found that some people encountered similar problems due to their ISP blocking port 27017. How do I check if that is the case?