Hidden members and Sharding

98 views
Skip to first unread message

Jeremy Wilson

unread,
Jul 11, 2012, 11:36:31 AM7/11/12
to mongod...@googlegroups.com
I'd like to have an analytics replica in my setup, but I don't see how it's possible to have hidden and sharding, since mongos connects to the full replica set.

Hidden works in a single replica set situation, but when it's sharded, how can I connect to the hidden shards?

William Z

unread,
Jul 12, 2012, 5:39:51 PM7/12/12
to mongod...@googlegroups.com

Hi Jeremy!

Unfortunately, it's not possible to query a hidden replica set member with a sharded cluster in the current production version of MongoDB (v 2.0.6). 

In that version, the best that you can do is issue your queries with the 'SlaveOK' flag set.  This will serve as a hint to 'mongos' that it can safely route your query to one of the secondary members of the replica set. 

New support for "Read Tagging" is currently in development for the upcoming release of MongoDB.  This is an extension of the existing support for "Write Tagging". 

The current support for "Write Tagging" allows you to tag individual members of a Replica Set.  Once you've done that, you can use special options on the Write Concern to specify which replica set members (actually, which tags) you'd like the write to be directed to. 

You can read more about "Write Tagging" here:
 - http://www.mongodb.org/display/DOCS/Data+Center+Awareness#DataCenterAwareness-Tagging%28version2.0%29

The upcoming support for "Read Tagging" will extend this functionality to reads.  Once your MongoDB driver has been extended to support "Read Tagging", you will be able to direct your read to a particular set of tagged replica set members, even when you're using a sharded cluster.

The Jira issues that cover this are:
 - https://jira.mongodb.org/browse/SERVER-3358
 - https://jira.mongodb.org/browse/SERVER-4464

Please feel free to add yourself as a follower on these issues.

Let me know if you have further questions.

 -William

Shi Shei

unread,
Oct 5, 2012, 1:22:30 PM10/5/12
to mongod...@googlegroups.com
> you will be able to direct your read to a particular set of tagged replica set members, even when you're using a sharded cluster.

Is this true even for a hidden member (using v2.2.0)?

William Zola

unread,
Oct 5, 2012, 11:11:42 PM10/5/12
to mongod...@googlegroups.com
Using 2.2.0, you cannot direct reads from a sharded cluster to go to a hidden member.  

What you *can* do in 2.2.0 is to tag a particular set of nodes with a particular tag, and direct a read to only go to those nodes.

-William

Shi Shei

unread,
Oct 9, 2012, 10:42:14 AM10/9/12
to mongod...@googlegroups.com
Thanks William!
However, this means that hidden members are nearly useless in a sharded system since they can't be reached going through mongos.
They could only be of use when connected directly to them but I don't see many use cases for this. You could hide the member perhaps for redundancy reasons or making backups.

William Zola

unread,
Oct 9, 2012, 1:05:01 PM10/9/12
to mongod...@googlegroups.com
Hi Shi!


On Tuesday, October 9, 2012 7:42:14 AM UTC-7, Shi Shei wrote:
Thanks William!
However, this means that hidden members are nearly useless in a sharded system since they can't be reached going through mongos.
They could only be of use when connected directly to them but I don't see many use cases for this. You could hide the member perhaps for redundancy reasons or making backups.

You are absolutely correct.

 -William 
Reply all
Reply to author
Forward
0 new messages