Skip to content
Snippets Groups Projects
Commit 294b6f61 authored by Sara Stentvedt Luggenes's avatar Sara Stentvedt Luggenes
Browse files

startcockdb pynta paa

parent b2df7ebe
No related branches found
No related tags found
No related merge requests found
...@@ -5,28 +5,19 @@ source /home/ubuntu/dcsg2003/configuration/base.sh ...@@ -5,28 +5,19 @@ source /home/ubuntu/dcsg2003/configuration/base.sh
# 1) Hent inn alle aktuelle ip addresser # 1) Hent inn alle aktuelle ip addresser
#ipList=$(cat /home/ubuntu/logs/ipList) #ipList=$(cat /home/ubuntu/logs/ipList)
ipList="192.168.133.95 192.168.130.160 192.168.134.43" ipList="192.168.133.95 192.168.130.160 192.168.134.43"
#for å referere til iplist, berre skriv $ipList
# 2) Lag startup kommando for hver ip addresse # 2) Lag startup kommando for hver ip addresse
# cockroach start --insecure --store=/bfdata --listen-addr=0.0.0.0:26257 --http-addr=0.0.0.0:8080 --background
#--join=server1:26257,server2:26257,server3:26257 --advertise-addr=serverX:26257 --max-offset=1500ms //dette er kommandoen
for mainIp in $ipList for mainIp in $ipList
do do
kommando="cockroach start --insecure --store=/bfdata --listen-addr=0.0.0.0:26257 --http-addr=0.0.0.0:8080 --background --join=" kommando="cockroach start --insecure --store=/bfdata --listen-addr=0.0.0.0:26257 --http-addr=0.0.0.0:8080 --background --join="
echo $kommando
for ip in $ipList for ip in $ipList
do do
kommando="$kommando$ip:26257," kommando="$kommando$ip:26257,"
echo $kommando
done done
kommando=$(echo "$kommando" | sed 's/,$//') kommando=$(echo "$kommando" | sed 's/,$//')
kommando="$kommando --advertise-addr=$mainIp:26257 --max-offset=1500ms" kommando="$kommando --advertise-addr=$mainIp:26257 --max-offset=1500ms"
echo $kommando
# 3) Via ssh, send startup kommando til fil i home # 3) Via ssh, send startup kommando til fil i home
ssh -o "StrictHostKeyChecking no" root@$mainIp "echo $kommando > /home/ubuntu/startdb.sh" ssh -o "StrictHostKeyChecking no" root@$mainIp "echo $kommando > /home/ubuntu/startdb.sh"
echo "ssh-ing skal vere gjort"
done done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment