Commits

Anonymous committed 6f38451

I keep starting start-join incorrectly and don't realize it for a while.

  • Participants
  • Parent commits 7f1c564

Comments (0)

Files changed (4)

File start-backup-dump.sh

 #  Join riak cluster <clustername> using erlcookie <cookie>
 #  via the node listening at <ip>:<port>
 #  and dump the entire cluster's contents to <dumpfilename>
+if [ $# -le 5 ]; then
+    echo Usage: 1>&2
+    echo "    `basename $0` <clustername> <cookie> <ip in ring> " 1>&2
+    echo "                  <doorbell port> <filename to save dump to>" 1>&2
+    exit 1
+fi
 . riak-env.sh
 erl -noshell -pa deps/*/ebin -pa ebin -name backup_dumper -run riak_backup dump_config $1 $2 -run riak start -run riak_backup do_dump $3 $4 $5 -run init stop

File start-backup-restore.sh

 #  Join riak cluster <clustername> using erlcookie <cookie>
 #  via the node listening at <ip>:<port>
 #  and overwrite cluster data with that contained in <dumpfilename>
+if [ $# -le 5 ]; then
+    echo Usage: 1>&2
+    echo "    `basename $0` <clustername> <cookie> <ip in ring> " 1>&2
+    echo "                  <doorbell port> <filename to restore from>" 1>&2
+    exit 1
+fi
 . riak-env.sh
 erl -noshell -pa deps/*/ebin -pa ebin -name backup_restore -run riak_backup restore_config $1 $2 -run riak start -run riak_backup do_restore $3 $4 $2 $5 -run init stop
 

File start-eventer.sh

 #  Join riak cluster <clustername> using erlcookie <cookie>
 #  via the node listening at <ip>:<port>
 #  and register a riak event handler
+if [ $# -le 7 ]; then
+    echo Usage: 1>&2
+    echo "    `basename $0` <clustername> <cookie> <ip in ring> " 1>&2
+    echo "                  <doorbell port> <nodename> <event module name>" 1>&2
+    echo "                  <event module args>" 1>&2
+    exit 1
+fi
 . riak-env.sh
 erl -noshell -pa deps/*/ebin -pa ebin -name $5 -run riak_eventer eventer_config $1 $2 -run riak start -run riak_eventer do_eventer $3 $4 $6 $7

File start-join.sh

 #!/usr/bin/env bash
 # start-join <configfile> <ip> <port>
 # join an existing riak ring via a node known to be listening on ip:port
+if [ $# -le 3 ]; then
+    echo Usage: 1>&2
+    echo "    `basename $0` <config file> <ip of node in ring> <doorbell port>" 1>&2
+    exit 1
+fi
 . riak-env.sh
 NODENAME=$(erl -noshell -pa ebin -eval "error_logger:tty(false), riak_app:read_config(\"$1\"), io:format(\"~p~n\",[riak:get_app_env(riak_nodename)])" -run init stop)
 RHOSTNAME=$(erl -noshell -pa ebin -eval "error_logger:tty(false), riak_app:read_config(\"$1\"), io:format(\"~s~n\",[riak:get_app_env(riak_hostname)])" -run init stop)