Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103632529
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-05-02 09:00:02

                   Blance ---LVS DR 

     1.Configuration Environment

          system version:redhat v4u5

  VIP:10.148.55.45

  test1:10.148.55.43

  test2:10.148.55.44

  rpm:ipvsadm-1.24-6

       piranha-0.8.2-1

 

2.Install RPM Packages

   test1#rpm -ivh  ipvsadm-1.24-6.rpm

                   piranha-0.8.2-1.rpm

 

   test2#rpm -ivh  ipvsadm-1.24-6.rpm

                   piranha-0.8.2-1.rpm

 

3.Start piranha service

   test1#service piranha-gui start

   test1#piranha-gui passwd

 

4.Open web for configuration

  

Generate following:

/etc/sysconfig/ha/lvs.cf

serial_no = 25
primary = 10.148.55.43

service = lvs
backup_active = 1
backup = 10.148.55.44

heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
debug_level = NONE
monitor_links = 0
virtual FHJLVS {
     active = 1
     address = 10.148.55.45  eth0:1
     vip_nmask = 255.255.252.0
     port = 23
     use_regex = 0
     load_monitor = ruptime
     scheduler = wlc
     protocol = tcp
     timeout = 6

             reentry = 15
  quiesce_server = 1
  server AP1 {
         address = 10.148.55.43
         active = 1
         weight = 1
  }
  server AP2 {
         address = 10.148.55.44
         active = 1
         weight = 1
  }
 }

   

 5. Start service pulse

test1#service pulse start

 

 6.   Confirm ipvs table

        test1# ipvsadm

        IP Virtual Server version 1.2.1 (size=4096)

Prot LocalAddress:Port Scheduler Flags

-> RemoteAddress:Port           Forward Weight ActiveConn InActConn

TCP  oratesta:telnet wlc

              -> test1:telnet              Local   1      0          0

              -> test2:telnet              Route   1      0          0

 

      7.Ignore arp respondence 

  echo “1” >/proc/sys/net/ipv4/conf/lo/arp_ignore

  echo “1” >/proc/sys/net/ipv4/conf/all/arp_ignore

  echo “1” >/proc/sys/net/ipv4/conf/default/arp_ignore

  echo “2” >/proc/sys/net/ipv4/conf/lo/arp_announce

  echo “2” >/proc/sys/net/ipv4/conf/all/arp_announce

  echo “2” >/proc/sys/net/ipv4/conf/default/arp_announce

 

8.rs2#ifconfig lo:1 10.150.4.245 netmask 255.255.255.255

      broadcast  10.150.4.245 up

 rs2#route add –host 10.150.4.245 dev lo

 

9.Test 
  Try to connect VIP and  you will see what you want.

 

10.Set Lvs backup

   test2:#scp test1:/etc/syconfig/ha/lvs.cf  /etc/sysconfig/ha

   test2:#service pulse start

 

11.Test backup function

   test1#service pulse stop

 

12.You will see following:

  test2# ipvsadm

        IP Virtual Server version 1.2.1 (size=4096)

Prot LocalAddress:Port Scheduler Flags

-> RemoteAddress:Port           Forward Weight ActiveConn InActConn

TCP  oratesta:telnet wlc

              -> test1:telnet              Local   1      0          0

                 -> test2:telnet              Route   1      0          0

 

 

原文:http://www.linuxdiyf.com/blog/?110920/action_viewspace_itemid_2892.html

阅读(320) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~