-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
from github 102:
Hi,
I'm doing the following call mongodump --host db1:27011,db2:27011,db3,db4 --port 4444.
I found out the hard way: If db3 and db4 are not reachable mongodump is not working any more: error connecting to db server: no reachable servers
I traced it down to the following line https://github.com/mongodb/mongo-tools/blob/29b8883c560319b016f8bd4927807fa36f1a682f/common/util/mongo.go#L49
where the --port is unconditionally added to every host entry. So when db3 and db4 were not reachable he tried to connect db1:27011:4444 which is obviously wrong.
It would be gread if mongodump would behave like pymongo, which is.
Only if not port is given you she one specified in the port option.