diff --git a/configuration/manager/startCockroachCluster.sh b/configuration/manager/startCockroachCluster.sh index 686f39bb7a59fa0853c566929449c609751ebfa7..201de294c44f16af695dddbc4ae7435f85008940 100644 --- a/configuration/manager/startCockroachCluster.sh +++ b/configuration/manager/startCockroachCluster.sh @@ -5,6 +5,7 @@ source /home/ubuntu/dcsg2003/configuration/base.sh # 1) Hent inn alle aktuelle ip addresser #ipList=$(cat /home/ubuntu/logs/ipList) ipList="192.168.133.95 192.168.130.160 192.168.134.43" +glusterListIp="" # 2) Lag startup kommando for hver ip addresse for mainIp in $ipList @@ -13,6 +14,11 @@ do for ip in $ipList do + if [ $ip -ne $mainIp ] + then + glusterListIp="$glusterListIp $ip" + fi + kommando="$kommando$ip:26257," done kommando=$(echo "$kommando" | sed 's/,$//') @@ -20,4 +26,6 @@ do # 3) Via ssh, send startup kommando til fil i home ssh -o "StrictHostKeyChecking no" root@$mainIp "echo $kommando > /home/ubuntu/startdb.sh" + # Via ssh, send lista over ip-adresser i glusteren til aktuelle server + ssh -o "StrictHostKeyChecking no" root@$mainIp "echo $glusterListIp > /home/ubuntu/glusterListIp" done \ No newline at end of file