1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| vim /etc/keepalived/keepalived.conf #打开编辑配置文件
#文件内容如下 global_defs { router_id LB01 script_user root enable_script_security }
vrrp_script chk_fs { script "/etc/keepalived/check-freeswitch.sh" #freeswitch检测脚本 interval 60 #脚本检测周期,单位:s weight 2 }
vrrp_instance VI_1 { state BACKUP interface eno2 #绑定为当前虚拟路由器使用的物理接口 virtual_router_id 51 #当前虚拟路由器的惟一标识,范围是0-255 priority 150 #当前主机在此虚拟路径器中的优先级;范围1-254 nopreempt #非抢占模式配置 advert_int 3 #vrrp通告的时间间隔 authentication { auth_type PASS auth_pass 1111 }
virtual_ipaddress { 192.168.200.101/29 label eno2:0 }
notify_master "/etc/keepalived/retart-freeswitch.sh" #晋升MASTER执行freeswitch重启脚本
track_script { chk_fs } }
|