Hi, community.
When I use mongoexport with --readPreference=secondary, I got bellow error.
15:33:49 [0] % mongoexport --host mongos-01-b.dummy.com -d dummyDB --port 27017 -c accounts --readPreference=secondary > hoge.json 2016-04-13T15:34:43.815+0900 Warning: using a non-primary readPreference with a connection to mongos may produce inconsistent duplicates or miss some documents. 2016-04-13T15:34:46.989+0900 Failed: no reachable servers
When I use mongoexport with --readPreference=secondaryPreferred, All went well.
15:34:47 [1] % mongoexport --host mongos-01-b.dummy.co -d dummyDB --port 27017 -c accounts --readPreference=secondaryPreferred > hoge.json 2016-04-13T15:37:35.978+0900 Warning: using a non-primary readPreference with a connection to mongos may produce inconsistent duplicates or miss some documents. 2016-04-13T15:37:36.018+0900 connected to: mongos-01-b.dummy.co:27017 2016-04-13T15:37:37.019+0900 [........................] dummyDB.acounts 16000/5700367 (0.3%) 2016-04-13T15:37:38.019+0900 [........................] dummyDB.acounts 64000/5700367 (1.1%) 2016-04-13T15:37:39.020+0900 [........................] dummyDB.acounts 96000/5700367 (1.7%)
As far as I read mongo-tool code and mgo.v2 code, mongo-tool only output warning log "Warning: using a non-primary readPreference with a connection -<< omit >> ". And the Error "no reachable servers" is returned in mgo.v2/cluster.go cluster.AcquireSocket().
why we can't use --readPreference=secondaryPreferred with mongo-tool?
There are no Sub-Tasks for this issue.