From 204f2d38aff6e1e129dffed6433dd7d199d85457 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Fri, 18 Apr 2014 18:24:19 -0700 Subject: [PATCH 1/2] docs(api): add Cluster Config API --- Documentation/api.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/api.md b/Documentation/api.md index ed25b74fb..cdba9f47d 100644 --- a/Documentation/api.md +++ b/Documentation/api.md @@ -1197,3 +1197,39 @@ curl -L http://127.0.0.1:4001/v2/stats/store "watchers": 0 } ``` + +## Cluster Config + +Cluster config manages cluster properties to ensure both fault tolerance and high performance. + +### Set Cluster Config + +```sh +curl -L http://127.0.0.1:7001/v2/admin/config -XPUT -d '{"activeSize":3, "promoteDelay":1800}' +``` + +```json +{ + "activeSize": 3, + "promoteDelay": 1800 +} +``` + +`activeSize` indicates expected active peer-mode instances in the cluster. + +The size of cluster is controlled to be around a certain number. If it is not, it will promote standby-mode instances or demote peer-mode instances to make it happen. + +`promoteDelay` indicates the minimum length of delay that has been observed before promotion or demotion. + +### Get Cluster Config + +```sh +curl -L http://127.0.0.1:7001/v2/admin/config +``` + +```json +{ + "activeSize": 3, + "promoteDelay": 1800 +} +``` From 8b5d9cc1fb01fbf98c7e9408b07380ec51d9b8aa Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Mon, 5 May 2014 18:49:21 -0700 Subject: [PATCH 2/2] docs(api): make Cluster Config API part clearer --- Documentation/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/api.md b/Documentation/api.md index cdba9f47d..f82769006 100644 --- a/Documentation/api.md +++ b/Documentation/api.md @@ -1200,7 +1200,7 @@ curl -L http://127.0.0.1:4001/v2/stats/store ## Cluster Config -Cluster config manages cluster properties to ensure both fault tolerance and high performance. +The configuration endpoint manages shared cluster wide properties. ### Set Cluster Config @@ -1215,7 +1215,7 @@ curl -L http://127.0.0.1:7001/v2/admin/config -XPUT -d '{"activeSize":3, "promot } ``` -`activeSize` indicates expected active peer-mode instances in the cluster. +`activeSize` is the maximum number of peers that can join the cluster and participate in the consensus protocol. The size of cluster is controlled to be around a certain number. If it is not, it will promote standby-mode instances or demote peer-mode instances to make it happen.