# Configuration on 192.168.1.166 global_defs { router_id lb01 #An identifier } vrrp_script chk_haproxy { script "killall -0 haproxy" interval 2 } vrrp_instance VI_1 { state MASTER interface ens160 virtual_router_id 52 priority 999 # Set the interval (in seconds) for sync check between MASTER and BACKUP load balancers. advert_int 1 # Configure the authentication type and password authentication { # Configure the authentication type, mainly PASS and AH auth_type PASS # Set the authentication password.The MASTER and BACKUP load balancers must use the same password within the same vrrp_instance to communicate properly. auth_pass amber1 } virtual_ipaddress { # The virtual IP is 192.168.1.99/24; Bounded interface is ens160; Alias for both MASTER and BACKUP load balancers is ens160:1 192.168.1.99/24 dev ens160 label ens160:1 } track_script { chk_haproxy } } # Configuration on 192.168.1.167 ```conf global_defs { router_id lb01 #An identifier } vrrp_script chk_haproxy { script "killall -0 haproxy" interval 2 } vrrp_instance VI_1 { state BACKUP interface ens160 virtual_router_id 52 priority 888 # Set the interval (in seconds) for sync check between MASTER and BACKUP load balancers. advert_int 1 # Configure the authentication type and password authentication { # Configure the authentication type, mainly PASS and AH auth_type PASS # Set the authentication password.The MASTER and BACKUP load balancers must use the same password within the same vrrp_instance to communicate properly. auth_pass amber1 } virtual_ipaddress { # The virtual IP is 192.168.1.99/24; Bounded interface is ens160; Alias for both MASTER and BACKUP load balancers is ens160:1 192.168.1.99/24 dev ens160 label ens160:1 } track_script { chk_haproxy } } ``` # Configuration on 192.168.1.168 ```conf global_defs { router_id lb01 #An identifier } vrrp_script chk_haproxy { script "killall -0 haproxy" interval 2 } vrrp_instance VI_1 { state BACKUP interface ens160 virtual_router_id 52 priority 777 # Set the interval (in seconds) for sync check between MASTER and BACKUP load balancers. advert_int 1 # Configure the authentication type and password authentication { # Configure the authentication type, mainly PASS and AH auth_type PASS # Set the authentication password.The MASTER and BACKUP load balancers must use the same password within the same vrrp_instance to communicate properly. auth_pass amber1 } virtual_ipaddress { # The virtual IP is 192.168.1.99/24; Bounded interface is ens160; Alias for both MASTER and BACKUP load balancers is ens160:1 192.168.1.99/24 dev ens160 label ens160:1 } track_script { chk_haproxy } }