求助该问题解决没,我的也出现相同问题,只是在ipvsadm -ln 命令下这两项都是0,其他一切正常,不知道是什么原因。
操作系统版本:
[root@M1 /home] uname -a
Linux M1 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@M1 /home] cat /etc/redhat-release
CentOS release 6.4 (Final)
软件版本:
keepalived-1.2.9.tar.gz
ipvsadm-1.26.tar.gz
出现的问题:
[root@M1 /home] ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.10.54.12:80 rr persistent 5
-> 10.10.54.17:3306 Route 1 0 0
-> 10.10.54.18:3306 Route 1 0 0
keepalived运行状况:
[root@M1 /home] ps -ef|grep keep
root 27822 1 0 19:22 ? 00:00:00 keepalived -D
root 27824 27822 0 19:22 ? 00:00:00 keepalived -D
root 27825 27822 0 19:22 ? 00:00:00 keepalived -D
root 27874 1360 0 19:42 pts/0 00:00:00 grep keep
realserver 上运行的是MySQL的主从复制,端口已经打开,主从复制运行良好。
在direct server上 查看日志 cat /var/log/messages|grep error 无任何内容
日志内容:
[root@M1 /home] tail -f /var/log/messages
Apr 14 19:48:49 M1 Keepalived_vrrp[27890]: Using LinkWatch kernel netlink reflector...
Apr 14 19:48:49 M1 Keepalived_vrrp[27890]: VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(10,11)]
Apr 14 19:48:49 M1 Keepalived_healthcheckers[27889]: Activating healthchecker for service [10.10.54.17]:3306
Apr 14 19:48:49 M1 Keepalived_healthcheckers[27889]: Activating healthchecker for service [10.10.54.18]:3306
Apr 14 19:48:50 M1 Keepalived_vrrp[27890]: VRRP_Instance(VI_1) Transition to MASTER STATE
Apr 14 19:48:51 M1 Keepalived_vrrp[27890]: VRRP_Instance(VI_1) Entering MASTER STATE
Apr 14 19:48:51 M1 Keepalived_vrrp[27890]: VRRP_Instance(VI_1) setting protocol VIPs.
Apr 14 19:48:51 M1 Keepalived_vrrp[27890]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.10.54.12
Apr 14 19:48:51 M1 Keepalived_healthcheckers[27889]: Netlink reflector reports IP 10.10.54.12 added
Apr 14 19:48:56 M1 Keepalived_vrrp[27890]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.10.54.12
下面是配置文件,不知道问题是不是出在这个上面:
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 3
router_id LVS_MASTER
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 241
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.10.54.12/32 dev eth0 label eth0:1
}
}
virtual_server 10.10.54.12 3306 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 5
protocol TCP
real_server 10.10.54.17 3306 {
weight 1
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 3306
}
}
real_server 10.10.54.18 3306 {
weight 1
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 3306
}
}
}
求高手帮忙找找错误!