how to persist db.getMongo().setSlaveOk()

602 views
Skip to first unread message

Alex Howansky

unread,
Sep 14, 2010, 4:42:39 PM9/14/10
to mongod...@googlegroups.com

I've got a replica set up and running and, near as I can tell, it's
working just fine. However, I'm having problems querying the slaves. The
db.getMongo().setSlaveOk() setting doesn't seem to persist across
connections. Is there some way to specify this in a manner where it will
be allowed by default? (E.g., in order to use mongofiles or nginx-gridfs.)

Thanks,

--
Alex

roger

unread,
Sep 14, 2010, 5:36:42 PM9/14/10
to mongodb-user

If I understand you correctly, you'll need to pass the slaveok option
at the connection level in your driver. What language / driver are you
using ?

-Roger

Kristina Chodorow

unread,
Sep 14, 2010, 5:43:25 PM9/14/10
to mongod...@googlegroups.com
slaveOk is set for each request, so there's no way (at the moment) to say it's "okay for everyone."  You could file a feature request for the tools your using (mongofiles, nginx-gridfs) for them to add a slaveOkay option.


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Alex Howansky

unread,
Sep 14, 2010, 6:40:48 PM9/14/10
to mongod...@googlegroups.com
> If I understand you correctly, you'll need to pass the slaveok option
> at the connection level in your driver. What language / driver are you
> using ?

I'm not using any driver directly. I'm using either mongofiles or
nginx-gridfs, neither of which (to my knowledge) support this setting on
the client side.

--
Alex

Alex Howansky

unread,
Sep 14, 2010, 6:53:25 PM9/14/10
to mongod...@googlegroups.com
> slaveOk is set for each request, so there's no way (at the moment) to
> say it's "okay for everyone." You could file a feature request for the
> tools your using (mongofiles, nginx-gridfs) for them to add a slaveOkay
> option.

Nuts, looks like I have to wait for this:

http://github.com/mdirolf/nginx-gridfs/issues#issue/11

--
Alex

Kristina Chodorow

unread,
Sep 14, 2010, 6:56:24 PM9/14/10
to mongod...@googlegroups.com
You can vote for/track the jira case, it should be done this fall.


Alex

roger

unread,
Sep 14, 2010, 7:05:40 PM9/14/10
to mongodb-user

Ok thanks. Per Kristina's post, it sounds like you'll have to request
feature enhancements for that. -Roger
Reply all
Reply to author
Forward
0 new messages