`
emcome
  • 浏览: 296505 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

vmware workstation piranha ipvsadm TUN模式配置(未成功)

阅读更多

piranha ipvsadm 配置(未成功)

 

一.环境:

vmware workstation 7.0 RC

所有系统关闭iptables,禁用selinux

Server1.test.info(rhel5.4)

eth0:10.10.10.11/24(桥接到真实机网卡)

gateway:10.10.10.1


eth1:192.168.189.10/24 (host-only vmnet1)


Server2.test.info(rhel5.4)

eth0: 192.168.189.20/24 (host-only vmnet1)


Server3.test.info(rhel5.4)

eth0: 192.168.189.30/24 (host-only vmnet1)


 

 

二.配置:

Server1.test.info:

使用yum 安装以下包:  piranha,ipvsadm

启用转发:

vim /etc/sysctl.conf
将net.ipv4.ip_forward = 0 改为
net.ipv4.ip_forward = 1

保存退出..

执行:sysctl -p 立即生效

 

配置piranha

piranha-passwd 设置piranha密码

/etc/init.d/piranha-passwd start

 此时可以用http://10.10.10.11:3636 来访问piranha WEB配置界面.

 

也可以直接修改文件/etc/sysconfig/ha/lvs.cf

[root@server1 ~]# cat /etc/sysconfig/ha/lvs.cf
serial_no = 54
primary = 10.10.10.11
primary_private = 192.168.189.10
service = lvs
backup_active = 0
backup = 0.0.0.0
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = tunnel
debug_level = NONE
virtual server.test.info {
active = 1
address = 10.10.10.111 tunl0
vip_nmask = 255.255.255.255
port = 80
persistent = 600
send = "GET / HTTP/1.0\r\n\r\n"
expect = "HTTP"
use_regex = 0
load_monitor = none
scheduler = wlc
protocol = tcp
timeout = 6
reentry = 15
quiesce_server = 0
server server2.test.info {
address = 192.168.189.20
active = 1
port = 80
weight = 1
}
server server3.test.info {
address = 192.168.189.30
active = 1
port = 80
weight = 1
}
}

 

#/etc/init.d/piranha-gui restart

#/etc/init.d/pulse restart

#/etc/init.d/ipvsadm save

#/etc/init.d/ipvsadm start

 

 

Server2.test.info 配置;

cd /root
[root@server2 ~]# cat lvsRealServer.sh
#!/bin/bash
#Description : RealServer Start!
#Write by:iStone
#Last Modefiy:2007.12.15
VIP=10.10.10.111
/sbin/ifconfig tunl0 $VIP netmask 255.255.255.255 broadcast $VIP
/sbin/route add -host $VIP dev tunl0
echo "1" >/proc/sys/net/ipv4/conf/tunl0/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/tunl0/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce聽
sysctl -p
#end

#echo "/root/lvsRealServer.sh" >> /etc/rc.d/rc.local

 #reboot

 

Server3.test.info 与Server2.test.info 同样配置...

 

 

Server1.test.info

[root@server1 ~]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.10.10.111:http wlc persistent 600
  -> 192.168.189.30:http          Tunnel  1      0          0
  -> 192.168.189.20:http          Tunnel  1      0          0

 

如果没有显示.把三台机子都重启一下.看看server2和server3的httpd服务有没有启动..

 

应该说是到了这里就可以成功了,用10.10.10.0/24段网络都能访问10.10.10.111了.但是我这里死活不成功..

 

 

不知道有没有 高人能帮我解答一下!!!

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics