You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by ji...@apache.org on 2021/11/09 06:41:49 UTC

[incubator-pegasus] branch master updated: refactor(script): update the nfs rate name of remote-command (#837)

This is an automated email from the ASF dual-hosted git repository.

jiashuo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 3255029  refactor(script): update the nfs rate name of remote-command (#837)
3255029 is described below

commit 32550296a66b619f019fd2993ab32392ad18faa3
Author: Jiashuo <js...@live.com>
AuthorDate: Tue Nov 9 14:41:44 2021 +0800

    refactor(script): update the nfs rate name of remote-command (#837)
---
 scripts/pegasus_add_node_list.sh     | 10 +++++-----
 scripts/pegasus_offline_node_list.sh | 34 +++++++++++++++++++++++-----------
 scripts/pegasus_rebalance_cluster.sh | 34 +++++++++++++++++++++++-----------
 3 files changed, 51 insertions(+), 27 deletions(-)

diff --git a/scripts/pegasus_add_node_list.sh b/scripts/pegasus_add_node_list.sh
index 81b4905..049d724 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 <cluster-name> <cluster-meta-list> <replica-task-id-list> <nfs_copy_rate_megabytes>(default 200)"
+  echo "USAGE: $0 <cluster-name> <cluster-meta-list> <replica-task-id-list> <nfs_rate_megabytes_per_disk>(default 100)"
   echo
   echo "For example:"
-  echo "  $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3 200"
+  echo "  $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3 100"
   echo
   exit 1
 fi
@@ -41,9 +41,9 @@ meta_list=$2
 replica_task_id_list=$3
 
 if [ -z $4 ]; then
-  nfs_copy_rate_megabytes=200
+  nfs_rate_megabytes_per_disk=100
 else
-  nfs_copy_rate_megabytes=$4
+  nfs_rate_megabytes_per_disk=$4
 fi
 
 pwd="$( cd "$( dirname "$0"  )" && pwd )"
@@ -77,7 +77,7 @@ do
   echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 done
 
-./scripts/pegasus_rebalance_cluster.sh $cluster $meta_list true $nfs_copy_rate_megabytes
+./scripts/pegasus_rebalance_cluster.sh $cluster $meta_list true $nfs_rate_megabytes_per_disk
 
 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 2d3fde0..29d391d 100755
--- a/scripts/pegasus_offline_node_list.sh
+++ b/scripts/pegasus_offline_node_list.sh
@@ -22,7 +22,7 @@
 PID=$$
 
 if [ $# -le 2 ]; then
-  echo "USAGE: $0 <cluster-name> <cluster-meta-list> <replica-task-id-list> <nfs_copy_rate_megabytes>(default 100)>"
+  echo "USAGE: $0 <cluster-name> <cluster-meta-list> <replica-task-id-list> <nfs_rate_megabytes_per_disk>(default 50)>"
   echo
   echo "For example:"
   echo "  $0 onebox 127.0.0.1:34601,127.0.0.1:34602 1,2,3 100"
@@ -41,9 +41,9 @@ meta_list=$2
 replica_task_id_list=$3
 
 if [ -z $4 ]; then
-  nfs_copy_rate_megabytes=100
+  nfs_rate_megabytes_per_disk=50
 else
-  nfs_copy_rate_megabytes=$4
+  nfs_rate_megabytes_per_disk=$4
 fi
 
 pwd="$( cd "$( dirname "$0"  )" && pwd )"
@@ -58,11 +58,17 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-echo "Set nfs_copy_rate_megabytes $nfs_copy_rate_megabytes"
-echo "remote_command -t replica-server 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`
+echo "Set nfs_copy/send_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk"
+echo "remote_command -t replica-server nfs.max_copy_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes_per_disk | wc -l`
 if [ $set_ok -le 0 ]; then
-  echo "ERROR: set nfs_copy_rate_megabytes failed"
+  echo "ERROR: set nfs_copy_rate_megabytes_per_disk failed"
+  exit 1
+fi
+echo "remote_command -t replica-server nfs.max_send_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_send_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_send_rate_megabytes_per_disk | wc -l`
+if [ $set_ok -le 0 ]; then
+  echo "ERROR: set nfs_send_rate_megabytes_per_disk failed"
   exit 1
 fi
 
@@ -104,11 +110,17 @@ if [ $set_ok -ne 1 ]; then
   exit 1
 fi
 
-echo "Set nfs_copy_rate_megabytes 500"
-echo "remote_command -t replica-server nfs.max_copy_rate_megabytes 500" | ./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`
+echo "Set nfs_copy/send_rate_megabytes_per_disk 500"
+echo "remote_command -t replica-server nfs.max_copy_rate_megabytes_per_disk 500" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_copy_rate_megabytes_per_disk | wc -l`
+if [ $set_ok -le 0 ]; then
+  echo "ERROR: set nfs_copy_rate_megabytes_per_disk failed"
+  exit 1
+fi
+echo "remote_command -t replica-server nfs.max_send_rate_megabytes_per_disk 500" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_send_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.offline_node_list.set_nfs_send_rate_megabytes_per_disk | wc -l`
 if [ $set_ok -le 0 ]; then
-  echo "ERROR: set nfs_copy_rate_megabytes failed"
+  echo "ERROR: set nfs_send_rate_megabytes_per_disk failed"
   exit 1
 fi
 
diff --git a/scripts/pegasus_rebalance_cluster.sh b/scripts/pegasus_rebalance_cluster.sh
index 00376bb..3782bf4 100755
--- a/scripts/pegasus_rebalance_cluster.sh
+++ b/scripts/pegasus_rebalance_cluster.sh
@@ -22,7 +22,7 @@
 PID=$$
 
 if [ $# -le 1 ]; then
-  echo "USAGE: $0 <cluster-name> <cluster-meta-list> <only-move-primary>(default false) <nfs_copy_rate_megabytes>(default 100)"
+  echo "USAGE: $0 <cluster-name> <cluster-meta-list> <only-move-primary>(default false) <nfs_rate_megabytes_per_disk>(default 100)"
   echo 
   echo "for example:"
   echo "  $0 onebox 127.0.0.1:34601,127.0.0.1:34602 true 100"
@@ -40,9 +40,9 @@ else
 fi
 
 if [ -z $4 ]; then
-  nfs_copy_rate_megabytes=100
+  nfs_rate_megabytes_per_disk=100
 else
-  nfs_copy_rate_megabytes=$4
+  nfs_rate_megabytes_per_disk=$4
 fi
 
 pwd="$( cd "$( dirname "$0"  )" && pwd )"
@@ -88,11 +88,17 @@ if [ "$only_move_primary" == "true" ]; then
 fi
 echo
 
-echo "Set nfs_copy_rate_megabytes $nfs_copy_rate_megabytes"
-echo "remote_command -t replica-server 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`
+echo "Set nfs_copy/send_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk"
+echo "remote_command -t replica-server nfs.max_copy_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_copy_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_copy_rate_megabytes_per_disk | wc -l`
 if [ $set_ok -le 0 ]; then
-  echo "ERROR: set nfs_copy_rate_megabytes failed"
+  echo "ERROR: set nfs_copy_rate_megabytes_per_disk failed"
+  exit 1
+fi
+echo "remote_command -t replica-server nfs.max_send_rate_megabytes_per_disk $nfs_rate_megabytes_per_disk" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_send_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_send_rate_megabytes_per_disk | wc -l`
+if [ $set_ok -le 0 ]; then
+  echo "ERROR: set nfs_send_rate_megabytes_per_disk failed"
   exit 1
 fi
 
@@ -151,11 +157,17 @@ if [ "$only_move_primary" == "true" ]; then
   echo
 fi
 
-echo "Set nfs_copy_rate_megabytes 500"
-echo "remote_command -t replica-server nfs.max_copy_rate_megabytes 500" | ./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`
+echo "Set nfs_copy/send_rate_megabytes_per_disk 500"
+echo "remote_command -t replica-server nfs.max_copy_rate_megabytes_per_disk 500" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_copy_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_copy_rate_megabytes_per_disk | wc -l`
+if [ $set_ok -le 0 ]; then
+  echo "ERROR: set nfs_copy_rate_megabytes_per_disk failed"
+  exit 1
+fi
+echo "remote_command -t replica-server nfs.max_send_rate_megabytes_per_disk 500" | ./run.sh shell --cluster $meta_list &>/tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_send_rate_megabytes_per_disk
+set_ok=`grep 'succeed: OK' /tmp/$UID.$PID.pegasus.rebalance_cluster.set_nfs_send_rate_megabytes_per_disk | wc -l`
 if [ $set_ok -le 0 ]; then
-  echo "ERROR: set nfs_copy_rate_megabytes failed"
+  echo "ERROR: set nfs_send_rate_megabytes_per_disk failed"
   exit 1
 fi
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org