Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download keepalived.sh.sh script and place it in /root directory.
  2. Give execute permission and execute the script: 

    # chmod +x keepalived.sh
    # ./keepalived.sh


  3. Configure keep.env file inside /root/keep-alived folder

    Name

    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_IPSVirtual IP of the cluster. It should be available in the LAN. For example: 192.168.1.245
    KEEPALIVED_PRIORITYThe priority of the node. Instances with lower numbers will have a higher priority. It can take any value from 1-255. 
    KEEPALIVED_INTERFACEName of the network interface with which your machine is connected to the network. On CentOS, ifconfig or ip addr sh will show all the network interfaces and assigned addresses. 
    CLEARANCE_TIMEOUTCorresponds 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_IDDo 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


  4. Give the execute permission and execute the script: 

    # chmod +x keep-command.sh
    # ./keep-command.sh


...