From 0e5157dc938d4608e1123b3149e1afce16f4dd7b Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Tue, 29 Jan 2019 10:26:41 +0000 Subject: [PATCH] add cluster-shell --- contrib/cluster-shell/clear-nodedbs.sh | 3 +++ contrib/cluster-shell/makenode.sh | 7 +++++++ contrib/cluster-shell/start.sh | 16 ++++++++++++++++ contrib/cluster-shell/stop.sh | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100755 contrib/cluster-shell/clear-nodedbs.sh create mode 100755 contrib/cluster-shell/makenode.sh create mode 100755 contrib/cluster-shell/start.sh create mode 100755 contrib/cluster-shell/stop.sh diff --git a/contrib/cluster-shell/clear-nodedbs.sh b/contrib/cluster-shell/clear-nodedbs.sh new file mode 100755 index 000000000..c79e5ce18 --- /dev/null +++ b/contrib/cluster-shell/clear-nodedbs.sh @@ -0,0 +1,3 @@ +#!/bin/sh +rm -fr loki*/tmp-nodes +rm loki*/profile.dat diff --git a/contrib/cluster-shell/makenode.sh b/contrib/cluster-shell/makenode.sh new file mode 100755 index 000000000..90813ac0f --- /dev/null +++ b/contrib/cluster-shell/makenode.sh @@ -0,0 +1,7 @@ +mkdir loki$1 +cd loki$1 +ln -s ../lokinet lokinet$1 +cp ../lokinet.ini . +nano lokinet.ini +cd .. +echo "killall -9 lokinet$1" >> ../stop.sh diff --git a/contrib/cluster-shell/start.sh b/contrib/cluster-shell/start.sh new file mode 100755 index 000000000..b636e1fce --- /dev/null +++ b/contrib/cluster-shell/start.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set +x +cd loki1 +nohup ./lokinet1 $PWD/lokinet.ini & +# seed node needs some time to write RC to make sure it's not expired on load for the rest +sleep 1 +cd ../loki2 +nohup ./lokinet2 $PWD/lokinet.ini & +cd ../loki3 +nohup ./lokinet3 $PWD/lokinet.ini & +cd ../loki4 +nohup ./lokinet4 $PWD/lokinet.ini & +cd ../loki5 +nohup ./lokinet5 $PWD/lokinet.ini & +cd .. +tail -f loki*/nohup.out diff --git a/contrib/cluster-shell/stop.sh b/contrib/cluster-shell/stop.sh new file mode 100755 index 000000000..745f94a84 --- /dev/null +++ b/contrib/cluster-shell/stop.sh @@ -0,0 +1,7 @@ +#!/bin/sh +killall -9 lokinet1 +killall -9 lokinet2 +killall -9 lokinet3 +killall -9 lokinet4 +killall -9 lokinet5 +killall -9 lokinet6