diff options
author | Robert Kowalski <robertkowalski@apache.org> | 2015-07-24 16:21:36 +0200 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2017-06-03 11:39:50 +0200 |
commit | e9cc63fc9c524c6f1f0b736a45cb8b060f59929d (patch) | |
tree | e244c1a8193b2eadfc10b70dd4cfc8115bb8e37b | |
parent | 251f6f90a6182d52764bff1197289b8d4717cbaf (diff) | |
download | couchdb-e9cc63fc9c524c6f1f0b736a45cb8b060f59929d.tar.gz |
add node count handling to ./dev/run
-rwxr-xr-x | dev/run | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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() |