Skip to content

Commit bf0c48c

Browse files
author
Luke Bakken
committed
Add option to only start cluster
1 parent 419dbc5 commit bf0c48c

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

setup-riak

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ opt_ports=''
5959
opt_riak_conf=''
6060
opt_search='on' # NB: yz search on / off
6161
opt_strong_consistency='false'
62+
opt_setup_only='false'
6263
opt_use_security='false'
6364

6465
function pinfo_options
@@ -240,7 +241,10 @@ function setup_cluster
240241
wait
241242

242243
commit_cluster "$riak_admin"
243-
riak_cluster_config "$riak_admin" "$starting_http_port" "$opt_strong_consistency" "$opt_use_security"
244+
if [[ $opt_setup_only == 'false' ]]
245+
then
246+
riak_cluster_config "$riak_admin" "$starting_http_port" "$opt_strong_consistency" "$opt_use_security"
247+
fi
244248
return 0
245249
}
246250

@@ -348,8 +352,10 @@ function setup_riak
348352
set -o errexit
349353

350354
commit_cluster "$riak_admin"
351-
riak_cluster_config "$riak_admin" "$http_port" "$opt_strong_consistency" "$opt_use_security"
352-
355+
if [[ $opt_setup_only == 'false' ]]
356+
then
357+
riak_cluster_config "$riak_admin" "$http_port" "$opt_strong_consistency" "$opt_use_security"
358+
fi
353359
return 0
354360
}
355361

@@ -362,7 +368,7 @@ Usage:
362368
363369
setup-riak [-p <riak rel or devrel path>]
364370
[-f <riak.conf from installed pkg>]
365-
[-l PB:HTTP] [-d <secs>] [-clsxz]
371+
[-l PB:HTTP] [-d <secs>] [-closxz]
366372
367373
-p Riak devrel or rel path (Default: \"$default_cluster_path\")
368374
-f riak.conf from package (Default: \"$default_riak_conf\")
@@ -371,14 +377,15 @@ setup-riak [-p <riak rel or devrel path>]
371377
-s Set up cluster to use Riak Security
372378
-x Shut down any nodes and clean up directories.
373379
-z Set up cluster WITHOUT Yokozuna Search (Default: $opt_search)
380+
-o Only start cluster, do not configure bucket types
374381
375382
-l PB:HTTP Use PB as PB port (Default: $default_pb_port),
376383
HTTP as HTTP port (Default: $default_http_port)
377384
"
378385
exit 0
379386
}
380387

381-
while getopts "hcsxzp:f:d:l:" opt; do
388+
while getopts "hcosxzp:f:d:l:" opt; do
382389
case $opt in
383390
p)
384391
opt_cluster_path="$OPTARG";;
@@ -390,6 +397,8 @@ while getopts "hcsxzp:f:d:l:" opt; do
390397
opt_ports="$OPTARG";;
391398
c)
392399
opt_strong_consistency='true';;
400+
o)
401+
opt_setup_only='true';;
393402
s)
394403
opt_use_security='true';;
395404
x)

0 commit comments

Comments
 (0)