Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
fix: make sure cluster setups do not exceed n=3 by default
Single node setups want an n=1 setting, but that is the only
time the number of nodes and the number of replicas is linked.

In larger clusters, the values should not be the same. This
patch ensures that for clusters >3 nodes, we do not have to
tell the users to set node_count to 3 in the _cluster_setup
API.

More context for this in https://issues.apache.org/jira/browse/COUCHDB-2594
  • Loading branch information
janl authored and wohali committed Jul 30, 2017
1 parent 4d9bd58 commit 68545afed1000d69cdebbe36c4b7962e6305473b
Showing 1 changed file with 3 additions and 1 deletion.
@@ -169,7 +169,9 @@ setup_node(NewCredentials, NewBindAddress, NodeCount, Port) ->
config:set("chttpd", "bind_address", binary_to_list(NewBindAddress))
end,

config:set_integer("cluster", "n", NodeCount),
% for single node setups, set n=1, for larger setups, don’t
% exceed n=3 as a default
config:set_integer("cluster", "n", min(NodeCount, 3)),

case Port of
undefined ->

0 comments on commit 68545af

Please sign in to comment.