diff --git a/scripts/pegasus_add_node_list.sh b/scripts/pegasus_add_node_list.sh index 8617f2071a..81b4905b1f 100755 --- a/scripts/pegasus_add_node_list.sh +++ b/scripts/pegasus_add_node_list.sh @@ -22,10 +22,10 @@ PID=$$ if [ $# -le 2 ]; then - echo "USAGE: $0 " + echo "USAGE: $0 (default 200)" echo echo "For example:" - echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3" + echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3 200" echo exit 1 fi @@ -40,6 +40,12 @@ cluster=$1 meta_list=$2 replica_task_id_list=$3 +if [ -z $4 ]; then + nfs_copy_rate_megabytes=200 +else + nfs_copy_rate_megabytes=$4 +fi + pwd="$( cd "$( dirname "$0" )" && pwd )" shell_dir="$( cd $pwd/.. && pwd )" cd $shell_dir @@ -71,7 +77,7 @@ do echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" done -./scripts/pegasus_rebalance_cluster.sh $cluster $meta_list true +./scripts/pegasus_rebalance_cluster.sh $cluster $meta_list true $nfs_copy_rate_megabytes echo "Finish time: `date`" add_node_finish_time=$((`date +%s`)) diff --git a/scripts/pegasus_offline_node_list.sh b/scripts/pegasus_offline_node_list.sh index 55fed3bcc4..86fb7358e0 100755 --- a/scripts/pegasus_offline_node_list.sh +++ b/scripts/pegasus_offline_node_list.sh @@ -22,10 +22,10 @@ PID=$$ if [ $# -le 2 ]; then - echo "USAGE: $0 " + echo "USAGE: $0 (default 100)>" echo echo "For example:" - echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3" + echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3 100" echo exit 1 fi @@ -40,6 +40,12 @@ cluster=$1 meta_list=$2 replica_task_id_list=$3 +if [ -z $4 ]; then + nfs_copy_rate_megabytes=100 +else + nfs_copy_rate_megabytes=$4 +fi + pwd="$( cd "$( dirname "$0" )" && pwd )" shell_dir="$( cd $pwd/.. && pwd )" cd $shell_dir @@ -52,6 +58,14 @@ if [ $? -ne 0 ]; then exit 1 fi +echo "Set nfs_copy_rate_megabytes $nfs_copy_rate_megabytes" +echo "remote_command -t replica-server replica.nfs.max_copy_rate_megabytes $nfs_copy_rate_megabytes" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes +set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes | wc -l` +if [ $set_ok -le 0 ]; then + echo "ERROR: set nfs_copy_rate_megabytes failed" + exit 1 +fi + echo "Set lb.assign_secondary_black_list..." echo "remote_command -l $pmeta meta.lb.assign_secondary_black_list $address_list" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.assign_secondary_black_list set_ok=`grep "set ok" /tmp/$UID.$PID.pegasus.offline_node_list.assign_secondary_black_list | wc -l` diff --git a/scripts/pegasus_rebalance_cluster.sh b/scripts/pegasus_rebalance_cluster.sh index b0fb46d6f3..62f70c734c 100755 --- a/scripts/pegasus_rebalance_cluster.sh +++ b/scripts/pegasus_rebalance_cluster.sh @@ -22,10 +22,10 @@ PID=$$ if [ $# -le 1 ]; then - echo "USAGE: $0 (default false)" + echo "USAGE: $0 (default false) (default 100)" echo echo "for example:" - echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 true" + echo " $0 onebox 127.0.0.1:34601,127.0.0.1:34602 true 100" echo exit 1 fi @@ -39,6 +39,12 @@ else only_move_primary=$3 fi +if [ -z $4 ]; then + nfs_copy_rate_megabytes=100 +else + nfs_copy_rate_megabytes=$4 +fi + pwd="$( cd "$( dirname "$0" )" && pwd )" shell_dir="$( cd $pwd/.. && pwd )" cd $shell_dir @@ -82,6 +88,14 @@ if [ "$only_move_primary" == "true" ]; then fi echo +echo "Set nfs_copy_rate_megabytes $nfs_copy_rate_megabytes" +echo "remote_command -t replica-server replica.nfs.max_copy_rate_megabytes $nfs_copy_rate_megabytes" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.cluster_rebalance.set_nfs_copy_rate_megabytes +set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.cluster_rebalance.set_nfs_copy_rate_megabytes | wc -l` +if [ $set_ok -le 0 ]; then + echo "ERROR: set nfs_copy_rate_megabytes failed" + exit 1 +fi + echo "Set meta level to lively..." echo "set_meta_level lively" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.rebalance.set_meta_level set_ok=`grep 'control meta level ok' /tmp/$UID.$PID.pegasus.rebalance.set_meta_level | wc -l`