You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2020/08/19 02:28:00 UTC
[GitHub] [incubator-pegasus] Shuo-Jia commented on a change in pull request #576: fix(script): operation return before the cluster balance when using pegasus_rolling_update.sh
Shuo-Jia commented on a change in pull request #576:
URL: https://github.com/apache/incubator-pegasus/pull/576#discussion_r472602305
##########
File path: scripts/pegasus_rebalance_cluster.sh
##########
@@ -0,0 +1,121 @@
+#!/bin/bash
+#
+# Pegasus cluster rebalance
+#
+
+PID=$$
+
+if [ $# -le 2 ]; then
+ echo "USAGE: $0 <cluster-name> <cluster-meta-list> <only_move_primary>"
+ echo
+ echo "for example:"
+ echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 true"
+ echo
+ exit 1
+fi
+
+cluster=$1
+meta_list=$2
+only_move_primary=$3
+
+pwd="$( cd "$( dirname "$0" )" && pwd )"
+shell_dir="$( cd $pwd/.. && pwd )"
+cd $shell_dir
+
+source ./scripts/minos_common.sh
+find_cluster $cluster
+if [ $? -ne 0 ]; then
+ echo "ERROR: cluster \"$cluster\" not found"
+ exit 1
+fi
+
+echo "UID=$UID"
+echo "PID=$PID"
+echo "Start time: `date`"
+rebalance_start_time=$((`date +%s`))
+echo
+
+echo "Generating /tmp/$UID.$PID.pegasus.rebalance.cluster_info..."
+echo cluster_info | ./run.sh shell --cluster $meta_list 2>&1 | sed 's/ *$//' >/tmp/$UID.$PID.pegasus.rebalance.cluster_info
+cname=`grep zookeeper_root /tmp/$UID.$PID.pegasus.rebalance.cluster_info | grep -o '/[^/]*$' | grep -o '[^/]*$'`
Review comment:
Well, now all scripts use the `regex` to filter the result, I think they can be refactored uniformly later
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org