linux virtual server - lvs

  • 등록 2017.07.12 11:47:33
크게보기

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  → 웹모드

노랑배 kosthb@gmail.com
Copyright @2011 mediaon Corp. All rights reserved.

사이트에 관련하여 연락은 메일로 주세요. kosthb골뱅이gmail.com Copyright 2011 mediaon. All rights reserved.