找回密码
 注册
楼主: lues

ipvs的问题

[复制链接]
发表于 2004-11-2 19:42:13 | 显示全部楼层
刚才登录你的机器看了一下, LVS 已经正常的不得了了 :-)
不过只有三台机器吗? 那 HA 是谁跟谁呀?
你的LVS是这样的:[code:1]             |
           test7
            /\
           /  \
          /    \

       test3  test9[/code:1]
做 HA 的话应该是[code:1]          |
          |
      HA1-|- HA2     <-- HA1 和 HA2 用心跳互相监视,决定谁启用 ipvsadm。
          |
         /\
        /  \
       /    \
    real1  real2

[/code:1]
回复

使用道具 举报

 楼主| 发表于 2004-11-2 21:09:01 | 显示全部楼层
呵呵,我的HA是test7和test9,不过test9现在是REAL SERVER,他的HA服务让我停了,我还有一台test11,但是那台机器一用ipvsadm就死机,那台test11全是scsi设备,而我编译2.6的scsi问题还没有解决,所以test11也就不能作为real server了,现在HA和LVS就只能单独测试了,今天ldirectord已经能够监测80端口的http服务了,明天我再试试8080端口的tomcat  ldirectord能否监测
回复

使用道具 举报

发表于 2004-11-2 21:31:34 | 显示全部楼层
哦。要注意的是 HA1 与 HA2 的 haresources 配置要完全一致。
回复

使用道具 举报

 楼主| 发表于 2004-11-3 16:10:15 | 显示全部楼层
:-) 在可爱的dannycat热诚帮助下 ,我群集的http服务终于ok了 ,现在我感觉有个现象我不是很理解,我的ipvsadm如下

[code:1][root@test7 root]# service ipvsadm status
IP Virtual Server version 1.0.8 (size=65536)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  210.75.11.37:80 wlc
  -> 210.75.11.34:80              Route   1      0          0         
  -> 210.75.11.36:80              Route   0      0          0         
TCP  210.75.11.37:8080 wlc
  -> 210.75.11.34:8080            Route   1      0          0         
  -> 210.75.11.36:8080            Route   1      0          0   [/code:1]


我现在36的80 down了,然后我访问群集的8080的时候,95%的访问量都指向36了,34的访问量只有可怜的5%,这个是不是wlc算法的原因?
回复

使用道具 举报

 楼主| 发表于 2004-11-3 16:11:17 | 显示全部楼层
:-) 在可爱的dannycat热诚帮助下 ,我群集的http服务终于ok了 ,现在我感觉有个现象我不是很理解,我的ipvsadm如下

[root@test7 root]# service ipvsadm status
IP Virtual Server version 1.0.8 (size=65536)
Prot LocalAddressort Scheduler Flags
  -> RemoteAddressort           Forward Weight ActiveConn InActConn
TCP  210.75.11.37:80 wlc
  -> 210.75.11.34:80              Route   1      0          0         
  -> 210.75.11.36:80              Route   0      0          0         
TCP  210.75.11.37:8080 wlc
  -> 210.75.11.34:8080            Route   1      0          0         
  -> 210.75.11.36:8080            Route   1      0          0   


我现在36的80 down了,然后我访问群集的8080的时候,95%的访问量都指向36了,34的访问量只有可怜的5%,这个是不是wlc算法的原因?
:neutral:
回复

使用道具 举报

 楼主| 发表于 2004-11-4 11:08:15 | 显示全部楼层
dannycat,现在http群集搞定了,但是我的目的是做游戏群集,而不是http群集,我们的游戏有2个端口,一个是用tcp连接(80),一个是用http连接(81),我看ldirectord监控http服务好像是通过
[code:1]     request=".testpage"
        receive="Test Page"[/code:1]来确定http服务是否已经死亡
那我要监控我们的游戏服务(主要是tcp端口连接),我的ldirectord.cf该怎么写呀

我的http监控的ldirectord.cf文本如下
[code:1]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=210.75.11.37:80
        real=210.75.11.34:80 gate
        real=210.75.11.36:80 gate
#       real=210.75.11.6:80 gate
        fallback=127.0.0.1:80 gate
        service=http
#       request="index.html"
        request=".testpage"
        receive="Test Page"
#       virtualhost=some.domain.com.au
        scheduler=wlc
        #persistent=600
        #netmask=255.255.255.255
        protocol=tcp[/code:1]

罗嗦了这么多 ,我就是想知道只通过tcp协议连接的服务ldirectord该怎么设置才能监控
回复

使用道具 举报

发表于 2004-11-4 12:32:26 | 显示全部楼层
[quote:686529f56d="lues"]我现在36的80 down了,然后我访问群集的8080的时候,95%的访问量都指向36了,34的访问量只有可怜的5%,这个是不是wlc算法的原因? [/quote]不是。想了半天,最大的可能是 34 的响应太慢

[quote:686529f56d="lues"]罗嗦了这么多 ,我就是想知道只通过tcp协议连接的服务ldirectord该怎么设置才能监控[/quote]

:neutral:  完了,产生依赖性了~~~

看 ldirectord 的文档呀?!

[quote:686529f56d="ldirectord -h"]       checktype = negotiate|connect|N|off|on

       Type of check to perform. Negotiate sends a request and matches a
       receive string. Connect only attemts to make a TCP/IP connection, thus
       the the request and receive strings may be omitted.  If checktype is a
       number then negotiate and connect is combined so that after each N con-
       nect attempts one negotiate attempt is performed. This is useful to
       check often if a service answers and in much longer intervalls a nego-
       tiating check is done.  Off means no checking will take place and no
       real or fallback servers will be activated. Default is negotiate.
[/quote]
回复

使用道具 举报

 楼主| 发表于 2004-11-4 13:11:15 | 显示全部楼层
:-(  :neutral:    
回复

使用道具 举报

发表于 2004-11-4 13:18:48 | 显示全部楼层
[code:1]checktimeout=3
checkinterval=1
autoreload=yes
quiescent=yes

virtual=210.75.11.37:80
        real=210.75.11.34:80 gate
        real=210.75.11.36:80 gate
        fallback=127.0.0.1:80 gate
        scheduler=wlc
        checktype = connect
        protocol=tcp
[/code:1]
这样就行了,ldirectord 就只会用“能否建立到 80 端口的 TCP 连接” 来判断 node 是否死亡。
回复

使用道具 举报

 楼主| 发表于 2004-11-4 13:44:17 | 显示全部楼层
,现在公司还没有要求马上上群集,所以暂时也不会支持我测试。。。(我们测试都是通过手机上网测的,费用很大),等到公司确定方案测试了,再向你讨教
而且我心爱的服务器要换成windows了。。。。 可惜可惜。。。


我现在想说的就是:多谢上天让我在网络中遇到了你 ,像你这样热忱的人,会永远幸福

下午去看HP磁带机的价格了
回复

使用道具 举报

 楼主| 发表于 2004-11-4 16:53:21 | 显示全部楼层
没有手机就想了个办法,我停止启用服务器然后观察log状态,发现监控正常
回复

使用道具 举报

 楼主| 发表于 2004-11-4 17:05:51 | 显示全部楼层
[quote:805a93279c="dannycat"][quote:805a93279c="lues"]我现在36的80 down了,然后我访问群集的8080的时候,95%的访问量都指向36了,34的访问量只有可怜的5%,这个是不是wlc算法的原因? [/quote]不是。想了半天,最大的可能是 34 的响应太慢 [/quote]

我又观察了一下,这个原因不一定是34太慢,现在36的80是个游戏,但也可以用浏览器访问,不过浏览器访问时提示404,34的80是apache,开始访问80指向36的还有40%,在没有作任何修改的情况下重启机器以后现在访问80端口的95%指向了34,访问8080的情况不变,95%指向了36
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-25 04:06 , Processed in 0.061331 second(s), 12 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表