2017-08-04T07:50:43.695-0400 [........................] allYears.uKPostal 0B/1001MB (0.0%)
2017-08-04T07:50:43.735-0400 [........................] allYears.uKPostal 0B/1001MB (0.0%)
2017-08-04T07:50:43.735-0400 Failed: error connecting to db server: no reachable servers
2017-08-04T07:50:43.738-0400 imported 0 documents
mongoimport --host "mongodb://productioncluster-shard-00-00-tcdnn.mongodb.net:27017,productioncluster-shard-00-01-tcdnn.mongodb.net:27017,productioncluster-shard-00-02-tcdnn.mongodb.net:27017/test?replicaSet=ProductionCluster-shard-0" --authenticationDatabase admin --ssl --username XXXXX --password XXXXXXX --db allYears --collection uKPostal --drop --file unit.json
Hi Beth
The error message means that mongoimport
cannot connect to the MongoDB deployment. This is because the --host
parameter of mongoimport
does not recognize MongoDB URI format (there is --uri
parameter for that purpose instead). The --host
parameter requires mongodb host to connect to (e.g. replicasetname/host1,host2 for replica sets).
You would need to modify your parameters to be:
mongoimport --host "ProductionCluster-shard-0/productioncluster-shard-00-00-tcdnn.mongodb.net:27017,productioncluster-shard-00-01-tcdnn.mongodb.net:27017,productioncluster-shard-00-02-tcdnn.mongodb.net:27017" --authenticationDatabase admin --ssl --username=XXXXX --password=XXXXXXX --db=allYears --collection=uKPostal --drop --file=unit.json
Best regards,
Kevin