Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant