Keepalived配置需要注意的问题

[root@redis05 ~]# cat /etc/keepalived/keepalived.conf
global_defs {
	router_id lb_cip
	script_user root
	enable_script_security
}
vrrp_script chk_apiserver {
 script "/home/itadmin/scripts/check_cip.sh"
 interval 5
 weight -10
 fall 3
 rise 2
}
vrrp_instance VI_1 {
		 state BACKUP
		 interface ens33
		 virtual_router_id 51
		 mcast_src_ip 192.168.128.135
		 priority 101
		 nopreempt 
		 advert_int 1
		 authentication {
		 	auth_type PASS
		 	auth_pass gitlab
		 }
		 track_script {
		 	chk_apiserver
		 }
		 virtual_ipaddress {
		 	192.168.128.130
		  }
		notify_master "/usr/local/ha_cip/cip.sh start"
		notify_backup "/usr/local/ha_cip/cip.sh stop"

}

 

[root@redis05 ~]# ls -lrt /usr/local/ha_cip/
total 8
-rwxr-xr-x 1 root root 476 Dec 29 10:40 check_cip.sh
-rwxr-xr-x 1 root root 464 Jan 18 12:10 cip.sh

 

posted @ 2020-01-18 19:36  heycomputer  阅读(47)  评论(0编辑  收藏  举报