Re: Read-only replica node in Azure worker role

27 views
Skip to first unread message

Andrew Emil

unread,
Sep 27, 2012, 4:33:27 PM9/27/12
to mongod...@googlegroups.com
Hi Stefan,

First of all, lets focus on the issue of getting a connection string that will only connect to your azure nodes. If your azure nodes are the only secondaries in the cluster, then you simply need to specify that your are reading from secondaries. However, if some of your secondaries are non-azure nodes, then this tactic will not ensure that all the reads are sent to the azure nodes.

To ensure that reads only go to your azure nodes you can use the new (and exciting) tag-aware read preferences that were included in the 2.2 release of mongodb. You can tag the azure nodes to distinguish them from your other secondaires, then set your read preferences based on that same tag. I link to some useful documentation down below if you would like to further look into this.

Next, the voting issue you are concerned about is actually quite easy to handle. If you set the azure nodes to A) priority = 0 and B) non-voting, you will ensure both that your azure nodes are never voted to be the primary and that your azure nodes will not be voting at all.
Finally, I am not sure what docs you have read, but instead of giving general advice, I thought it might be more helpful to link you to some docs that might be useful:

http://docs.mongodb.org/manual/applications/replication/ (specifically here, see the read preference info and tag set read preference info)

http://docs.mongodb.org/manual/core/replication/#replica-set-node-priority

http://www.mongodb.org/display/DOCS/Connections

Free free to respond with more questions or comments if you would like to further discuss the topic!

On Thursday, September 27, 2012 10:58:21 AM UTC-7, Stefan Moser wrote:
I'm looking to try something out and would like some advice from the experts.  We have a MongoDB replica set in a self-hosted data center.  We're starting to host some new applications in Azure and there is some data that needs to be shared between applications hosted in the data center and an application hosted in Azure.  The application hosted in Azure only needs read-only access so I was thinking of adding some replica nodes on Azure worker roles.  Note that we already have MongoDB running running in Azure worker roles for the application that is hosted in Azure.  

I'm looking at this documentation as a guide:  http://docs.mongodb.org/manual/tutorial/deploy-geographically-distributed-replica-set/ 

  • Will using a connection string that only specifies the "read-only in Azure nodes" servers be guaranteed to only connect to those servers?  Or given that they're part of the replica set lead to connections going to any of the servers in the replica set?
  • The nodes in Azure can never be voted as the primary, nor should they really ever have a vote.  If I set the Azure nodes to be non-voting members does that also mean they cannot be voted the primary?
  • Is there anything else that I have not mentioned that I should be thinking about?
Thanks in advance!

Stefan Moser

unread,
Sep 28, 2012, 1:42:06 PM9/28/12
to mongod...@googlegroups.com
Hi Andrew,

Thanks so much for your reply.  Connecting to the Azure nodes was the last piece of the puzzle for us.  We've solved all the problems in theory, all that's left is to try it out!

Cheers,
Stefan
Reply all
Reply to author
Forward
0 new messages