keepalived对lftp的控制

在vm1上
/etc/init.d/ldirectord stop
chkconfig ldirectord off
cd /etc/keepalived/
vim keepalived.conf

55 virtual_server 172.25.22.100 21 {
 56     delay_loop 6
 57     lb_algo rr
 58     lb_kind DR
 59     persistence_timeout 50
 60     protocol TCP
 61 
 62     real_server 172.25.22.2 21 {
 63         weight 1
 64         TCP_CHECK {
 65             connect_timeout 3
 66             nb_get_retry 3
 67             delay_before_retry 3
 68         }
 69     }
 70     real_server 172.25.22.3 21 {
 71         weight 1
 72         TCP_CHECK {
 73             connect_timeout 3
 74             nb_get_retry 3
 75             delay_before_retry 3
 76         }
 77     }
 78 }

/etc/init.d/keepalived reload
如果出现这种问题,就是刚更改的配置文件的括号问题
[root@server1 keepalived]# ipvsadm -l
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.22.100:http rr persistent 50
-> server2:ftp Route 1 0 0
-> server2:http Route 1 0 0
-> server3:ftp Route 1 0 0
-> server3:http Route 1 0 0
修改后/etc/init.d/keepalived reload
[root@server1 keepalived]# ipvsadm -l
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.22.100:ftp rr persistent 50
-> server2:ftp Route 1 0 0
-> server3:ftp Route 1 0 0
TCP 172.25.22.100:http rr
-> server2:http Route 1 0 0
-> server3:http Route 1 0 0
scp keepalived.conf server4:/etc/keepalived
在vm4
/etc/init.d/ldirectord stop
chkconfig ldirectord off
/etc/init.d/ldirectord start

在vm2
ip addr add 172.25.22.100/32 dev eth0
/etc/init.d/arptables_jf start
yum insatll vsftpd -y
/etc/init.d/vsft
pd start
cd /var/ftp/pub
touch server2

vm3上执行和vm2相同的动作
touch server3

测试
[root@foundation22 Desktop]# lftp 172.25.22.100
lftp 172.25.22.100:~> ls
drwxr-xr-x 2 0 0 4096 Feb 12 2013 pub
-rw-r–r– 1 0 0 0 Jul 27 01:59 server3
lftp 172.25.22.100:/> quit

你可能感兴趣的:(企业部分)