summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kowalski <robertkowalski@apache.org>2015-07-24 16:21:36 +0200
committerJan Lehnardt <jan@apache.org>2017-06-03 11:39:50 +0200
commite9cc63fc9c524c6f1f0b736a45cb8b060f59929d (patch)
treee244c1a8193b2eadfc10b70dd4cfc8115bb8e37b
parent251f6f90a6182d52764bff1197289b8d4717cbaf (diff)
downloadcouchdb-e9cc63fc9c524c6f1f0b736a45cb8b060f59929d.tar.gz
add node count handling to ./dev/run
-rwxr-xr-xdev/run9
1 files changed, 5 insertions, 4 deletions
diff --git a/dev/run b/dev/run
index 781c71530..8af3ac416 100755
--- a/dev/run
+++ b/dev/run
@@ -407,22 +407,23 @@ def boot_node(ctx, node):
@log('Running cluster setup')
def cluster_setup(ctx):
lead_port, _ = get_ports(1)
- if enable_cluster(lead_port, *ctx['admin']):
+ if enable_cluster(ctx['N'], lead_port, *ctx['admin']):
for num in range(1, ctx['N']):
node_port, _ = get_ports(num + 1)
- enable_cluster(node_port, *ctx['admin'])
+ enable_cluster(ctx['N'], node_port, *ctx['admin'])
add_node(lead_port, node_port, *ctx['admin'])
finish_cluster(lead_port, *ctx['admin'])
return lead_port
-def enable_cluster(port, user, pswd):
+def enable_cluster(node_count, port, user, pswd):
conn = httpclient.HTTPConnection('127.0.0.1', port)
conn.request('POST', '/_cluster_setup',
json.dumps({'action': 'enable_cluster',
'bind_address': '0.0.0.0',
'username': user,
- 'password': pswd}),
+ 'password': pswd,
+ 'node_count': node_count}),
{'Authorization': basic_auth_header(user, pswd),
'Content-Type': 'application/json'})
resp = conn.getresponse()