ÁªºÏMySQL Proxy ºÍMySQL Cluster£¬¹¹½¨¸ßÐÔÄÜÊý¾Ý¿â
ÁªºÏMySQL Proxy ºÍMySQL Cluster£¬¹¹½¨¸ßÐÔÄÜÊý¾Ý¿â
ÔÎÄ£ºhttp://blogs.mysql.com/kaj/2007/12/10/combining-mysql-proxy-with-mysql-cluster/
²»¾ÃÇ°£¬ÎÒºÍStewart Smith, Vinay Joosery, Monty Taylor ÒÔ¼°ÆäËûµÄmysqlʹÓÃÕߣ¨ËûÃDZÈÎÒ¸üÊìϤMySQL Cluster £©Õ¹¿ªÁËÒ»´ÎÌÖÂÛ£¬Ì½ÌÖµÄÖ÷ÌâÊÇ£ºÔÚ²»¸ü¸ÄÓ¦ÓõÄÇé¿öÏ£¬Ê¹ÓÃMySQL ProxyÀ´Ïû³ýMySQL Cluster µÄÈ«±íɨÃè¡£
ÌÖÂÛÔ´×ÔÎÒÎÊStewartµÄÒ»¸öÎÊÌ⣺À©Õ¹MySQL ClusterʹÓÃÓû§ÊýÁ¿µÄÆ¿¾±ÊÇʲô£¿Ëû»Ø´ð£ºÆ¿¾±¿ÉÄÜÀ´×ÔJoinºÍÆäËûµÄselect¿ÉÄÜÐèҪɨÃèÊý¾Ý¿âµÄ´ó²¿·Ö¡£ÕâÀïÓÐÆäËû¸ü¿ìµÄ´æ´¢ÒýÇ棬±ÈÈç MyISAM and InnoDB¡£
´ÓÒ»¸ö¼òµ¥µÄͼÀ´¿´——Èçͼ1£¬Ó¦ÓúÍMySQL Clusterͨ¹ýsql½»»¥£¬Í¬Ê±µÃµ½Ò»Ð©·þÎñµÄÏìÓ¦¡£ÕâÖÖ¹Ûµã¿ÉÒÔͼ1 ÖдøÓÐË«¼ýÍ·µÄ“sql”À´±íʾ¡£“sql”Ö÷Òª°üÀ¨ÏÂÃ漸²¿·Ö£º
UPDATE, INSERT, DELETE Óï¾ä£¬ÇáÁ¿¼¶µÄ£¬¾³£¾ÍÓ°Ï켸ÐЗ—ÔÚͼ2ÖÐÓÃÀ¶É«µÄµ¥Ïò¼ýÍ·±íʾ
¼òµ¥µÄSELECTÓï¾ä£¬Ò²ÊÇÇáÁ¿¼¶µÄ£¬ÕâÖÖ²éѯͨ³£Ê¹ÓÃË÷ÒýÀ´·µ»Ø¼¸ÐЗ—ÔÚͼ2ÖÐÓúÚÉ«µÄË«Ïò¼ýÍ·±íʾ
¸´ÔÓµÄSELECTÓï¾ä£¬±ÈÈç³£¼ûµÄʹÓÃ" select *" £¬µ«ÕâÖÖÓï¾ä²»ÊÇʹÓÃË÷Òý£¬¶øÇÒ¾³£»á·µ»Ø¶àÐÐÊý¾Ý——Õâ ÖÖÇé¿öÔÚͼ2ÖÐÓôøÐéÏßµÄË«Ïò¼ýÍ·£¨×¢Òâ·µ»Ø¶ÎµÄÁ½¸ö¼ýÍ·´ú±í·µ»Ø¶àÊý¾Ý£©±íʾ
ͼ2²¢Ã»ÓÐÔÚÓ¦ÓýṹÉϺÍͼ1²úÉú±ä»¯£¬Ö»ÊǸü¼ÓµÄϸÁ£¶ÈÒ»µã¡£ÏÖÔÚÎÒÃÇÀ´¿´ÆÕͨµÄMySQL Server £¨´øÓÐMyISAM »ò InnoDBÒýÇ棩Äܹ»¸ü¿ìµÄ·¢Ë͸´ÔӵIJéѯÇëÇó¡£ÔÚͼ3ÖУ¬ÎÒÃÇÄÜ¿´µ½£º
 
Ïà¹ØÎĵµ£º
ÓÉMySQLÌṩµÄģʽƥÅäµÄÆäËûÀàÐÍÊÇʹÓÃÀ©Õ¹ÕýÔò±í´ïʽ¡£µ±Äã¶ÔÕâÀàģʽ½øÐÐÆ¥Åä²âÊÔʱ£¬Ê¹ÓÃREGEXPºÍNOT REGEXP²Ù×÷·û(»òRLIKEºÍNOT RLIKE£¬ËüÃÇÊÇͬÒå´Ê)¡£ À©Õ¹ÕýÔò±í´ïʽµÄһЩ×Ö·ûÊÇ£º
“.”Æ¥ÅäÈκε¥¸öµÄ×Ö·û¡£
Ò»¸ö×Ö·ûÀà“[...]”Æ¥ÅäÔÚ·½À¨ºÅÄÚµÄÈκÎ×Ö·û¡£ÀýÈ磬“[abc]”ƥŠ......
mysql ±¸·ÝºÍ»Ö¸´²ßÂÔ
ÎÄÕ·ÖÀà:Êý¾Ý¿â
ÔÚÊý¾Ý¿â±í¶ªÊ§»òË𻵵ÄÇé¿öÏ£¬±¸·ÝÄãµÄÊý¾Ý¿âÊǺÜÖØÒªµÄ¡£Èç¹û·¢Éúϵͳ±ÀÀ££¬Äã¿Ï¶¨ÏëÄܹ»½«ÄãµÄ±í¾¡¿ÉÄܶªÊ§×îÉÙµÄÊý¾Ý»Ö¸´µ½±ÀÀ£·¢ÉúʱµÄ״̬¡£±¾ÎÄÖ÷Òª¶ÔMyISAM±í×ö±¸·Ý»Ö¸´¡£
±¸·Ý²ßÂÔÒ»£ºÖ±½Ó¿½±´Êý¾Ý¿âÎļþ£¨²»ÍƼö£©
±¸·Ý²ßÂÔ¶þ£ºÊ¹ÓÃmysqlhotcopy±¸·ÝÊý¾Ý¿â£ ......
Ò»¡¢IPÐÅÏ¢ÁÐ±í£º
Ãû³Æ IP
LVS-DR-VIP 192.168.50.245
LVS-DR-Master ......
mysql> grant ȨÏÞ1,ȨÏÞ2,¡È¨ÏÞn on Êý¾Ý¿âÃû³Æ.±íÃû³Æ to Óû§Ãû@Óû§µØÖ· identified by ¡®Á¬½Ó¿ÚÁ; ȨÏÞ1,ȨÏÞ2,¡È¨ÏÞn´ú±íselect,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,fileµÈ14¸öȨÏÞ¡£µ±È¨ÏÞ1,ȨÏÞ2,¡È¨ÏÞn±»all privileges»òÕßall´úÌ棬±íʾ¸³ÓèÓû§È«²¿ ......