...
- Download keepalived.sh.sh script and place it in
/root
directory. Give execute permission and execute the script:
# chmod +x keepalived.sh
# ./keepalived.sh
Configure keep.env file inside
/root/keep-alived
folderName
Description
KEEPALIVED_UNICAST_PEERS
IPs of the machines in the cluster. On each machine, this variable should have a list of IPs of all the other machines in the cluster. The format of the list is as below:
"#PYTHON2BASH:['192.168.1.76','192.168.1.80']"
KEEPALIVED_VIRTUAL_IPS
Virtual IP of the cluster. It should be available in the LAN. For example: 192.168.1.245 KEEPALIVED_PRIORITY
The priority of the node. Instances with lower numbers will have a higher priority. It can take any value from 1-255. KEEPALIVED_INTERFACE
Name of the network interface with which your machine is connected to the network. On CentOS, ifconfig
orip addr sh
will show all the network interfaces and assigned addresses.CLEARANCE_TIMEOUT
Corresponds to the initial startup time of the application in seconds which is being monitored by keepalived. A nominal value of 60-120 is good enough KEEPALIVED_ROUTER_ID
Do not change this value. SCRIPT_VAR
This script is continuously polled after 2 seconds. Keepalived relinquishes control if this shell script returns a non-zero response. For wallboard, it should be:
pidof dockerd && wget -O index.html http https://localhost/umm/base/index.html
Give the execute permission and execute the script:
# chmod +x keep-command.sh
# ./keep-command.sh
...