请教如何在redhat as3中使用LVS
我有两台redhat as3,打算一部用来做directory(网卡ip是17.24.18.21),一部做realserver(172.24.18.22),VIP是172.24.18.23,根据资料说rhas3不用打补丁,所以我就把这一步省了,大家帮我看看我的操作有没有错:
directory:
修改内核运行参数,即修改/etc/sysctl.conf文件的内容如下:
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.eth0.send_redirects = 1
然后执行下面的命令是对内核修改的参数立即生效:
sysctl -p
配置VIP地址:
/sbin/ifconfig eth0:0 172.24.18.23 broadcast 172.24.18.23 netmask 255.255.255.255 up
/sbin/route add -host 172.24.18.23 dev eth0:0
清除ipvsadm表:
/sbin/ipvsadm -C
使用ipvsadm安装LVS服务:
/sbin/ipvsadm -A -t 172.24.18.23:http -s rr
增加realserver:
#forward http to realserver using direct routing with weight 1
/sbin/ipvsadm -a -t 172.24.18.23:http -r 172.24.18.22 -g -w 1
realserver:
修改内核运行参数,即修改/etc/sysctl.conf文件的内容如下:
net.ipv4.ip_forward = 0
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
然后执行下面的命令是对内核修改的参数立即生效:
sysctl -p
配置VIP地址:
/sbin/ifconfig lo:0 172.24.18.23 broadcast 172.24.18.23 netmask 255.255.255.255 up
/sbin/route add -host 172.24.18.23 dev lo:0
用浏览器输入http://172.24.18.23,连续访问多次,出现的都是directory(172.24.18.21)的内容,在directory中用/sbin/ipvsadm 来看,如下:
IP Virtual Server version 1.2.1 (size=65536)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.24.18.23:http rr
-> 172.24.18.22:http Route 1 0 0
ipvsadm没有起作用,请问各位我的做法是不是漏掉了什么?
Anonymous (没有被验证)
周二, 2007-05-15 01:30
Permalink
我也遇到类似问题!楼主解决了没有啊?解决了说一下详细解决办法?
RT
heijieweb
周五, 2007-07-06 03:52
Permalink
你确认AS3中有这些参
你确认AS3中有这些参数,先到/proc/sys/net/ipv4/conf/eth0 下看一下
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
Anonymous (没有被验证)
周六, 2007-07-14 23:21
Permalink
lvs service 有启动吗?
lvs service 有启动吗?
Anonymous (没有被验证)
周三, 2014-03-05 12:59
Permalink
OOyzqCCnkQEenXdhz
A simple and ingtelilent point, well made. Thanks!
Anonymous (没有被验证)
周六, 2014-12-20 01:41
Permalink
LZshtRVuOmPKGH
Reading posts like this make surfing such a plearuse
Anonymous (没有被验证)
周三, 2014-03-05 19:51
Permalink
NSPiIgldgYIB
I never thought I would find such an everyday topic so enrnlatlihg!
Anonymous (没有被验证)
周二, 2014-05-13 12:53
Permalink
FtKaLnOvLFQSFiIn
lowest car insurance car insurance quotes pa inexpensive car insurance in new york state viagra
Anonymous (没有被验证)
周日, 2014-06-01 04:10
Permalink
XuKFUuwvOIgxnSUodFkR
quotes car insurance college essay writing research papers florida car insurance