关于ipvsadm 弄了两天了
我的是centos4 的
ipvsadm是 v1.24
我在局域网里作转发
下面是我的lvs_nat.conf
LVSCONF_FORMAT=1.1
LVS_TYPE=VS_NAT
INITIAL_STATE=on
CLEAR_IPVS_TABLES=yes
#
#VIP line format - device[:alias] IP netmask broadcast
#To help avoid namespace collisions with other VIPs, I set alias=last number of VIP (here 110).
VIP=eth3:110 192.168.1.97 255.255.255.0 192.168.1.255
#
#DIP line format - device[:alias] IP network netmask broadcast
DIP=eth3 192.168.1.4 192.168.1.0 255.255.255.0 192.168.1.255
#
#DIRECTOR_GW - packets with src_addr=VIP, dst_addr=0/0 are sent to DIRECTOR_GW
#to be forwarded to the outside world.
#The script will not neccesarily set up the DIRECTOR_GW as the director's default gw.
DIRECTOR_GW=192.168.1.1
#
#SERVICE line format - proto port scheduler IP:port[,weight] [IP:port[,weight]]
#SERVICE=t ftp rr RS1:ftp,1 RS2:ftp,2
SERVICE=t telnet rr 192.168.1.24:telnet
SERVICE=t http rr 192.168.1.24:http
SERVICE=t http rr 192.168.1.99:http
#
SERVER_NET_DEVICE=eth3
#VS-NAT real-servers do not have a VIP, i.e. there is no SERVER_VIP_DEVICE
#SERVER_VIP_DEVICE=
#SERVER_GW is not user configurable with VS-NAT. script sets SERVER_GW = DIP
ip_forward也作了
网络图是这样的 ________
# | |
# | client |
# |________|
# | CIP=eth0 192.168.1.*
# |
# |
# | __________
# | | |
# |------| director |
# | |__________|
# | VIP=eth0:110 192.168.1.97/32
# | DIP=eth0:9 192.168.1.4
# |
# |
# |
# -------------------
# | |
# | |
# RIP1=eth0 RIP2=eth0
# 192.168.1.99 192.168.1.24
# ______________ ______________
# | | | |
# | realserver1 | | realserver2 |
# |______________| |______________|
#
192.168.1.97可以ping通
这是我的ipvsadm table
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.97:http rr
-> 192.168.1.24:http Route 100 0 1
-> 192.168.1.99:http Route 100 0 1
显示已经作了转发可就是连不上。
我两台realserver的网关都是192.168.1.4
高手帮忙!!!!!!!!!!!
还有我是不是必须装heartbeat 和Ldirector才能用。