-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab_setup_6_node.sh
executable file
·41 lines (36 loc) · 1.11 KB
/
lab_setup_6_node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#Add /etc/hosts entries
echo "10.0.2.101 server-1
10.0.2.102 server-2
10.0.2.103 server-3
10.0.2.104 server-4
10.0.2.105 server-5
10.0.2.106 server-6" >> /etc/hosts
#Check for iptables file and add glusterfs port 24007
if [ -f /tmp/iptables_done ]; then
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 24007 -j ACCEPT
iptables -A OUTPUT -p tcp -m state --state NEW -m tcp --dport 24007 -j ACCEPT
else
echo no iptables
fi
#restart glusterd due to some intermittent issues on lab starting.
systemctl --no-pager --no-block restart glusterd
sleep 10
if [ "$HOSTNAME" = server-1 ]; then
sleep 15
for server in server-2 server-3 server-4 server-5 server-6
do
echo "Adding ${server}"
gluster peer probe ${server}
probe_status=1
until [ "${probe_status}" -eq 0 ]; do
echo "probing server ${server}"
gluster peer probe ${server}
probe_status=$?
sleep 5
done
done
else
echo "nothing to do"
fi
touch /tmp/lab_setup_done