Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}},

Expand Down
4 changes: 2 additions & 2 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
74 changes: 56 additions & 18 deletions rel/files/riak-admin
Original file line number Diff line number Diff line change
Expand Up @@ -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 |"
Expand Down Expand Up @@ -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
Expand All @@ -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 <old_nodename> <new_nodename> <ring_dir> <cluster_name>"
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
Expand Down