3

i have been facing a problem linking mongodb compass and and the online mongo atlas, but somehow when i type the mongoimport command complete with its parameters extracted from the "Command Line Options" in atlas account, it throws up the error connecting to the db server: no reachable server

I am running MongoDB enterprise version 3.0.15 for connecting compass and atlas account on windows 7 platform. I have tried various methods which are already described in some of the links

mongodb Failed: error connecting to db server: no reachable servers

mongoimport error - Failed: error connecting to db server: no reachable servers

mongorestore Failed: no reachable servers

including:

  1. specifying the configuration file with net parameters adjusted to bind ip 0.0.0.0 and port 27017 as described in some threads on this error. Also note that my configuration file did not have any replication parameters, so removing replication parameters was out of the questions as it was suggested in some posts.
  2. Explicitly specify/allow Inbound traffic in Windows firewall for port 27017
  3. Reset the replication set, although i could not understand why i would need to do that in mongoimport case when my mongod instance is not even started using the --replSet rs0 command. Following link was followed for resetting the replset as it was suggested in some posts* (https://vitalflux.com/mongodb-how-to-reset-mongo-replica-set/)
  4. and verified what ports mongo is listening in using db.serverCmdLineOpts() with output like this { "argv" : [ "mongod" ], "parsed" : { }, "ok" : 1 }

*https://serverfault.com/questions/424465/how-to-reset-mongodb-replica-set-settings/424714#424714

Mongoimport command used is:

mongoimport --host Cluster0-shard-0/cluster0-shard-00-00-1jypq.mongodb.net:27017,
cluster0-shard-00-01-1jypq.mongodb.net:27017,
cluster0-shard-00-02-1jypq.mongodb.net:27017 --ssl --username <username> 
--password <password> --authenticationDatabase admin --db tutorial 
--collection somedocs --type CSV --file retail.csv --headerline

The error message is as follows:

2019-05-10T13:22:32.509+0500    [........................] tutorial.somedocs    4.0 KB/42.4 MB (0.0%)
2019-05-10T13:22:32.860+0500    Failed: error connecting to db server: no reachable servers
2019-05-10T13:22:32.860+0500    imported 0 documents

At this point in time, i am really out of ideas, and i do not know how to proceed forward. Looking forward to your cooperation and valuable ideas in this regard.

Thanks,

Sereph
  • 61
  • 5

0 Answers0