- 论坛徽章:
- 0
|
我用两个虚拟机设置vrrp,不使用lvs,只是测试vrrp,但是不管用keepalived
虚拟机一:
! Configuration File for keepalived
global_defs {
notification_email {
acassen
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface eth4
garp_master_delay 10
smtp_alert
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.2.3.154
}
}这是全部文件,因为我只想试试vrrp功能
虚拟机2:
global_defs {
notification_email {
acassen
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state BACKUP
interface eth1
garp_master_delay 10
smtp_alert
virtual_router_id 51
priority 10
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.2.3.154
}
}这是全部文件,因为我只想试试vrrp功能
使用ip a看 两个机子上都有 inet 10.2.3.154/32 scope global eth*,没有竞争
master tail -f /var/log/messages 信息:
Nov 30 19:48:21 localhost Keepalived_vrrp: Remote SMTP server [127.0.0.1:25] connected.
Nov 30 19:48:21 localhost Keepalived_vrrp: Error processing RCPT cmd on SMTP server [127.0.0.1:25]. SMTP status code = 550
Nov 30 19:48:21 localhost Keepalived_vrrp: Can not read data from remote SMTP server [127.0.0.1:25].
Nov 30 19:48:31 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth4 for 10.2.3.154
Nov 30 19:50:11 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Received lower prio advert, forcing new election
Nov 30 19:50:11 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth4 for 10.2.3.154
Nov 30 19:50:12 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Received lower prio advert, forcing new election
back信息为:
Nov 30 11:41:17 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE
Nov 30 11:41:18 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE
Nov 30 11:41:18 localhost Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.
Nov 30 11:41:18 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.2.3.154
Nov 30 11:41:18 localhost avahi-daemon[971]: Registering new address record for 10.2.3.154 on eth0.IPv4.
Nov 30 11:41:18 localhost Keepalived_healthcheckers: Netlink reflector reports IP 10.2.3.154 added
Nov 30 11:41:18 localhost Keepalived_vrrp: Remote SMTP server [127.0.0.1:25] connected.
Nov 30 11:41:18 localhost Keepalived_vrrp: Error processing RCPT cmd on SMTP server [127.0.0.1:25]. SMTP status code = 550
Nov 30 11:41:18 localhost Keepalived_vrrp: Can not read data from remote SMTP server [127.0.0.1:25].
Nov 30 11:41:28 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.2.3.154
为什么会出现master发送arp但是backup收不到呢,二者不竞争。
tcpdump backup 信息为:
11:32:10.254780 ARP, Request who-has 10.2.3.154 (Broadcast) tell 10.2.3.154, length 46
11:32:10.254929 ARP, Request who-has 10.2.3.154 (Broadcast) tell 10.2.3.154, length 46
11:32:10.254997 ARP, Request who-has 10.2.3.154 (Broadcast) tell 10.2.3.154, length 46
11:32:10.255100 ARP, Request who-has 10.2.3.154 (Broadcast) tell 10.2.3.154, length 46
受到了,但是没有回啊 |
|