nginx-gridfs icon indicating copy to clipboard operation
nginx-gridfs copied to clipboard

not work with slave gridfs

Open dqatsh opened this issue 15 years ago • 6 comments
trafficstars

Dear, If the mongod connected to is a slave, 404 is returned. In /etc/mongod.conf, add the following, slave = true source = 192.168.44.102

After I changed the mongod as normal, it works well.
In /etc/mongod.conf, comment the following,
#slave = true
#source = 192.168.44.102

I wonder if it's my problem, but I really can't find the solution.

Thanks!

DQATSH

dqatsh avatar Jul 29 '10 02:07 dqatsh

this is currently unsupported i think. chris, do you think we should add a slave_okay option to the nginx config? we'd need to add that query flag - not sure if this is supported by the C driver yet either...

mdirolf avatar Aug 10 '10 17:08 mdirolf

would be nice to have this feature,

we want to use replications sets, and to have multiple nginx instances connecting to multiple mongo instances at best.

i checked out today, and seems to be working fine, when mongo is in master mode, but when a slave is getting master nginx seems to need a restart.

Requests to slave mongo seem to block, and never return. (at least no http result code is returned)

td-github avatar Aug 18 '10 10:08 td-github

I think we'll probably support this by waiting for mongos to support pass-through ops. Otherwise it will take quite a large duplication of effort to support all possible use cases here. Case to track is this one: http://jira.mongodb.org/browse/SERVER-1594

mdirolf avatar Aug 19 '10 13:08 mdirolf

IMHO the slaveokay should be supported, no matter if mongos is being changed or not. Reading from a slave is no magic and should be supported for maturity reasons anyway.

tobsch avatar Jan 10 '11 07:01 tobsch

feel free to implement and i'll merge :)

mdirolf avatar Jan 10 '11 13:01 mdirolf

Hi, I forked https://github.com/cheeming/nginx-gridfs and applied a patch based on https://github.com/mongodb/mongo-c-driver/commit/f063fb1d1f9dbefb86d58fdede222c2d4c6285c8. I have not done extensive testing but some might find it useful.

cheeming avatar Aug 06 '12 03:08 cheeming