-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathghe_HA_script.txt
More file actions
37 lines (29 loc) · 950 Bytes
/
ghe_HA_script.txt
File metadata and controls
37 lines (29 loc) · 950 Bytes
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
install postfix
sudo apt-get install mailutils
sudo apt-get update
check mail in /usr/bin
send mail using
echo "This is message body" | mail -s "This is Subject" sandeshs@devtools.in, vishwasm@devtools.in.
check mail -> spam
after delay
promotion takes place.
sudo vi check.sh
if ping -c 10 primary-hostname; then
echo "server up"
else
echo "server down"
sleep 3m;
if ping -c 10 primary-hostname; then
echo "server up"
else
echo "server down"
echo "This is message body" | /usr/bin/mail -s "This is Subject" someone@example.com
sleep 15m
ssh -p 122 admin@replica-hostname
ghe-repl-promote
...............................................................
fi
fi
crontab -e -> sudo sh check.sh
sudo chmod 777 check.sh
contineously ping -> if server is down for a fixed amount of time -> send a mail to admin -> delay for a fixed amount of time -> check status -> promote replica as primary