Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: slaveOk && DataCenter awareness #41

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Feature: slaveOk && DataCenter awareness #41

wants to merge 5 commits into from

Conversation

mengz0
Copy link

@mengz0 mengz0 commented May 24, 2012

How to use?

Before calling mongo_replset_connect,

set conn->flags = MONGO_SLAVE_OK
set conn->preferred_tag = "cloud"
set conn->tag_name = "DC"

then the host "E" will be chosen!

{
_id : "someSet",
members : [
{_id : 0, host : "A", tags : {"DC": "ny"}},
{_id : 1, host : "B", tags : {"DC": "ny"}},
{_id : 2, host : "C", tags : {"DC": "sf"}},
{_id : 3, host : "D", tags : {"DC": "sf"}},
{_id : 4, host : "E", tags : {"DC": "cloud"}}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant