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

Distributed: assign role to nodes (Master/Replica) #3772

Closed
lvca opened this issue Mar 17, 2015 · 0 comments
Closed

Distributed: assign role to nodes (Master/Replica) #3772

lvca opened this issue Mar 17, 2015 · 0 comments
Assignees
Milestone

Comments

@lvca
Copy link
Member

lvca commented Mar 17, 2015

Assigning a role to servers can be useful to have read-only replicas avoiding any updates. Even the default is master, by assigning the role of replica allow to have many replicas around the network.

Where to define it? Not in the server configuration, to avoid hacking from users. It could be defined in distributed-config.json file. This could be the new default one:

{
    "autoDeploy": true,
    "hotAlignment": false,
    "offlineMsgQueueSize" : 0,
    "readQuorum": 1,
    "writeQuorum": 2,
    "failureAvailableNodesLessQuorum": false,
    "readYourWrites": true,
    "servers": { 
      "*": "master"
     },
    "clusters": {
        "internal": {
        },
        "index": {
        },
        "*": {
            "servers" : [ "<NEW_NODE>" ]
        }
    }
}

In this example we have 3 serves as master and we want to let to any other server that joins to be a merely slave:

{
    "autoDeploy": true,
    "hotAlignment": false,
    "offlineMsgQueueSize" : 0,
    "readQuorum": 1,
    "writeQuorum": 2,
    "failureAvailableNodesLessQuorum": false,
    "readYourWrites": true,
    "servers": { 
      "eur" : "master",
      "usa" : "master",
      "asia" : "master",
      "*": "replica"
     },
    "clusters": {
        "internal": {
        },
        "index": {
        },
        "*": {
            "servers" : [ "<NEW_NODE>" ]
        }
    }
}
@lvca lvca self-assigned this Mar 17, 2015
@lvca lvca added this to the 2.1 milestone Mar 17, 2015
lvca added a commit that referenced this issue Mar 17, 2015
@lvca lvca closed this as completed Mar 17, 2015
@lvca lvca changed the title Distributed: assign role to nodes (Master/Slave) Distributed: assign role to nodes (Master/Replica) Jul 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant