Replication: Automatically reassign high volume reads to secondary

Showing 1-10 of 10 messages
Replication: Automatically reassign high volume reads to secondary Need Help 10/26/11 2:55 PM
We are using MongoDB for the first time in our shop.  I am doing
research on replication.  That is, if there are high volume of reads
on the primary, does MongoDB automatically reassign some of the reads
to the secondaries.  Could someone please be kind enough to explain.

Thank you so much!
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Eliot Horowitz 10/26/11 9:41 PM
Nothing automatically.
By default all reads hit primary.

For any given query you can tell the driver reading from a secondary is ok.

> --
> 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.
>
>

Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Need Help 10/27/11 3:42 PM
Hello:
 
We direct all reads/writes to the primary.  However, we hope MongoDB would re-route as much reads to the secondary as possible.  If we set slaveOk(), will all the reads be directed to the secondary, or do we need to manually direct them to the secondary?  Please clarify!
 
Thank you very much for your help!

Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Timothy Hawkins 10/27/11 4:48 PM
If you are using php, then this works fine as long as you ate using a php driver 1.1.4 , this seemed to stop working on any php driver greater than that. We had to downgrade all of our production systems to this version to make it work. 

Sent from my iPad
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Need Help 10/27/11 5:41 PM
Hello:

We are using Java. 

If we set slaveOk(), then the reads would be distributed to the secondary automatically, as we had hoped.  However, none of the writes would go through.  If we turn of slaveOk(), then all reads and writes would be directed towards the primary, then there was no problem. 

We would like to know if MongoDB would automatically re-direct all reads to the secondary and the writes to the primary.  Of course, we could manually set all reads to the secondary and the writes to the primary explicitly in Java, which would be very messy.  We would like to know if MongoDB has a solution.

Thanks a lot for your help! 
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Nat 10/27/11 5:58 PM
With slaveOk on, all writes should still go to primary. If you don't see it working and you don't get any exception, can you turn WriteConcern.SAFE to find out what goes wrong?
From: Tiffany <tiffa...@gmail.com>
Date: Thu, 27 Oct 2011 17:41:21 -0700
Subject: Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Tony Hannan 10/28/11 10:27 AM
Just to reiterate. slaveOk reads always go to a secondary. Non-slaveOk reads always go to the primary. Writes always go to the primary.
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Need Help 10/28/11 10:34 AM
Hello:
 
I have tried setWriteConcern(WriteConcern.SAFE) and slaveOk() together, I was able to write to the primary and propogate to the secondary.  Thanks a lot for your help!
 
However, I was told slaveOk() was deprecated, that I should use setReadPreference(ReadPreference.SECONDARY).  Is this so?
 
Thank you very much for your help!

On Thu, Oct 27, 2011 at 5:58 PM, Nat <nat....@gmail.com> wrote:

Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Tony Hannan 10/28/11 12:37 PM
slaveOK and readPreference=secondary are synonyms.
Re: [mongodb-user] Replication: Automatically reassign high volume reads to secondary Scott Hernandez 11/4/11 3:25 AM
In the future a ReadPreference will provide more control over where
reads go, like with tagging support.

slaveOk will continue to work for a while even though it is marked as
deprecated.