ShauneStark
ShauneStark
I'm new to Elixir/Erlang, but from the Mongo docs, I thought I would be able to read from secondary servers by specifying `rp_mode` = `secondary` or `secondaryPreferred`, but the driver...
``` def randomlyreadrecords(:mytopology, mongodbmap) do Logger.info "Starting Reads from: " mongodbmap.collection numrandom = :rand.uniform(100000) maxnumberreads = 1000000 currentreadnumber = 1 MUVPROC.read(:mytopology, mongodbmap, numrandom, currentreadnumber, maxnumberreads) Logger.info "Ending Reads from: "...
When I change the rp_mode to secondary or secondaryPreferred when I create the topology, all reads fail immediately. The code I sent you uses primary because that's the only value...
Just to make sure, when I run this code ``` # Get MongoDB connection {:ok, mtconn} = :mongoc.connect( {:rs, mongodbmapbase.replicasetname, mongodbmapbase.hostlist}, [ {:name, :vertifypool}, {:register, :vertifytopology}, {:rp_mode, :secondaryPreferred} ], [...
Yes, sir it did...
I have tried listing the master first, last and in the middle, but it does not seem to make a difference....
Yes, sir... One moment please...
I tried the following: ``` # Get MongoDB connection {:ok, mtconn} = :mongoc.connect( {:unknown, ['mongo1.mydomain.com:27017', 'mongo2.mydomain.com:27017', 'mongo3.mydomain.com:27017']}, [ {:name, :mypool}, {:register, :mytopology}, {:rp_mode, :secondaryPreferred} ], [ {:database, mongodbmapbase.database} ] )...
I also removed the mongo3 server from the list and got the same error...