免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2620 | 回复: 2
打印 上一主题 下一主题

请教lvs问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-17 14:09 |只看该作者 |倒序浏览
您好,我安装lvs之后,恩,按照作者:FunBSD 的LVS集群技术一文安装的,但始终打开网页失败,想求教于大家,我始终找不出原因,具体设置如下:
Virtual IP: 192.168.3.137
Load Balancer: 192.168.3.138
Real Server 1: 192.168.3.133
Real Server 2: 192.168.3.124
使用ipvsadm结果如下:
  -> RemoteAddressort           Forward Weight ActiveConn InActConn
TCP  192.168.3.137:http rr
  -> localhost.localdomain:http   Local   1      0          0
  -> 192.168.4.213:http           Tunnel  0      0          0
  -> 192.168.3.133:http           Tunnel  0      0          0
  -> loadbalancer:http            Local   0      0          0
我在192。168。3。131上的ie中打开http://192.168.3.137时无法打开,此时使用ipvsadm -lvn结果为:
pro expire state       source             virtual            destination
TCP 00:57  SYN_RECV    192.168.3.131:1546 192.168.3.137:80   127.0.0.1:80
在192。168。3。133上使用 tcpdump port 80得到以下信息:
tcpdump: listening on eth0
14:38:15.195602 192.168.3.138.37379 > 192.168.3.133.http: S 3449117184:3449117184(0) win 5840 <mss 1460,sackOK,timestamp 816325 0,nop,wscale 0> (DF)
14:38:15.195661 192.168.3.133.http > 192.168.3.138.37379: S 2875333886:2875333886(0) ack 3449117185 win 5792 <mss 1460,sackOK,timestamp 325208 816325,nop,wscale 0> (DF)
14:38:15.196498 192.168.3.138.37379 > 192.168.3.133.http: . ack 1 win 5840 <nop,nop,timestamp 816325 325208> (DF)
14:38:15.211960 192.168.3.138.37379 > 192.168.3.133.http: P 1:103(102) ack 1 win 5840 <nop,nop,timestamp 816325 325208> (DF)
14:38:15.212042 192.168.3.133.http > 192.168.3.138.37379: . ack 103 win 5792 <nop,nop,timestamp 325210 816325> (DF)
14:38:15.212871 192.168.3.133.http > 192.168.3.138.37379: P 1:275(274) ack 103 win 5792 <nop,nop,timestamp 325210 816325> (DF)
14:38:15.213148 192.168.3.133.http > 192.168.3.138.37379: F 275:275(0) ack 103 win 5792 <nop,nop,timestamp 325210 816325> (DF)
14:38:15.214453 192.168.3.138.37379 > 192.168.3.133.http: . ack 275 win 6432 <nop,nop,timestamp 816327 325210> (DF)

期待大家的指点。
使用的是tunnle模式。

[ 本帖最后由 mov123 于 2006-4-17 14:37 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-04-17 15:35 |只看该作者
说一下配置,然后看看director上面的几个进程是否正确。lvsd ,nanny。

论坛徽章:
0
3 [报告]
发表于 2006-04-17 16:12 |只看该作者
谢谢您的回复,详细配置为:
[ldirectord.cf]
checktimeout=3
checkinterval=1
fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
#logfile="local0"
quiescent=yes

# A sample virual with a fallback that will override the gobal setting
virtual=192.168.3.137:80
        real=192.168.3.138:80 ipip
        real=192.168.3.124:80 ipip
        real=192.168.3.133:80 ipip
        fallback=127.0.0.1:80 gate
        service=http
        request="index.html"
        receive="Test Page"
        virtualhost=test1.gteling.com
        scheduler=rr
        #persistent=600
        #netmask=255.255.255.255
        protocol=tcp
[/etc/hosts]
127.0.0.1         localhost.localdomain localhost
192.168.3.137    loadbalancer
[/etc/sysconfig/ipvsadm]
-A -t 192.168.3.137:80 -s rr
-a -t 192.168.3.137:80 -r 192.168.3.138:80 -i
-a -t 192.168.3.137:80 -r 192.168.3.133:80 -i
-a -t 192.168.3.137:80 -r 192.168.3.124:80 -i
[/etc/init.d/tunl]arp补丁

VIP=192.168.3.137

. /etc/rc.d/init.d/functions

case "$1" in
    start)
        echo "Tunl port starting"
        ifconfig tunl0 $VIP netmask 255.255.255.255 broadcast $VIP up
        echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 1 > /proc/sys/net/ipv4/conf/all/hidden
        echo 1 > /proc/sys/net/ipv4/conf/tunl0/hidden
        ;;
    stop)
        echo "Tunl port closing"
        ifconfig tunl0 down
        echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 0 > /proc/sys/net/ipv4/conf/all/hidden
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP