ºìÁªLinuxÃÅ»§
Linux°ïÖú

Linux¼¯Èº LVS--ipvsadmÃüÁî²Î¿¼

·¢²¼Ê±¼ä:2006-04-01 01:00:46À´Ô´:ºìÁª×÷Õß:Çç
¶Ôipvsadm µÄÃüÁî²Î¿¼£¬²¢¸ù¾Ý×Ô¼ºÊ¹Óõľ­Ñ飬½øÐÐÁËÒ»¸ö¼òµ¥µÄ·­Ò룬ϣÍû¶Ôipvsadm µÄʹÓÃÕßÓÐÒ»¶¨µÄ°ïÖú¡£

ΪÁ˸üºÃµÄÈôó¼ÒÀí½âÕâ·ÝÃüÁîÊֲᣬ½«ÊÖ²áÀïÃæÓõ½µÄ¼¸¸öÊõÓïÏȼòµ¥µÄ½éÉÜһϣº1£¬virtual-service-address£ºÊÇÖ¸ÐéÄâ·þÎñÆ÷µÄip µØÖ·2£¬real-service-address£ºÊÇÖ¸Õæʵ·þÎñÆ÷µÄip µØÖ·3£¬scheduler£ºµ÷¶È·½·¨£¨lna@networksbase.com ·­Òë ipvsadm v1.21 2004 Äê4 Ô£©

ipvsadm µÄÓ÷¨ºÍ¸ñʽÈçÏ£ºipvsadm -A|E -t|u|f virutal-service-address£ºport [-s scheduler] [-p [timeout]] [-M netmask] ipvsadm -D -t|u|f virtual-service-address ipvsadm -C ipvsadm -R ipvsadm -S [-n] ipvsadm -a|e -t|u|f service-address£ºport -r real-server-address£ºport [-g|i|m] [-w weight] ipvsadm -d -t|u|f service-address -r server-address ipvsadm -L|l [options] ipvsadm -Z [-t|u|f service-address] ipvsadm ----set tcp tcpfin udp ipvsadm ----start-daemon state [----mcast-interface interface] ipvsadm ----stop-daemon ipvsadm -hÃüÁîÑ¡Ïî½âÊÍ£ºÓÐÁ½ÖÖÃüÁîÑ¡Ïî¸ñʽ£¬³¤µÄºÍ¶ÌµÄ£¬¾ßÓÐÏàͬµÄÒâ˼¡£ÔÚʵ¼ÊʹÓÃʱ£¬Á½ÖÖ¶¼¿ÉÒÔ¡£

-A ----add-service ÔÚÄں˵ÄÐéÄâ·þÎñÆ÷±íÖÐÌí¼ÓÒ»ÌõеÄÐéÄâ·þÎñÆ÷¼Ç¼¡£Ò²¾ÍÊÇÔö¼Óһ̨еÄÐéÄâ·þÎñÆ÷¡£

-E ----edit-service ±à¼­ÄÚºËÐéÄâ·þÎñÆ÷±íÖеÄÒ»ÌõÐéÄâ·þÎñÆ÷¼Ç¼¡£

-D ----delete-service ɾ³ýÄÚºËÐéÄâ·þÎñÆ÷±íÖеÄÒ»ÌõÐéÄâ·þÎñÆ÷¼Ç¼¡£

-C ----clear Çå³ýÄÚºËÐéÄâ·þÎñÆ÷±íÖеÄËùÓмǼ¡£

-R ----restore »Ö¸´ÐéÄâ·þÎñÆ÷¹æÔò-S ----save ±£´æÐéÄâ·þÎñÆ÷¹æÔò£¬Êä³öΪ-R Ñ¡Ïî¿É¶ÁµÄ¸ñʽ-a ----add-server ÔÚÄÚºËÐéÄâ·þÎñÆ÷±íµÄÒ»Ìõ¼Ç¼ÀïÌí¼ÓÒ»ÌõеÄÕæʵ·þÎñÆ÷¼Ç¼¡£Ò²¾ÍÊÇÔÚÒ»¸öÐéÄâ·þÎñÆ÷ÖÐÔö¼Óһ̨еÄÕæʵ·þÎñÆ÷-e ----edit-server ±à¼­Ò»ÌõÐéÄâ·þÎñÆ÷¼Ç¼ÖеÄijÌõÕæʵ·þÎñÆ÷¼Ç¼-d ----delete-server ɾ³ýÒ»ÌõÐéÄâ·þÎñÆ÷¼Ç¼ÖеÄijÌõÕæʵ·þÎñÆ÷¼Ç¼-L|-l ----list ÏÔʾÄÚºËÐéÄâ·þÎñÆ÷±í-Z ----zero ÐéÄâ·þÎñ±í¼ÆÊýÆ÷ÇåÁ㣨Çå¿Õµ±Ç°µÄÁ¬½ÓÊýÁ¿µÈ£©

----set tcp tcpfin udp ÉèÖÃÁ¬½Ó³¬Ê±Öµ----start-daemon Æô¶¯Í¬²½ÊØ»¤½ø³Ì¡£ËûºóÃæ¿ÉÒÔÊÇmaster »òbackup£¬ÓÃÀ´ËµÃ÷LVS Router ÊÇmaster »òÊÇbackup.ÔÚÕâ¸ö¹¦ÄÜÉÏÒ²¿ÉÒÔ²ÉÓÃkeepalived µÄVRRP ¹¦ÄÜ¡£

----stop-daemon ֹͣͬ²½ÊØ»¤½ø³Ì-h ----help ÏÔʾ°ïÖúÐÅÏ¢ÆäËûµÄÑ¡Ï-t ----tcp-service service-address ˵Ã÷ÐéÄâ·þÎñÆ÷ÌṩµÄÊÇtcp µÄ·þÎñ[vip£ºport] or [real-server-ip£ºport] -u ----udp-service service-address ˵Ã÷ÐéÄâ·þÎñÆ÷ÌṩµÄÊÇudp µÄ·þÎñ[vip£ºport] or [real-server-ip£ºport] -f ----fwmark-service fwmark ˵Ã÷ÊǾ­¹ýiptables ±ê¼Ç¹ýµÄ·þÎñÀàÐÍ¡£

-s ----scheduler scheduler ʹÓõĵ÷¶ÈËã·¨£¬ÓÐÕâÑù¼¸¸öÑ¡Ïîrr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq£¬Ä¬Èϵĵ÷¶ÈËã·¨ÊÇ£º wlc. -p ----persistent [timeout] ³Ö¾ÃÎȹ̵ķþÎñ¡£Õâ¸öÑ¡ÏîµÄÒâ˼ÊÇÀ´×Ôͬһ¸ö¿Í»§µÄ¶à´ÎÇëÇ󣬽«±»Í¬Ò»Ì¨ÕæʵµÄ·þÎñÆ÷´¦Àí¡£timeout µÄĬÈÏֵΪ300 Ãë¡£

-M ----netmask netmask persistent granularity mask -r ----real-server server-address ÕæʵµÄ·þÎñÆ÷[Real-Server£ºport] -g ----gatewaying Ö¸¶¨LVS µÄ¹¤×÷ģʽΪֱ½Ó·ÓÉģʽ£¨Ò²ÊÇLVS ĬÈϵÄģʽ£©

-i ----ipip Ö¸¶¨LVS µÄ¹¤×÷ģʽΪËíµÀģʽ-m ----masquerading Ö¸¶¨LVS µÄ¹¤×÷ģʽΪNAT ģʽ-w ----weight weight Õæʵ·þÎñÆ÷µÄȨֵ----mcast-interface interface Ö¸¶¨×é²¥µÄͬ²½½Ó¿Ú-c ----connection ÏÔʾLVS Ä¿Ç°µÄÁ¬½Ó È磺ipvsadm -L -c----timeout ÏÔʾtcp tcpfin udp µÄtimeout Öµ È磺ipvsadm -L ----timeout----daemon ÏÔʾͬ²½ÊØ»¤½ø³Ì״̬----stats ÏÔʾͳ¼ÆÐÅÏ¢----rate ÏÔʾËÙÂÊÐÅÏ¢----sort ¶ÔÐéÄâ·þÎñÆ÷ºÍÕæʵ·þÎñÆ÷ÅÅÐòÊä³ö----numeric -n Êä³öIP µØÖ·ºÍ¶Ë¿ÚµÄÊý×ÖÐÎʽ¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ