同一局域网运行两套LVS

时间:2022-11-01 05:33:29

两套LVS的ID必须不一致 ,原文:  http://blog.chinaunix.net/uid-29578485-id-5671910.html

在LVS服务器中修改配置文件

vi /etc/keepalived/keepalived.conf

修改以下红色字体:

! Configuration File for keepalived

global_defs {

router_id LVS_DEVEL

lvs_id 5

}

vrrp_sync_group VGM_2 {

group {

VI_2

}

notify_master /root/startdr.sh

notify_backup /root/stopdr.sh

}

vrrp_instance VI_2 {

state MASTER    #备份服务器上将MASTER改为BACKUP

interface eth2

lvs_sync_daemon_inteface eth2

virtual_router_id 55

priority 100   #备份服务器上priority
90

advert_int 5

authentication {

auth_type PASS

auth_pass 1111

}

virtual_ipaddress {

192.168.60.163  dev eth2:0

#(如果有多个VIP,继续换行填写.)

}

}