• -동두천 6.6℃
  • -강릉 19.4℃
  • 박무서울 10.0℃
  • 박무대전 11.1℃
  • 맑음대구 16.2℃
  • 맑음울산 17.7℃
  • 박무광주 10.1℃
  • 맑음부산 17.9℃
  • -고창 9.1℃
  • 연무제주 15.2℃
  • -강화 4.6℃
  • -보은 13.0℃
  • -금산 10.1℃
  • -강진군 10.6℃
  • -경주시 17.2℃
  • -거제 17.3℃
기상청 제공

linux virtual server - lvs

active, stanby 구분


[root@~]# pstree

 ├─pulse───lvsd───2*[nanny]          // active

   


[root@~]# pstree

 ├─pulse                                                // stanby





<LVS1>


eth0    123.45.123.20

eth0:1  123.45.123.59



[root@~]# ipvsadm -L                                          // 현재 로드밸런싱 되고 있는 리스트

IP Virtual Server version 1.2.1 (size=4096)

Prot LocalAddress:Port Scheduler Flags

    -> RemoteAddress:Port           Forward Weight ActiveConn InActConn

TCP  123.45.123.59:http  wlc persistent 1800                                 // 59 VIP →  75 VIP

    -> 123.45.123.75:http               Route   1      131        20                          →  77 VIp

    -> 123.45.123.77:http               Route   3      207        229




root@dbkn-lvs1:~# vi /etc/sysconfig/ha/lvs.cf


serial_no = 14

primary = 123.45.123.20

service = lvs

backup_active = 1

backup = 123.45.123.21

heartbeat = 1

heartbeat_port = 539

keepalive = 6

deadtime = 18

network = direct

debug_level = NONE

monitor_links = 0

syncdaemon = 0

virtual hellosisa_http {

     active = 1

     address = 123.45.123.59 eth0:1

     vip_nmask = 255.255.255.128

     port = 80

     persistent = 1800

     pmask = 255.255.255.255

     send = "GET / HTTP/1.0rnrn"

     expect = "HTTP"

     use_regex = 0

     load_monitor = none

     scheduler = wlc

     protocol = tcp

     timeout = 5

     reentry = 5

     quiesce_server = 0

     server hellosisa_web1 {

         address = 123.45.123.77

         active = 1

         port = 80

         weight = 3

     }

     server hellosisa_web2 {

         address = 123.45.123.75

         active = 1

         port = 80

         weight = 1

     }

}





<LVS2>


eth0   123.45.123.21



[root@~]# ipvsadm -L

IP Virtual Server version 1.2.1 (size=4096)

Prot LocalAddress:Port Scheduler Flags

  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn



LVS1과 /etc/sysconfig/ha/lvs.cf 동일





123.45.123.20:port  → 웹모드