A10ÍøÂ縺Ôؾùºâ²âÊÔ·½°¸
½øÈëÅäÖÃģʽ¡ªSLB¡ª·þÎñÆ÷£¬Ìí¼Ó·þÎñÆ÷ns1ºÍns2£¬ipµØַΪ10.0.2.18ºÍ10.0.2.19
Ìí¼Ó·þÎñ¶Ë¿Ú53£¬ÐÒéΪUDP£¬ÆôÓý¡¿µ¼à²âdns-hm
½øÈëÅäÖÃģʽ¡ªSLB¡ª·þÎñÆ÷£¬Ìí¼Ó·þÎñ×éSG-DNS£¬Ìí¼Ó·þÎñ×é³ÉÔ±ns1ºÍns2£¬·Ö±ðʹÓÃudp 53¶Ë¿Ú¡£
½øÈëÅäÖÃģʽ¡ªSLB¡ªÐéÄâ·þÎñÆ÷£¬Ìí¼ÓÐéÄâ·þÎñÆ÷vip-dns£¬ipµØַΪ10.0.1.12£¬Ìí¼Ó¶Ë¿Ú53£¬ÀàÐÍΪDNS-UDP£¬ÅäÖ÷þÎñ×éSG-DNS
A10ÍøÂ縺Ôؾùºâ²âÊÔ·½°¸
²âÊÔ·½·¨£º
1¡¢ ÅäÖÃns1ºÍns2Äܹ»Õý³£Ìṩ·þÎñ£¬Äܹ»Ìṩ
www.a10networks.comµÄÕý³£½âÎö£¬²é¿´·þÎñÆ÷ºÍdns-vipµÄ״̬£» 2¡¢ ÔÚÍâÍø³ö¿Ú´¦£¬²ÉÓÃACL»òÕßÆäËûµÄ·½Ê½£¬×èÖ¹ns1»òns2³öÏòµÄÁ÷
Á¿£¬ÏÞÖÆns1»òns2µÄ»¥ÁªÍø·ÃÎÊ£¬Ê¹µÃÆäÖÐһ̨DNS²»ÄÜÕý³£Ìṩ½âÎö·þÎñ£¬²é¿´·þÎñÆ÷ºÍdns-vipµÄ״̬£»
3¡¢ ½«×Ô¶¨ÒåµÄdns-hm·½Ê½¸ü»»ÎªICMPºÍTCPµÄĬÈϽ¡¿µ¼ì²é·½Ê½£¬
²é¿´·þÎñÆ÷ºÍdns-vipµÄ״̬¡£
5. ʹÓÃÍⲿ½Å±¾³ÌÐòµÄ½¡¿µ¼ì²é
»ùÓڽű¾µÄ½¡¿µ¼ì²é£¨TCL/Perl/Shell/Python scriptºÍaFlex£©£ºÍ¨¹ý¹ØÁª¼ì²éÓëij¸öÓ¦ÓÃÏà¹ØµÄһϵÁÐÓ¦Ó÷þÎñÆ÷µÄ½¡¿µ×´Ì¬À´È·¶¨Ä³Ò»Ó¦ÓõĽ¡¿µ×´Ì¬¡£È磺ͨ¹ýͬʱ¼ì²âWebÓ¦Óá¢Öмä¼þ·þÎñÆ÷ºÍÊý¾Ý¿â·þÎñÆ÷µÄ״̬À´ÅжÏÕû¸öÓ¦ÓõĽ¡¿µ×´Ì¬¡£
µ±AX¼ì²âµ½·þÎñÆ÷ʧЧʱ£¬AX×Ô¶¯°ÑʧЧ·þÎñÆ÷½øÐиôÀë,²»ÔÙ¸øÆä·Ö·¢À´×Ô¿Í»§¶ËµÄÐèÇó¡£µ±AX¼ì²âµ½Ê§Ð§·þÎñÆ÷»Ö¸´ºó£¬AX¼ÌÐø¸øÆä·Ö·¢À´×Ô¿Í»§¶ËµÄÐèÇó¡£
AXÖ§³ÖµÄÍⲿ½Å±¾³ÌÐò°üÀ¨ 1¡¢ 2¡¢ 3¡¢ 4¡¢
TCL½Å±¾ Perl½Å±¾ Shell½Å±¾ Python½Å±¾
A10ÍøÂ縺Ôؾùºâ²âÊÔ·½°¸
×¢Ò⣺ µ±Ñ¡ÔñPerl¡¢ShellºÍPython½Å±¾½øÐн¡¿µ¼ì²éʱ£¬µ±Ç°Ó¦Óý¡¿µ¼ì²éµÄ·þÎñÆ÷µÄIPµØַΪ(HM_SRV_IPADDR)£¬·þÎñÆ÷µÄ¶Ë¿ÚΪ (HM_SRV_PORT)£¬¿ÉÔڽű¾³ÌÐòÖÐÖ±½Óµ÷Óá£
4. HTTPÓ¦ÓÃÄ£°åÅäÖü°²âÊÔ
´´½¨·þÎñÆ÷HTTPÓ¦ÓÃÄ£°åµÄÇ°ÌáÊÇ£¬½¨Á¢ÐµÄVIPºó£¬´´½¨µÄVPORTÀàÐÍΪHTTP£¬´ËʱVIPµÄ²¿ÊôģʽΪL7²ã²¿Êô£¬·½¿ÉÓ¦ÓÃHTTPÓ¦ÓÃÄ£°å¡£
Èô´´½¨µÄVPORTµÄÀàÐÍΪTCP£¬ËäÈ»¶Ë¿ÚÑ¡ÔñµÄΪ80£¬ÔòAXÈÔÈ»ÈÏΪ´Ë¶Ë¿Ú²¿ÊôģʽΪL4²ã£¬½¡¿µ¼ì²é²»ÔÊÐíʹÓÃHTTPÓ¦ÓÃÄ£°å¡£
×¢Ò⣺±¾ÕÂÄÚÈݾù°´ÕÕÉÏÊöÎÄÖеķþÎñÆ÷ÉèÖúÍÍØÆ˼ܹ¹£¬²ÉÓ÷þÎñÆ÷Ϊrs1ºÍrs2£¬·þÎñÆ÷×é¾ù²ÉÓÃsg-http£¬³ÉԱΪrs1:80ºÍrs2:80¡£
HTTPÓ¦ÓÃÄ£°å¿ÉÖ§³ÖµÄÀàÐÍÓУº
? Failover: µ±ËùÓÐÎïÀí·þÎñÆ÷å´»úʱ£¬Öض¨Ïòµ½Ä³¸ö¸ø³öÕ¾µã£» ? Retry-on-5xx: µ±Ñ¡ÔñµÄ·þÎñÆ÷³öÏÖ5xx´íÎóʱ£¬ÖØÐÂΪÇëÇóÑ¡Ôñͬһ¸ö·þÎñ×éÖеÄÁíÍâһ̨·þÎñÆ÷£»
? Compression: HTTPÄÚÈÝѹËõÄ£°å£¬Ð¶ÔØ·þÎñÆ÷CPUѹËõ¸ºÔØ£¬HTTPÄÚÈݲ»ÔÚ·þÎñÆ÷ÉÏѹËõ£¬Ö±½Ó·¢ËÍÖÁ¸ºÔؾùºâÉ豸£¬ÔÚ¸ºÔؾùºâÉϽøÐÐѹËõºó·¢Ë͸ø¿Í»§¶Ë£»
? Header Insert/Replace: HTTP±¨Í·Ìæ»»£¬ÔÚHTTPµÄÇëÇó±¨Í·»òÏàÓ¦°üÍ·ÖвåÈëÖ¸¶¨µÄÄÚÈÝ£»
? Header Erase£º HTTP±¨Í·²Á³ý£¬ÔÚHTTPµÄÇëÇó»òÕß»ØÓ¦±¨Í·ÖУ¬É¾³ýÖ¸¶¨µÄÄÚÈÝ£»
? Host Switching£º ¸ù¾ÝHTTP±¨Í·ÖÐHOSTÖ¸¶¨µÄ×Ö·û´®À´Ñ¡ÔñÖ¸¶¨µÄ·þÎñ×飻
? Client IP Insert£º ½«¿Í»§¶ËµÄIPµØÖ·²åÈëµ½HTTP±¨Í·£¬Ê¹µÃ·þÎñÆ÷Äܹ»µÃµ½¿Í»§¶ËIPµØÖ·£»
? Redirect Rewrite£º ¶ÔÓÚ¿Í»§¶ËµÄÇëÇó½øÐÐÖض¨Ïò£»
? URL Switching£º ¸ù¾ÝHTTP±¨Í·ÖÐURLÖ¸¶¨µÄ×Ö·û´®À´Ñ¡ÔñÖ¸¶¨µÄ·þÎñ×飻
? URL Hash Persistence£ºÔÚδÅäÖÃHost SwitchingºÍURL SwitchingµÄÇé¿öÏ£¬¿É¸ù¾ÝURLÖÐÖ¸¶¨Î»ÊýµÄ×Ö·û´®µÄHASH½á¹û½øÐлỰ±£³Ö£»
? Non-HTTP bypass: ½«·ÇHTTPµÄÁ÷Á¿Öض¨Ïòµ½Ä³Ìض¨µÄ·þÎñ×飻 ? Session Termination for non-compliant HTTP 1.1 Clients: ÔÚʹÓÃÁ¬½Ó¸´ÓõÄÇé¿öÏ£¬ÖÕ½á´øÓÐ ¡°Connection: close¡±±¨Í·µÄÁ¬½Ó¡£
A10ÍøÂ縺Ôؾùºâ²âÊÔ·½°¸
1. FailoverʧЧÖض¨Ïò
´Ë¹¦ÄܵÄ×÷ÓÃÊǵ±±¾»úÉèÖõÄËùÓеÄReal Server¾ù²»ÄÜÌṩÕý³£·þÎñʱ£¬AX¿ÉÏò¿Í»§¶Ë·¢ËÍÒ»¸öHTTP 302Öض¨ÏòµÄ±¨ÎÄ£¬Ê¹µÃ¿Í»§¶Ëä¯ÀÀÆ÷ÖØж¨Ïòµ½ÐµĵØÖ·¡£
±¾¹¦ÄÜÔÚÉèÖõÄReal ServerµÄ½¡¿µ¼ì²éÈ«²¿Î´Í¨¹ýʱ¼¤»î¡£ CLI:
Ê×ÏȽ¨Á¢Ò»¸öÃûΪurlfailoverµÄHTTPÄ£°å£º
AX(config)#slb template http urlfailover
AX(config-HTTP template)#failover-url www.example2.com AX(config-HTTP template)#exit
È»ºóÔÚVIPϵÄVPORTÖÐÓ¦ÓôËÄ£°å
AX(config)#slb virtual-server vs1 1.1.1.1 AX(config-slb virtual server)#port 80 http
AX(config-slb virtual server-slb virtua...)#template http urlfailover
GUI:
½øÈëÅäÖÃģʽ¡ª·þÎñ¡ªÄ£°å¡ªÓ¦Óã¬Ð½¨Ò»¸öHTTPµÄÄ£°å£¬Ãû³ÆΪrulfailover£¬ ʧ°Üºóתµ½URLÖÐÊäÈ룺www.example2.com
ÔÚVIPϵÄVPORTÖÐÓ¦ÓôËÄ£°å¡£
½øÈëÅäÖÃģʽ¡ª·þÎñ¡ªSLB¡ªÐéÄâ·þÎñÆ÷£¬½øÈëËùÐèÒªÓ¦ÓôËÄ£°åµÄÐéÄâ·þÎñÆ÷ÅäÖÃģʽ£»
Ìí¼Ó»òÑ¡ÔñÐèҪʹÓôËÄ£°åµÄ¶Ë¿Ú£¬µã»÷±à¼ºó½øÈëVPORT±à¼Ä£Ê½£» È·È϶˿ÚÀàÐÍΪHTTP£¬Èç·ÇHTTPÀàÐÍ¿ÉÄܻῴ²»µ½´ËÄ£°åµÄÑ¡Ï ÔÚ×ÓÑ¡ÏîÖеÄHTTPÄ£°åÖÐÑ¡Ôñ¸Õ²Å½¨Á¢µÄHTTPÄ£°å£¬urlfailover£» µã»÷È·¶¨£¬Íê³ÉÅäÖá£