From e428e18322553bfe8fb0f0112122f417ad4f072c Mon Sep 17 00:00:00 2001 From: alok Date: Tue, 12 Jun 2018 22:12:00 -0700 Subject: [PATCH] changed permissions and seperated linux and mac versions --- aws-scripts/kill_node.sh | 5 +++++ aws-scripts/run_instances.sh | 6 +++++- aws-scripts/say_hello.sh | 0 aws-scripts/setup_golang.sh | 11 ++--------- aws-scripts/setup_golang_path.sh | 8 ++++++++ aws-scripts/user-data.sh | 0 deploy_linux.sh | 15 +++++++++++++++ 7 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 aws-scripts/kill_node.sh mode change 100644 => 100755 aws-scripts/say_hello.sh mode change 100644 => 100755 aws-scripts/setup_golang.sh create mode 100755 aws-scripts/setup_golang_path.sh mode change 100644 => 100755 aws-scripts/user-data.sh create mode 100755 deploy_linux.sh diff --git a/aws-scripts/kill_node.sh b/aws-scripts/kill_node.sh new file mode 100755 index 000000000..08b90f223 --- /dev/null +++ b/aws-scripts/kill_node.sh @@ -0,0 +1,5 @@ +for pid in `/bin/ps -fu $USER| grep "slave.go\|slave -port\|leader\|benchmark_node" | grep -v "grep" | awk '{print $2}'`; +do + echo 'Killed process: '$pid + kill -9 $pid +done diff --git a/aws-scripts/run_instances.sh b/aws-scripts/run_instances.sh index 8aff1e460..c804d5dd9 100755 --- a/aws-scripts/run_instances.sh +++ b/aws-scripts/run_instances.sh @@ -1,4 +1,8 @@ #!/bin/bash -x cd /home/ec2-user/projects/src/harmony-benchmark -./deploy.sh local_iplist.txt +# GOROOT is the location where Go package is installed on your system + +. aws-scripts/setup_golang_path.sh + +./deploy_linux.sh local_iplist.txt ./send_txn.sh \ No newline at end of file diff --git a/aws-scripts/say_hello.sh b/aws-scripts/say_hello.sh old mode 100644 new mode 100755 diff --git a/aws-scripts/setup_golang.sh b/aws-scripts/setup_golang.sh old mode 100644 new mode 100755 index 1bf2bd2f4..50b1560b3 --- a/aws-scripts/setup_golang.sh +++ b/aws-scripts/setup_golang.sh @@ -1,12 +1,5 @@ - +#!/bin/bash -x sudo yum update -y sudo yum install -y golang -# GOROOT is the location where Go package is installed on your system -export GOROOT=/usr/lib/golang - -# GOPATH is the location of your work directory -export GOPATH=$HOME/projects - -# PATH in order to access go binary system wide -export PATH=$PATH:$GOROOT/bin +. aws-scripts/setup_golang.sh \ No newline at end of file diff --git a/aws-scripts/setup_golang_path.sh b/aws-scripts/setup_golang_path.sh new file mode 100755 index 000000000..d3566cc91 --- /dev/null +++ b/aws-scripts/setup_golang_path.sh @@ -0,0 +1,8 @@ +# GOROOT is the location where Go package is installed on your system +export GOROOT=/usr/lib/golang + +# GOPATH is the location of your work directory +export GOPATH=$HOME/projects + +# PATH in order to access go binary system wide +export PATH=$PATH:$GOROOT/bin \ No newline at end of file diff --git a/aws-scripts/user-data.sh b/aws-scripts/user-data.sh old mode 100644 new mode 100755 diff --git a/deploy_linux.sh b/deploy_linux.sh new file mode 100755 index 000000000..07c973478 --- /dev/null +++ b/deploy_linux.sh @@ -0,0 +1,15 @@ +##The commented suffix is for linux +##Reference: https://github.com/Zilliqa/Zilliqa/blob/master/tests/Node/test_node_simple.sh +sudo sysctl net.core.somaxconn=1024 +sudo sysctl net.core.netdev_max_backlog=65536; +sudo sysctl net.ipv4.tcp_tw_reuse=1; +sudo sysctl -w net.ipv4.tcp_rmem='65536 873800 1534217728'; +sudo sysctl -w net.ipv4.tcp_wmem='65536 873800 1534217728'; +sudo sysctl -w net.ipv4.tcp_mem='65536 873800 1534217728'; + +./kill_node.sh +ipfile=$1 +while read ip port mode; do + #echo $ip $port $mode $ipfile + go run ./benchmark_node.go -ip $ip -port $port -ipfile $ipfile& +done < $ipfile