[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-users:53132] LVSとkeepalivedで不可分散



 #help

 

$B$?$1$P$7MM!"AaB.$N2sEz$"$j$,$H$&$4$6$$$^$9!#(B

 $B!d(B (1) 123.123.123.33 $B$O$I$3$KIU$$$F$$$k(B IP $B%"%I%l%9$G$7$g$&$+(B

$B%j%"%k%5!<%P$K?^$G$O(B ROUTER-1 $B$K$D$$$F$$$k$h$&$K8+$($^$9$,!$(Bifconfig $B$N=PNO$O(B
 
$B%j%"%k%5!<%P$KIU$$$F$$$k$h$&$K8+$($^$9!%(B

 

$B$3$N;n83$K$"$?$j!":G=i$K;n$_$?%M%C%H%o!<%/$O!"(B

$B%@%$%J%_%C%/%"%I%l%9$rIUM?$9$k%W%m%P%$%@!<$N%W%i%$%Y!<%H%"%I%l%9$,(B192.168.1.2$B$+$i(B192.168.2.19$B$^$G$G$9$N$G!";n83MQ$N%M%C%H%o!<%/$O@EE*%"%I%l%9$r;H$$$=$l0J30$N%"%I%l%9$r;HMQ$7$^$7$?!#(B

$B%j%"%k%5!<%P$r!!!!(B192.168.1.21

$B%9%l!<%V%5!<%P$r!!(B192.168.1.22

Virtual$B%"%I%l%9$r(B 192.168.1.100

$B$H@_Dj$7$F;n$7$^$7$?!#;d$N%Q%=%3%s$K(B192.168.1.100$B$N2>A[(BIP$B$rF~NO$9$k$HLdBj$J$/IT2DJ,;6$5$l$^$7$?!#:!=h$G!";d$N%I%a%$%sL>$G$"$k(Bxxxxx.com$B$rF~NO$9$k$H%j%"%k%5!<%P$N(Bhtml$B$OH?1~$7$^$9$,!"%9%l!<%V$KIT2DJ,;6$O$5$l$^$;$s$G$7$?!#$3$NLdBj$OJL$H$7$F!">e5-$N9=@.$G$9$H30It$N(BPC$B$K%I%a%$%sL>$rF~NO$7$F$b%k!<%?$,%@%$%J%_%C%/%"%I%l%9$r;HMQ$7$F$$$k$?$a$K%&%(%V%5!<%P$K7R$,$i$J$$$3$H$K5$$,IU$-!"%k!<%?(B-1$B$K7R$,$k(Beth0$B$r(Bppp0$B$KJQ99$7$F!"%j%"%k%5!<%P$K(Bppp$B!"(Bpppoe$B$H(Bpppconf$B$N%Q%C%1!<%8$rF~$l$F%Q%V%j%C%/%"%I%l%9$rIUM?$7$F$/$l$k%W%m%P%$%@!<$K$D$J$.$^$7$?!#(B192.168.1.21$B$N%j%"%k!<%5!<%P$KD>@\7R$,$C$F$$$k$H2r

 

#ifconfig

eth0$B!!(B192.168.1.21

lo$B!!(B127.0.0.1

 

$B$G$7$?$,!"(Bppp0$B$KJQ99!JDI2C!)!K$7$?$?$a(B

 

#ifconfig

eth0$B!!(B192.168.1.21$B!!!NDI2C$N$?$a$K$=$N$^$^;D$C$?$h$&$G$9!#!O(B

lo$B!!(B127.0.0.1

ppp0$B!!(B123.123.123.33  

 

$B$H$J$j$^$7$?!#(B

   
$B!d(B    (2) $B2>A[(B IP $B%"%I%l%9$OB8:_$9$k$N$G$7$g$&$+(B   
        123.123.123.33
$B$r$=$N$^$^!$2>A[(B IP $B%"%I%l%9$H$7$F;HMQ$9$k$N$G$7$g$&$+!%(B
 

$B@_Dj$,;29M;qNA$+$i0dC&$7$?$h$&$G$9$,!";d$O(B192.168.1.100$B$r2>A[(BIP$B%"%I%l%9$H>!/etc/keepalived/keepalive.conf$B$N%9%/%j%W%H$O2<5-$NMM$K$J$C$F$$$^$9!#!J<+J,$G:n$j>e$2$?$b$N$G$J$/B>$N%9%l%C%I$+$i$N$7$?$D$b$j!#!K(B

 

vrrp_instance ETH0 {

  state MASTER

  interface eth0

 

lvs_sync_daemon_interface eth0

virtual_router_id 10

  priority 200

  garp_master_delay 2 

  advert_int 1

authentication {

    auth_type PASS

    auth_pass xxx

  }

  virtual_ipaddress {

    192.168.1.100/24

  }

 

  virtual_server 192.168.1.100 80 {

  delay_loop 3

  lb_algo rr

  lb_kind DR

  persistence_timeout 600

  protocol TCP

  virtualhost MyDomainName.com

 

  real_server 123.123.123.33 80 {  *$BA0$N@_Dj"*(B (192.168.1. 21 80)

    weight 100

    HTTP_GET {

         url {

         path /paache2-default/

         digest 0ec74341a24dd7888a78ef45e4eecce58

         }

    connect_timeout 3

    nb_ge_retry 3

    delay_before_retry 3

    }

}

  real_server 192.168.1 .22 80 {

      weight 100

    HTTP_GET {

         url {

         path /paache2-default/

         digest 0ec74341a24dd7888a78ef45e4eecce58

         }

    connect_timeout 3

    nb_ge_retry 3

    delay_before_retry 3

    }

 

    }

  }

 

$B!d(B  $B$H$3$m$G(B DSR $B9=@.$N>l9g!$$A$g$$$H$7$?:Y9)$,I,MW$K$J$j$^$9!%(B
 
$B$h$/$"$k!V@\B3$G$-$J$$!W>uBV$G$O!$2<5-$N%3%^%s%I$rC!$/$H(B
SYN_RECV
$B>uBV$G;_$^$C$F$$$k$3$H$,B?$$$G$9!%(B

 # ipvsadm -Lnc$B$N7k2L$O(B

 

IPVS connection entries

Pro expire state $B!!!!!!(Bsource  $B!!!!(B virtual  $B!!!!(B destination

 

$B$G$=$N2<$K$O2?$bI=<($,=P$F$-$^$;$s!#(B

 

$B!d(B  $B$3$l$O!$(BLVS $B$,%/%i%$%"%s%H$+$i(B SYN $B$r
$BE>Aw$7$?$b$N$N!$%j%"%k%5!<%P$,uBV$G$9!%(B
 

$B2?$b5-=R$,=P$F$3$J$$$H8@$&$3$H$O>e5-$N>uBV$r0UL#$7$F$$$k$N$G$9$+!)(B


 
$B!d(B $B2r7h:v$H$7$F$O!$%j%"%k%5!<%P$,(B 123.123.123.33 $B08$N%Q%1%C%H$r(B
$B<+J,$NJ*$H$7$F07$($k$h$&$K$7$F$"$2$l$P$$$$$N$G!&!&!&(B
 
$B4JC1$K$d$k$J$i$P!$%j%"%k%5!<%P>e$N%k!<%W%P%C%/%"%I%l%9!J(B127.0.0.1$B!K$K(B
$B%;%+%s%@%j(B IP $B%"%I%l%9$H$7$F(B 123.123.123.33 $B$N(B IP $B%"%I%l%9$r(B
$BIU$1$F$"$2$F$/$@$5$$!%(B

$B!d(B    # ip addr add 123.123.123.33/xx dev lo
   
$B"((B xx $B$O%5%V%M%C%H%^%9%/(B

$B$3$N(B123.123.123.33$B$O%W%m%P%$%@$+$iIUM?$5$l$?%"%I%l%9$G%5%V%M%C%H%^%9%/$NHV9f$O%W%m%P%$%@$KJ9$/0J30$K3N$+$a$kJ}K!$O$"$k$N$G$9$+!)(B

$B!d(B $B:#2s$N>l9g$O(B LVS/NAT $B$,%*%9%9%a$8$c$J$$$+$H;W$$$^$9!%(B

 

$Be$2$k$H!"%&%k%H%i%b%s%-!<(B

http://www.ultramonkey.org/papers/lvs_tutorial/html/

$B$K$"$k(BLVS NAT$B$r;n$7$?7k2L>eLVS Direct Routing$B$r:FEY;n$_$?$N$G$9$,>e3$BBf$G$N%Q%=%3%s$h$j(B2$BBf$NJ}$,$o$+$j$d$9$$$H9M$($F$N;n$_$H

 

LVS NAT$B$bF1MM$K(B172.17.60.201$B!JF1%5%$%H$N2>A[(BIP$B!K$r;d$N%Q%=%3%s$+$iF~NO$9$k$H(B192.168.6.4$B$H(B192.168.6.5$B$N(Bhtml$B$K>eppp0$B!N(B123.123.123.33$B!O$G(Beth1$B!N(B192.168.6.1$B!O$N?F%Q%=%3%s$r2p$7$FIT2DJ,;6$O$9$k$N$G$9$,!"%I%a%$%sL>$rF~$l$k$H(B192.168.6.4$B$NJRJ}$@$1$N%Q%=%3%s$KH?1~$O$7$^$9$,IT2DJ,;6$,$5$l$^$;$s!#$3$N>l9g$N(Biptables$B$N5-=R$,$$$1$J$$$H?dB,$O=PMh$k$N$G$9$,$I$N$h$&$K$7$F(Biptables$B$^$?$O(Bfirewall$B$HM;9g$5$;$k$+$,$o$+$i$:!"(BIP$B%^%9%+%l!<%I$,I,MWL5$5$=$&$J(BLVS Direct Routing$B$r;n$7$?

 

$B$I$NJU$j$rJY6/$9$k$H$h$$$+$465

 

$B$U$k$?(B