LVS ipvsadm+heartbeat+ldirecrtord(nat示例)


[root@gw-wt-1 ha.d]#   /etc/ha.d/  ldirectord.cf

# Sample ldirectord configuration file to configure various virtual services.
#
# Ldirectord will connect to each real server once per second and request
# /index.html. If the data returned by the server does not contain the
# string "Test Message" then the test fails and the real server will be
# taken out of the available pool. The real server will be added back into
# the pool once the test succeeds. If all real servers are removed from the
# pool then localhost:80 is added to the pool as a fallback measure.

# Global Directives
checktimeout=5
checkinterval=5
#fallback=127.0.0.1:80
autoreload=yes
fork = no
logfile="/var/log/ldirectord.log"
logfile="local0"
#emailalert="admin@x.y.z"
#emailalertfreq=3600
#emailalertstatus=all
quiescent=yes


# configure for hq 8601 earthnet route
# and a single real server for a virtual service
virtual=120.193.10.101:8601
#virtual=1
        real=192.168.3.107:8601 gate 5
        real=192.168.3.106:8601 masq 5
#       real=192.168.3.112:8601 masq 5
        real=192.168.3.104:8601 gate 5
#       fallback=127.0.0.1:80 gate
        service=none
        scheduler=wlc
#       persistent=2
        netmask=255.255.255.255
        protocol=tcp
#       protocol=fwm
        checktype=connect
#       checkport=8601
#       request="index.html"
#       receive="Test Page"
#       virtualhost=x.y.z

# configure for hq 8602 earthnet route
# and a single real server for a virtual service
virtual=120.193.10.101:8602
#        real=192.168.3.104:8602 gate 5
        real=192.168.3.19:8602 masq 5
        real=192.168.3.18:8602 masq 5
#       fallback=127.0.0.1:80 gate
        service=none
        scheduler=wlc
#       persistent=2
        netmask=255.255.255.255
        protocol=tcp
#       protocol=fwm
        checktype=connect
#       checkport=8601
#       request="index.html"
#       receive="Test Page"
#       virtualhost=x.y.z

# configure for hq 8601 earthnet route
# and a single real server for a virtual service
virtual=192.168.3.200:8601
        real=192.168.3.107:8601 gate 5
        real=192.168.3.106:8601 gate 5
#       real=192.168.3.112:8601 gate  5
        real=192.168.3.104:8601 gate 5
#       fallback=127.0.0.1:80 gate
        service=none
        scheduler=wlc
#       persistent=2
        netmask=255.255.255.255
        protocol=tcp
#       protocol=fwm
        checktype=connect
#       checkport=8601
#       request="index.html"
#       receive="Test Page"
#       virtualhost=x.y.z


# configure for hq 8602 earthnet route
# and a single real server for a virtual service
virtual=192.168.3.200:8602
 #       real=192.168.3.104:8602 gate 5
        real=192.168.3.18:8602 gate 5
        real=192.168.3.19:8602 gate 5
#       fallback=127.0.0.1:80 gate
        service=none
        scheduler=wlc
#       persistent=2
        netmask=255.255.255.255
        protocol=tcp
#       protocol=fwm
        checktype=connect
#       checkport=8601
#       request="index.html"
#       receive="Test Page"
#       virtualhost=x.y.z

[root@gw-wt-1 ha.d]cat  /etc/ha.d/haresources
gw-wt-2 IPaddr2::192.168.3.40/24/eth1
gw-wt-1 \
IPaddr2::192.168.3.200/24/eth1  \
IPaddr2::120.193.10.101/24/eth0 \
ldirectord::ldirectord.cf  LVSSyncDaemonSwap::master

[root@gw-wt-1 ha.d]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.3.200:8602 wlc
  -> 192.168.3.19:8602            Route   5      356        0         
  -> 192.168.3.18:8602            Route   5      2380       0         
TCP  192.168.3.200:8601 wlc
  -> 192.168.3.107:8601           Route   5      845        0         
  -> 192.168.3.104:8601           Route   5      844        0         
  -> 192.168.3.106:8601           Route   5      844        0         
TCP  120.193.10.101:8602 wlc
  -> 192.168.3.18:8602            Masq    5      324        0         
  -> 192.168.3.19:8602            Masq    5      131        1         
TCP  120.193.10.101:8601 wlc
  -> 192.168.3.104:8601           Route   5      1427       0         
  -> 192.168.3.106:8601           Masq    5      1427       1         
  -> 192.168.3.107:8601           Route   5      1427       0    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值