diff --git a/rebar.config b/rebar.config index 304aeafce..46ea2ae93 100644 --- a/rebar.config +++ b/rebar.config @@ -11,7 +11,7 @@ {deps, [ {lager_syslog, {git, "https://github.com/basho/lager_syslog.git", {tag, "3.1.1"}}}, {cluster_info, {git, "https://github.com/basho/cluster_info.git", {tag, "2.1.0"}}}, - {riak_kv, {git, "https://github.com/basho/riak_kv.git", {tag, "riak_kv-3.0.11"}}}, + {riak_kv, {git, "https://github.com/basho/riak_kv.git", {branch, "develop-3.0"}}}, {riak_auth_mods, {git, "https://github.com/basho/riak_auth_mods.git", {tag, "riak_kv-3.0.10"}}}, {riaknostic, {git, "https://github.com/basho/riaknostic.git", {tag, "riak_kv-3.0.10"}}}, diff --git a/rebar.lock b/rebar.lock index 3bf58b4f1..8f9e36d5c 100644 --- a/rebar.lock +++ b/rebar.lock @@ -111,7 +111,7 @@ 0}, {<<"riak_core">>, {git,"https://github.com/basho/riak_core.git", - {ref,"e8e329e684a236dea4f7719c73230e5458bc7722"}}, + {ref,"1afd61e871b08890de99a3424aec5b56c6cc2b95"}}, 1}, {<<"riak_dt">>, {git,"https://github.com/basho/riak_dt.git", @@ -123,7 +123,7 @@ 2}, {<<"riak_kv">>, {git,"https://github.com/basho/riak_kv.git", - {ref,"6ebac46bf9ead05dae716b05b2a3f5767c5288db"}}, + {ref,"159df407282e67b57cb7a43f36ed375324fcb035"}}, 0}, {<<"riak_pb">>, {git,"https://github.com/basho/riak_pb.git", diff --git a/rel/files/riak-admin b/rel/files/riak-admin index 7a4188f9d..59b94f1d8 100755 --- a/rel/files/riak-admin +++ b/rel/files/riak-admin @@ -16,9 +16,17 @@ ERTS_PATH=$BINDIR NAME_PARAM="-name" BOOT_FILE="start_clean" +# Function to validate the node is down +node_down_check() { + if relx_nodetool "ping" > /dev/null; then + echo "Node is already running!" + exit 1 + fi +} + usage() { echo "Usage: $SCRIPT { cluster | join | leave | backup | restore | test | " - echo " reip | js-reload | erl-reload | wait-for-service | " + echo " reip | reip_manual | erl-reload | wait-for-service | " echo " ringready | transfers | force-remove | down |" echo " cluster-info | member-status | ring-status | vnode-status |" echo " aae-status | diag | stat | status | transfer-limit | reformat-indexes |" @@ -881,16 +889,6 @@ case "$1" in done ;; - js[_-]reload) - # Reload all Javascript VMs - - shift #optional names come after 'js_reload' - - # Make sure the local node is running - - relx_nodetool rpc riak_kv_js_manager reload "$@" - ;; - erl[_-]reload) # Reload user Erlang code # Make sure the local node is running @@ -909,23 +907,63 @@ case "$1" in # Make sure the local node is not running node_down_check - # Sanity check the app.config file - check_config - ES=$? - if [ "$ES" -ne 0 ]; then - exit $ES + OLDNODE=$1 + NEWNODE=$2 + + echo "" + echo "Usage $SCRIPT $ACTION is not currently supported in Riak 3.0" + echo "" + echo "As an alternative use reip_manual:" + echo "riak admin reip_manual $OLDNODE $NEWNODE '/absolute_path_to/riak/data/ring' 'cluster_name'" + echo "" + echo "Where the path should be the absolute path to the ring directory in platform_data_dir containing filenames such as:" + echo "riak_core_ring.default.20221122164111" + echo "" + echo "The cluster_name should be set to the middle part of the ring file name (e.g. 'default' in this case)," + echo "or can be found when the node is active using app_helper:get_env(riak_core, cluster_name) from remote_console." + echo "" + + exit 1;; + + # check_config + # ES=$? + # if [ "$ES" -ne 0 ]; then + # exit $ES + # fi + + # OLDNODE=$1 + # NEWNODE=$2 + # $ERTS_PATH/erl -noshell \ + # -pa $RUNNER_LIB_DIR/basho-patches \ + # -boot $BOOT_FILE \ + # $CONFIG_ARGS \ + # -eval "riak_kv_console:$ACTION(['$OLDNODE', '$NEWNODE'])" \ + # -s init stop + # ;; + + reip_manual) + ACTION=$1 + shift + if [ $# -lt 4 ]; then + echo "Usage $SCRIPT $ACTION " + exit 1 fi + # Make sure the local node is not running + node_down_check + OLDNODE=$1 NEWNODE=$2 + RINGDIR=$3 + CLUSTERNAME=$4 $ERTS_PATH/erl -noshell \ -pa $RUNNER_LIB_DIR/basho-patches \ -boot $BOOT_FILE \ - $CONFIG_ARGS \ - -eval "riak_kv_console:$ACTION(['$OLDNODE', '$NEWNODE'])" \ + -eval "riak_kv_console:$ACTION(['$OLDNODE', '$NEWNODE', '$RINGDIR', '$CLUSTERNAME'])" \ -s init stop ;; + restore) ACTION=$1 shift