LVS + piranha 之NAT配置

[不指定 2008/09/14 11:02 | by askwan ]
OS  :    centos4.6
VIP :       192.168.18.240
LoadBalance:  eth0: 192.168.18.241
             eth1: 10.10.10.241            
BackUp:      eth0:   192.168.18.242
             eth1:   10.10.10.242

Real Server1:  10.10.10.243
RealServer2:    10.10.10.244
Gateway    :   10.10.10.241(10.10.10.242)

1.  安装piranha和ipvsadm
2.  设置piranha密码
piranha-passwd
3.  启动piranha-gui
service piranha-gui start
4.  配置LVS
http://192.168.18.241:3636

具体配置过程不详述
附上配置文件
vim /etc/sysconfig/ha/lvs.cf

serial_no = 14
primary = 192.168.18.241
service = lvs
backup_active = 1
backup = 192.168.18.242
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = nat
nat_router = 10.10.10.241 eth1
nat_nmask = 255.255.255.0
debug_level = NONE
monitor_links = 0
virtual webserv {
     active = 1
     address = 192.168.18.240 eth0:1
     vip_nmask = 255.255.255.0
     port = 80
     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 node1 {
         address = 10.10.10.243
         active = 1
         weight = 50
     }
     server node2 {
         address = 10.10.10.244
         active = 1
         weight = 50
     }
}
5.  将配置文件copy至Backup相应目录下
6.  分别在LB和BackUp上启用数据转发
# vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
#sysctl  -p

7.  启动RealServer上httpd服务
8.  启动LB和Backup上pulse
Quotation
#service pulse start

9.  测试

作者:askwan@『AskWan』
地址:http://www.askwan.com/post/106/
可以转载,转载时请以链接形式注明作者和原始出处及本声明!

Tags: , ,
Architecture & HA | Comments(0) | Trackbacks(0) | Reads(1566)
收藏到网摘:百度搜藏 Google书签 Yahoo收藏 新浪ViVi收藏夹 365天天网摘 天极网摘 我摘·网摘·网络书签 POCO网摘 和讯网摘 Bolaa博拉博客收录中心 天下图摘
Add a comment
Emots
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
Enable HTML
Enable UBB
Enable Emots
Hidden
Remember
Nickname   Password   Optional
Site URI   Email   [Register]