This is a sharded setup of MongoDB (2.0.0) with multiple replica sets of 3 nodes each. Mongoid is going through mongos. I want to dedicate one of the secondary nodes (of each replica set) for long running queries that would otherwise affect user experience; I don't want normal queries to go there. I see that I can tag the nodes (data center awareness) but how can I send reads to specifically tagged nodes?
The other use case for this would be to have a backup node in a different data center but queries should only go to local data center and not be randomly distributed to include a remote data center.
After consulting the docs, I'm pretty sure that it's not possible to do what you want, at least not at the database level. Since mongos abstracts shards from the application, there's no way for you to direct a query to a specific shard.
However, I think that there's a higher level concept here. If you have a long-running query that doesn't need to block the UI, you'd be better off setting up a message queue and pop the query onto it. This way, the query can be run in the background. If said query will affect the performance of the system in general, you probably need to lower the impact of it by either splitting it up into queries that work on a smaller dataset and reassembling this dataset in memory or finding a way to lower its priority so that the system resources aren't too affected.
Hope this helps.