You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by mi...@apache.org on 2014/09/10 11:28:44 UTC
couchdb commit: updated refs/heads/2324-fix-n-in-dev-run to eb6281d
Repository: couchdb
Updated Branches:
refs/heads/2324-fix-n-in-dev-run [created] eb6281d73
Make N value in dev/run configurable
This commit makes N (the number of development nodes spun up)
a command line option. It also fixes a magic number which was
preventing the value of N from changing the number of nodes
spun up.
Closes COUCHDB-2324
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/eb6281d7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/eb6281d7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/eb6281d7
Branch: refs/heads/2324-fix-n-in-dev-run
Commit: eb6281d7378f009312ea938b55930a677977e582
Parents: 38cc17d
Author: Mike Wallace <mi...@googlemail.com>
Authored: Wed Sep 10 10:06:01 2014 +0100
Committer: Mike Wallace <mi...@googlemail.com>
Committed: Wed Sep 10 10:27:55 2014 +0100
----------------------------------------------------------------------
dev/run | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/eb6281d7/dev/run
----------------------------------------------------------------------
diff --git a/dev/run b/dev/run
index a4f76cb..5bfe86d 100755
--- a/dev/run
+++ b/dev/run
@@ -31,7 +31,7 @@ USAGE = "%prog [options] [command to run...]"
DEV_PATH = os.path.dirname(os.path.abspath(__file__))
COUCHDB = os.path.dirname(DEV_PATH)
-N = 3
+DEFAULT_N = 3
PROCESSES = []
@@ -106,7 +106,7 @@ def write_configs(opts):
datadir = os.path.join(DEV_PATH, "data")
if not os.path.exists(datadir):
os.makedirs(datadir)
- for i in range(1,4):
+ for i in range(1, N+1):
node = "node%d" % i
args = {
"prefix": COUCHDB,
@@ -234,7 +234,9 @@ def wait_for_procs():
def options():
return [
op.make_option("-a", "--admin", metavar="USER:PASS", default=None,
- help="Add an admin account to the development cluster")
+ help="Add an admin account to the development cluster"),
+ op.make_option("-n", "--nodes", metavar="N", default=DEFAULT_N,
+ type="int", help="Number of development nodes to be spun up")
]
@@ -242,6 +244,9 @@ def main():
parser = op.OptionParser(usage=USAGE, option_list=options())
opts, args = parser.parse_args()
+ global N
+ N = opts.nodes
+
init_log_dir()
init_beams()
write_configs(opts)