We present and write attractive Tech blog posts
apt install keepalived -y
apt install libipset13 -y
nano /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
state MASTER
interface ens192 #interface name
virtual_router_id 55
priority 150 #high priority will be prefered
advert_int 1
unicast_src_ip 192.168.15.19 #your interface ip
unicast_peer {
192.168.15.18 #your backup server ip
}
authentication {
auth_type PASS
auth_pass C3P9KlrG #auth password for keepalive must be 8 digits
}
virtual_ipaddress {
192.168.15.17 #virtual ip
}
}
systemctl enable --now keepalived.service
systemctl status keepalived
Now go to backup server
nano /etc/keepalived/keepalived.conf
vrrp_instance VI_1 {
state MASTER
interface ens160 #interface name
virtual_router_id 55
priority 100 #high priority will be prefered
advert_int 1
unicast_src_ip 192.168.15.18 #your interface ip
unicast_peer {
192.168.15.19 #your Master server ip
}
authentication {
auth_type PASS
auth_pass C3P9KlrG #auth password for keepalive must be 8 digits
}
virtual_ipaddress {
192.168.15.17 #virtual ip
}
}
systemctl enable --now keepalived.service
systemctl status keepalived