{"id":23734,"date":"2021-11-28T16:36:11","date_gmt":"2021-11-28T08:36:11","guid":{"rendered":"https:\/\/aqzt.com\/23734.html"},"modified":"2021-11-28T16:36:11","modified_gmt":"2021-11-28T08:36:11","slug":"flickr-%e7%bd%91%e7%ab%99%e6%9e%b6%e6%9e%84%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/aqzt.com\/23734.html","title":{"rendered":"Flickr \u7f51\u7ad9\u67b6\u6784\u5206\u6790"},"content":{"rendered":"<h1>Flickr \u7f51\u7ad9\u67b6\u6784\u5206\u6790<\/h1>\n<p>Flickr.com \u662f\u7f51\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u7167\u7247\u5171\u4eab\u7f51\u7ad9\u4e4b\u4e00\uff0c\u8fd8\u8bb0\u5f97\u90a3\u4f4d\u7ed9Windows Vista\u62cd\u6444\u58c1\u7eb8\u7684Hamad Darwish\u5417\uff1f\u4ed6\u5c31\u662f\u5c06\u7167\u7247\u4e0a\u4f20\u5230Flickr\uff0c\u540e\u800c\u88ab\u5fae\u8f6f\u770b\u4e2d\u6210\u4e3aVista\u58c1\u7eb8\u5fa1\u7528\u6444\u5f71\u5e08\u3002<\/p>\n<\/p>\n<p>Flickr.com \u662f\u6700\u521d\u7531\u4f4d\u4e8e\u6e29\u54e5\u534e\u7684Ludicorp\u516c\u53f8\u5f00\u53d1\u8bbe\u8ba1\u5e76\u4e8e2004\u5e742\u6708\u6b63\u5f0f\u53d1\u5e03\u7684\uff0c\u7531\u4e8e\u5927\u91cf\u5e94\u7528\u4e86WEB 2.0\u6280\u672f\uff0c\u6ce8\u91cd\u7528\u6237\u4f53\u9a8c\uff0c\u4f7f\u5f97\u5176\u8fc5\u901f\u83b7\u5f97\u4e86\u5927\u91cf\u7684\u7528\u6237\uff0c2007\u5e7411\u6708\uff0cFlickr\u8fce\u6765\u4e86\u7b2c20\u4ebf\u5f20\u7167\u7247\uff0c\u4e00\u5e74\u540e\uff0c\u8fd9\u4e2a\u6570\u5b57\u5c31\u8fbe\u5230\u4e8630\u4ebf\uff0c\u5e76\u4e14\u8fd8 \u5728\u4ee5\u52a0\u901f\u5ea6\u589e\u957f\u3002 2005\u5e743\u6708\uff0c\u96c5\u864e\u516c\u53f8\u4ee53\u5343500\u4e07\u7f8e\u5143\u6536\u8d2d\u4e86Ludicorp\u516c\u53f8\u548cFlickr.com\u3002\u867d\u7136Flickr\u5e76\u4e0d\u662f\u6700\u5927\u7684\u7167\u7247\u5171\u4eab\u7f51\u7ad9 \uff08Facebook\u4ee5\u8d85\u8fc7100\u4ebf\u5f20\u7167\u7247\u6392\u540d\u7b2c\u4e00\uff09\uff0c\u4f46\u8fd9\u7b14\u6536\u8d2d\u4ecd\u7136\u88ab\u8ba4\u4e3a\u662fWEB 2.0\u6d6a\u6f6e\u4e2d\u6700\u7cbe\u660e\u7684\u6536\u8d2d\uff0c\u56e0\u4e3a\u4ec5\u4ec5\u4e00\u5e74\u540e\uff0cGoogle\u5c31\u4ee516\u4ebf\u7f8e\u5143\u7684\u9ad8\u4ef7\u6536\u8d2d\u4e86YouTube\uff0c\u800c2007\u5e7410\u6708\uff0c\u5fae\u8f6f\u65a5\u8d442.4\u4ebf\u7f8e\u5143\u6536\u8d2d Facebook 1.6%\u80a1\u4efd\uff0c\u6b64\u4e3e\u4f7fFacebook\u4f30\u503c\u9ad8\u8fbe150\u4ebf\u7f8e\u5143\u3002\u4f30\u8ba1Ludicorp\u516c\u53f8\u7684\u521b\u59cb\u4ebaStewart Butterfield\u548cCaterina Fake\u592b\u5987\u73b0\u5728\u8fd8\u5728\u540e\u6094\u5427\u3002<\/p>\n<p>\u57282005\u5e74\u6e29\u54e5\u534ePHP\u534f\u4f1a\u7684\u7b80\u62a5\u4ee5\u53ca\u968f\u540e\u7684\u4e00\u7cfb\u5217\u4f1a\u8bae\u4e0a\uff0cFlickr\u7684\u67b6\u6784\u5e08Cal Henderson\u516c\u5f00\u4e86\u5927\u90e8\u5206Flickr\u6240\u4f7f\u7528\u7684\u540e\u53f0\u6280\u672f\uff0c\u4f7f\u5f97\u6211\u4eec\u80fd\u6709\u673a\u4f1a\u6765\u5206\u4eab\u548c\u7814\u7a76\u5176\u5728\u6784\u5efa\u53ef\u6269\u5c55Web\u7ad9\u70b9\u7684\u7ecf\u9a8c\u3002\u672c\u6587\u5927\u90e8\u5206\u8d44\u6599\u6765\u81ea\u4e92\u8054\u7f51\u548c\u81ea\u5df1\u7684\u4e00\u70b9\u70b9\u5fc3\u5f97\uff0c\u6b22\u8fce\u5927\u5bb6\u53c2\u4e0e\u8ba8\u8bba\uff0c\u8981\u662f\u80fd\u591f\u8d77\u5230\u629b\u7816\u5f15\u7389\u7684\u4f5c\u7528\uff0c\u672c\u4eba\u5c06\u4e0d\u80dc\u8363\u5e78\u3002<\/p>\n<p>Flickr\u6574\u4f53\u6846\u67b6\u56fe<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\" \/><\/p>\n<p>\u5728\u8ba8\u8bbaFlickr \u7f51\u7ad9\u67b6\u6784\u4e4b\u524d\uff0c\u8ba9\u6211\u4eec\u5148\u6765\u770b\u4e00\u7ec4\u7edf\u8ba1\u6570\u636e\uff08\u6570\u636e\u6765\u6e90\uff1aApril 2007 MySQL Conf and Expo\u548cFlickr\u7f51\u7ad9\uff09<\/p>\n<ol>\n<li>\u6bcf\u5929\u591a\u8fbe40\u4ebf\u6b21\u7684\u67e5\u8be2\u8bf7\u6c42<\/li>\n<li>squid\u603b\u8ba1\u7ea6\u67093500\u4e07\u5f20\u7167\u7247\uff08\u786c\u76d8+\u5185\u5b58\uff09<\/li>\n<li>squid\u5185\u5b58\u4e2d\u7ea6\u6709200\u4e07\u5f20\u7167\u7247<\/li>\n<li>\u603b\u8ba1\u6709\u5927\u7ea64\u4ebf7000\u4e07\u5f20\u7167\u7247\uff0c\u6bcf\u5f20\u56fe\u7247\u53c8\u751f\u6210\u4e0d\u540c\u5c3a\u5bf8\u5927\u5c0f\u76844\uff0d5\u4efd\u56fe\u7247<\/li>\n<li>\u6bcf\u79d238\uff0c000\u6b21Memcached\u8bf7\u6c42 (Memcached\u603b\u5171\u5b58\u50a8\u4e861200\u4e07\u5bf9\u8c61)<\/li>\n<li>\u8d85\u8fc72 PB \u5b58\u50a8\uff0c\u5176\u4e2d\u6570\u636e\u5e9312TB<\/li>\n<li>\u6bcf\u5929\u65b0\u589e\u56fe\u7247\u8d85\u8fc7 40\u4e07\uff08\u5468\u65e5\u5cf0\u503c\u8d85\u8fc7200\u4e07\uff0c\u7ea61.5TB)<\/li>\n<li>\u8d85\u8fc78\u767e50\u4e07\u6ce8\u518c\u7528\u6237<\/li>\n<li>\u8d85\u8fc71\u5343\u4e07\u7684\u552f\u4e00\u6807\u7b7e\uff08tags)<\/li>\n<li>\u54cd\u5e944\u4e07\u4e2a\u7167\u7247\u8bbf\u95ee\u8bf7\u6c42<\/li>\n<li>\u5904\u740610\u4e07\u4e2a\u7f13\u5b58\u64cd\u4f5c<\/li>\n<li>\u8fd0\u884c13\u4e07\u4e2a\u6570\u636e\u5e93\u67e5\u8be2<\/li>\n<\/ol>\n<p>\u8fd9\u5f20\u662fFlickr\u7684\u7f51\u7ad9\u67b6\u6784\u56fe\uff0c\u6211\u4eec\u8fd9\u91cc\u53ea\u4f5c\u4e00\u4e9b\u7b80\u8981\u7684\u63cf\u8ff0\uff0c\u5177\u4f53\u7684\u5206\u6790\u8bf7\u9759\u5f85\u540e\u7eed\u6587\u7ae0\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/><\/p>\n<p>\u00a0<\/p>\n<ol>\n<li>Pair of ServerIron&#x27;s\u505a\u8d1f\u8f7d\u5747\u8861\u65b9\u6848<\/li>\n<li>Squid Caches \u4ee3\u7406\uff0c\u7528\u4e8e\u7f13\u5b58\u9759\u6001\u7684HTML\u548c\u7167\u7247<\/li>\n<li>Net App\u516c\u53f8\u7684Filer, NAS\u5b58\u50a8\u8bbe\u5907\uff0c\u7528\u4e8e\u5b58\u50a8\u7167\u7247<\/li>\n<li>PHP App Servers\u00a0<\/li>\n<\/ol>\n<p>\uff0d \u8fd0\u884cREDHAT LINUX,Apache\u4e0a\u7684PHP\u5e94\u7528\uff0cFlickr\u7f51\u7ad9\u7684\u4e3b\u4f53\u662f\u5927\u7ea66\u4e07\u884cPHP\u4ee3\u7801<br \/>\n<!-- -->\uff0d \u6ca1\u6709\u4f7f\u7528PHP session, \u5e94\u7528\u662fstateless,\u4fbf\u4e8e\u6269\u5c55\uff0c\u5e76\u907f\u514dPHP Server\u6545\u969c\u6240\u5e26\u6765\u7684Session\u5931\u6548\u3002<br \/>\n<!-- -->\uff0d \u6bcf\u4e2a\u9875\u9762\u6709\u5927\u7ea627\uff5e35\u4e2a\u67e5\u8be2\uff08\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u8fd9\u4e48\u8bbe\u8ba1\uff0c\u4e2a\u4eba\u89c9\u5f97\u6ca1\u6709\u5fc5\u8981\uff09<br \/>\n<!-- -->\uff0d \u53e6\u6709\u4e13\u95e8\u7684Apache Web Farm \u670d\u52a1\u4e8e\u9759\u6001\u6587\u4ef6\uff08HTML\u548c\u7167\u7247\uff09\u7684\u8bbf\u95ee<\/p>\n<ol>\n<li>Storage Manager \u8fd0\u884c\u79c1\u6709\u7684\uff0c\u9002\u7528\u4e8e\u6d77\u91cf\u6587\u4ef6\u5b58\u50a8\u7684Flickr File System<\/li>\n<li>Dual Tree Central Database\u00a0<\/li>\n<\/ol>\n<p>\uff0d MySQL \u6570\u636e\u5e93\uff0c\u5b58\u653e\u7528\u6237\u8868\uff0c\u8bb0\u5f55\u7684\u4fe1\u606f\u662f\u7528\u6237\u4e3b\u952e\u4ee5\u53ca\u6b64\u7528\u6237\u5bf9\u4ee5\u7684\u6570\u636e\u5e93Shard\u533a\uff0c\u4ece\u4e2d\u5fc3\u7528\u6237\u8868\u4e2d\u67e5\u51fa\u7528\u6237\u6570\u636e\u6240\u5728\u4f4d\u7f6e\uff0c\u7136\u540e\u76f4\u63a5\u4ece\u76ee\u6807Shard\u4e2d\u53d6\u51fa\u6570\u636e\u3002\u00a0<br \/>\n<!-- -->\uff0d \u201cDual Tree&quot;\u67b6\u6784\u662f\u201dMaster\uff0dMaster&quot;\u548c\u201cMaster-Slave&quot;\u7684\u6709\u6548\u7ed3\u5408\uff0c\u53ccMaster \u907f\u514d\u4e86\u201c\u5355\u70b9\u6545\u969c\u201d\uff0cMaster\uff0dSlave\u53c8\u63d0\u9ad8\u4e86\u8bfb\u53d6\u901f\u5ea6\uff0c\u56e0\u4e3a\u7528\u6237\u8868\u7684\u64cd\u4f5c90\uff05\u4ee5\u4e0a\u662f\u8bfb\u3002<\/p>\n<ol>\n<li>Master-master shards<\/li>\n<\/ol>\n<p>\uff0d MySQL \u6570\u636e\u5e93\uff0c\u5b58\u50a8\u5b9e\u9645\u7684\u7528\u6237\u6570\u636e\u548c\u7167\u7247\u7684\u5143\u6570\u636e\uff08Meta Data)\uff0c\u6bcf\u4e2aShard \u5927\u7ea640\u4e07\u4e2a\u7528\u6237\uff0c120GB \u6570\u636e\u3002\u6bcf\u4e2a\u7528\u6237\u7684\u6240\u6709\u6570\u636e\u5b58\u653e\u5728\u540c\u4e00\u4e2ashard\u4e2d\u3002<br \/>\n<!-- -->\uff0d Shard\u4e2d\u7684\u6bcf\u4e00\u4e2aserver\u7684\u8d1f\u8f7d\u53ea\u662f\u5176\u53ef\u6700\u5927\u8d1f\u8f7d\u768450\uff05\uff0c\u8fd9\u6837\u5728\u9700\u8981\u7684\u65f6\u5019\u53ef\u4ee5Online\u505c\u6389\u4e00\u534a\u7684server\u8fdb\u884c\u5347\u7ea7\u6216\u7ef4\u62a4\u800c\u4e0d\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002<br \/>\n<!-- -->\uff0d \u4e3a\u4e86\u907f\u514d\u8de8Shard\u67e5\u8be2\u6240\u5e26\u6765\u7684\u6027\u80fd\u5f71\u54cd\uff0c\u4e00\u4e9b\u6570\u636e\u6709\u5728\u4e0d\u540c\u7684Shard\u6709\u4e24\u4efd\u62f7\u8d1d\uff0c\u6bd4\u5982\u7528\u6237\u5bf9\u7167\u7247\u7684\u8bc4\u8bba\uff0c\u901a\u8fc7\u4e8b\u52a1\u6765\u4fdd\u8bc1\u5176\u540c\u6b65\u3002<\/p>\n<ol>\n<li>Memcached Cluster \u4e2d\u95f4\u5c42\u7f13\u5b58\u670d\u52a1\u5668\uff0c\u7528\u4e8e\u7f13\u5b58\u6570\u636e\u5e93\u7684SQL\u67e5\u8be2\u7ed3\u679c\u7b49\u3002<\/li>\n<li>Big Search Engine\u00a0\u00a0<\/li>\n<\/ol>\n<ul>\n<li>\u590d\u5236\u90e8\u5206Shard\u6570\u636e\uff08Owner\u2019s single tag\uff09\u5230Search Engine Farm\u4ee5\u54cd\u5e94\u5b9e\u65f6\u7684\u5168\u6587\u68c0\u7d22\u3002<\/li>\n<li>\u5176\u4ed6\u5168\u6587\u68c0\u7d22\u8bf7\u6c42\u5229\u7528Yahoo\u7684\u641c\u7d22\u5f15\u64ce\u5904\u7406\uff08Flickr\u662fYahoo\u65d7\u4e0b\u7684\u516c\u53f8<img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"F\" \/>\uff09<\/li>\n<\/ul>\n<ol>\n<li>\u670d\u52a1\u5668\u7684\u786c\u4ef6\u914d\u7f6e\uff1a<\/li>\n<\/ol>\n<ul>\n<li>Intel\u6216AMD 64\u4f4dCPU\uff0c16GB RAM<\/li>\n<li>6-disk 15K RPM RAID-10.<\/li>\n<li>2U boxes.<\/li>\n<\/ul>\n<ol>\n<li>\u670d\u52a1\u5668\u6570\u91cf\uff1a(\u6570\u636e\u6765\u6e90\uff1aApril 2008 MySQL Conference &amp; Expo)<\/li>\n<\/ol>\n<p>166 DB servers, 244 web servers(\u4e0d\u77e5\u9053\u662f\u5426\u5305\u62ec squid server\uff1f), 14 Memcached servers<\/p>\n<p><strong>\u6570\u636e\u5e93\u6700\u521d\u7684\u6269\u5c55-Replication<\/strong><\/p>\n<p>\u4e5f\u8bb8\u6709\u4eba\u4e0d\u76f8\u4fe1\uff0c\u4e0d\u8fc7Flickr\u786e\u5b9e\u662f\u4ece\u4e00\u53f0\u670d\u52a1\u5668\u8d77\u6b65\u7684\uff0c\u5373Apache\/PHP\u548cMySQL\u662f\u8fd0\u884c\u5728\u540c\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u7684\uff0c\u5f88\u5febMySQL\u670d\u52a1\u5668\u5c31\u72ec\u7acb \u4e86\u51fa\u6765\uff0c\u6210\u4e86\u53cc\u670d\u52a1\u5668\u67b6\u6784\u3002\u968f\u7740\u7528\u6237\u548c\u8bbf\u95ee\u91cf\u7684\u5feb\u901f\u589e\u957f\uff0cMySQL\u6570\u636e\u5e93\u5f00\u59cb\u627f\u53d7\u8d8a\u6765\u8d8a\u5927\u7684\u538b\u529b\uff0c\u6210\u4e3a\u5e94\u7528\u74f6\u9888\uff0c\u5bfc\u81f4\u7f51\u7ad9\u5e94\u7528\u54cd\u5e94\u901f\u5ea6\u53d8\u6162,MySQL \u7684\u6269\u5c55\u95ee\u9898\u5c31\u6446\u5728\u4e86Flickr\u7684\u6280\u672f\u56e2\u961f\u9762\u524d\u3002<br \/>\n<!-- -->\u4e0d\u5e78\u7684\u662f\uff0c\u5728\u5f53\u65f6\uff0c\u4ed6\u4eec\u7684\u9009\u62e9\u5e76\u4e0d\u591a\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u7684\u6269\u5c55\u65e0\u5916\u662f\u4e24\u6761\u8def\uff0cScale-Up\u548cScale-Out,\u6240\u8c13Scale-Up\uff0c\u7b80\u5355\u7684\u8bf4\u5c31\u662f \u5728\u540c\u4e00\u53f0\u673a\u5668\u5185\u589e\u52a0CPU,\u5185\u5b58\u7b49\u786c\u4ef6\u6765\u589e\u52a0\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u5904\u7406\u80fd\u529b\uff0c\u4e00\u822c\u4e0d\u9700\u8981\u4fee\u6539\u5e94\u7528\u7a0b\u5e8f\uff1b\u800cScale-Out,\u5c31\u662f\u6211\u4eec\u901a\u5e38\u6240\u8bf4\u7684\u6570\u636e\u5e93\u96c6\u7fa4\u65b9\u5f0f\uff0c \u5373\u901a\u8fc7\u589e\u52a0\u8fd0\u884c\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u6570\u91cf\u6765\u63d0\u9ad8\u7cfb\u7edf\u6574\u4f53\u7684\u80fd\u529b\uff0c\u800c\u5e94\u7528\u7a0b\u5e8f\u5219\u4e00\u822c\u9700\u8981\u8fdb\u884c\u76f8\u5e94\u7684\u4fee\u6539\u3002\u5728\u5e38\u89c1\u7684\u5546\u4e1a\u6570\u636e\u5e93\u4e2d\uff0cOracle\u5177\u6709\u5f88\u5f3a\u7684 Scale-Up\u7684\u80fd\u529b\uff0c\u5f88\u65e9\u5c31\u80fd\u591f\u652f\u6301\u51e0\u5341\u4e2a\u751a\u81f3\u6570\u767e\u4e2aCPU\uff0c\u8fd0\u884c\u5927\u578b\u5173\u952e\u4e1a\u52a1\u5e94\u7528\uff1b\u800c\u5fae\u8f6f\u7684SQL SERVER\uff0c\u65e9\u671f\u53d7Wintel\u67b6\u6784\u6240\u9650\uff0c\u4ee5Scale-Out\u8457\u79f0\uff0c\u4f46\u81ea\u4ece\u51e0\u5e74\u524d\u7a81\u7834\u4e86Wintel\u4f53\u7cfb\u67b6\u67848\u8defCPU\u7684\u7684\u9650\u5236\uff0cScale-Up\u7684 \u80fd\u529b\u4e00\u8def\u7a81\u98de\u731b\u8fdb\uff0c\u6700\u8fd1\u66f4\u662f\u53d1\u5e03\u4e86SQL 2008\u5728Windows 2008 R2\u7248\u8fd0\u884c256\u4e2aCPU\u6838\u5fc3(core)\u7684\u6d4b\u8bd5\u7ed3\u679c\uff0c\u5f00\u59cb\u6311\u6218Oracle\u7684\u9ad8\u7aef\u5e02\u573a\u3002\u800cMySQL\uff0c\u76f4\u5230\u4eca\u5e744\u6708\uff0c\u5728\u6700\u7ec8\u91c7\u7eb3\u4e86GOOGLE\u516c\u53f8\u8d21\u732e \u7684SMP\u6027\u80fd\u589e\u5f3a\u7684\u4ee3\u7801\u540e\uff0c\u53d1\u5e03\u4e86MySQL5.4\u540e\uff0c\u624d\u5f00\u59cb\u652f\u630116\u8defCPU\u7684X86\u7cfb\u7edf\u548c64\u8defCPU\u7684CMT\u7cfb\u7edf(\u57fa\u4e8eSun UltraSPARC \u7684\u7cfb\u7edf\uff09\u3002<br \/>\n<!-- -->\u4ece\u53e6\u4e00\u65b9\u9762\u6765\u8bf4\uff0cScale-Up\u53d7\u8f6f\u786c\u4ef6\u4f53\u7cfb\u7684\u9650\u5236\uff0c\u4e0d\u53ef\u80fd\u65e0\u9650\u589e\u52a0\uff23\uff30\uff35\u548c\u5185\u5b58\uff0c\u76f8\u53cdScale-Out\u5374\u662f\u53ef\u4ee5&quot;\u51e0\u4e4e&quot;\u65e0\u9650\u7684\u6269\u5c55,\u4ee5Google \u4e3a\u4f8b\uff0c\uff12006\u5e74Google\u4e00\u5171\u6709\u8d85\u8fc7\uff14\uff15\u4e07\u53f0\u670d\u52a1\u5668\uff08\u8c01\u80fd\u544a\u8bc9\u6211\u73b0\u5728\u4ed6\u4eec\u6709\u591a\u5c11\uff1f\uff01\uff09\uff1b\u800c\u4e14\u5927\u578b\uff33\uff2d\uff30\u670d\u52a1\u5668\u7684\u4ef7\u683c\u8fdc\u8fdc\u8d85\u8fc7\u666e\u901a\u7684\u53cc\u8def\u670d\u52a1\u5668\uff0c\u5bf9\u4e8e\u5f88 \u591a\u521a\u521a\u8d77\u6b65\u6216\u662f\u4e1a\u52a1\u589e\u957f\u5f88\u96be\u9884\u6d4b\u7684\u7f51\u7ad9\u6765\u8bf4\uff0c\u4e0d\u53ef\u80fd\u4e5f\u6ca1\u5fc5\u8981\u4e00\u6b21\u6027\u6295\u8d44\u8d2d\u4e70\u5927\u578b\u7684\u786c\u4ef6\u8bbe\u5907\uff0c\u56e0\u800c\u867d\u7136Scale-Out\u4f1a\u968f\u7740\u670d\u52a1\u5668\u6570\u91cf\u7684\u589e\u591a\u800c\u5e26\u6765\u7ba1 \u7406\uff0c\u90e8\u7f72\u548c\u7ef4\u62a4\u7684\u6210\u672c\u6025\u5267\u4e0a\u5347\uff0c\u4f46\u786e\u662f\u5927\u591a\u6570\u5927\u578b\u7f51\u7ad9\u5f53\u7136\u4e5f\u5305\u62ecFlickr\u7684\u552f\u4e00\u9009\u62e9\u3002<br \/>\n<!-- -->\u7ecf\u8fc7\u7edf\u8ba1\uff0cFlickr\u7684\u6280\u672f\u4eba\u5458\u53d1\u73b0\uff0c\u67e5\u8be2\u5373SELECT\u8bed\u53e5\u7684\u6570\u91cf\u8981\u8fdc\u8fdc\u5927\u4e8e\u6dfb\u52a0\uff0c\u66f4\u65b0\u548c<br \/>\n<!-- -->\u5220\u9664\u7684\u6570\u91cf\uff0c\u6bd4\u4f8b\u8fbe\u5230\u4e86\u5927\u7ea613\uff1a1\u751a\u81f3\u66f4\u591a\uff0c\u6240\u4ee5\u4ed6\u4eec\u91c7\u7528\u4e86\u201cMaster-Slave\u201d\u7684\u590d\u5236\u6a21\u5f0f\uff0c\u5373\u6240\u6709\u7684\u201c\u5199\u201d\u64cd\u4f5c\u90fd\u5728\u53d1\u751f\u5728\u201cMaster&quot;\uff0c \u7136\u540e\u201d\u5f02\u6b65\u201c\u590d\u5236\u5230\u4e00\u53f0\u6216\u591a\u53f0\u201cSlave&quot;\u4e0a\uff0c\u800c\u6240\u6709\u7684\u201d\u8bfb\u201c\u64cd\u4f5c\u90fd\u8f6c\u5230\u201dSlave&quot;\u4e0a\u8fd0\u884c\uff0c\u8fd9\u6837\u968f\u7740\u201c\u8bfb\u201d\u4ea4\u6613\u91cf\u7684\u589e\u52a0\uff0c\u53ea\u9700\u589e\u52a0Slave\u670d\u52a1\u5668 \u5c31\u53ef\u4ee5\u4e86\u3002\u00a0\u00a0\u00a0<br \/>\n<img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/><br \/>\n<!-- -->\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u5e94\u7528\u7cfb\u7edf\u5e94\u8be5\u5982\u4f55\u4fee\u6539\u6765\u9002\u5e94\u8fd9\u6837\u7684\u67b6\u6784\uff0c\u9664\u4e86\u201d\u8bfb\/\u5199\u201c\u5206\u79bb\u5916\uff0c\u5bf9\u4e8e\u201d\u8bfb\u201c\u64cd\u4f5c\u6700\u57fa\u672c\u7684\u8981\u6c42\u662f\uff1a1\uff09\u5e94\u7528\u7a0b\u5e8f\u80fd\u591f\u5728\u591a\u4e2a\u201dSlave\u201c\u4e0a\u8fdb \u884c\u8d1f\u8f7d\u5747\u5206\uff1b2\uff09\u5f53\u4e00\u4e2a\u6216\u591a\u4e2a\u201dslave&quot;\u51fa\u73b0\u6545\u969c\u65f6\uff0c\u5e94\u7528\u7a0b\u5e8f\u80fd\u81ea\u52a8\u5c1d\u8bd5\u4e0b\u4e00\u4e2a\u201cslave\u201d\uff0c\u5982\u679c\u5168\u90e8\u201cSlave&quot;\u5931\u6548\uff0c\u5219\u8fd4\u56de\u9519\u8bef\u3002 Flickr\u66fe\u7ecf\u8003\u8651\u8fc7\u7684\u65b9\u6848\u662f\u5728Web\u5e94\u7528\u548c\u201dSlave\u201c\u7fa4\u4e4b\u95f4\u52a0\u5165\u4e00\u4e2a\u786c\u4ef6\u6216\u8f6f\u4ef6\u7684\u201dLoad Balancer\u201c\uff0c\u5982\u4e0b\u56fe<br \/>\n<img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/><br \/>\n<!-- -->\u8fd9\u6837\u7684\u597d\u5904\u662f\u5e94\u7528\u6240\u9700\u7684\u6539\u52a8\u6700\u5c0f\uff0c\u56e0\u4e3a\u5bf9\u4e8e\u5e94\u7528\u6765\u8bf4\uff0c\u6240\u6709\u7684\u8bfb\u64cd\u4f5c\u90fd\u662f\u901a\u8fc7\u4e00\u4e2a\u865a\u62df\u7684Slave\u6765\u8fdb\u884c\uff0c\u6dfb\u52a0\u548c\u5220\u9664\u201cSlave&quot;\u670d\u52a1\u5668\u5bf9\u5e94\u7528\u900f \u660e\uff0cLoad Balancer \u5b9e\u73b0\u5bf9\u5404\u4e2aSlave\u670d\u52a1\u5668\u72b6\u6001\u7684\u76d1\u63a7\u5e76\u5c06\u51fa\u73b0\u6545\u969c\u7684Slave\u4ece\u53ef\u7528\u8282\u70b9\u5217\u8868\u91cc\u5220\u9664\uff0c\u5e76\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e9b\u590d\u6742\u7684\u8d1f\u8f7d\u5206\u62c5\u7b56\u7565\uff0c\u6bd4\u5982\u65b0\u4e70\u7684\u670d\u52a1\u5668\u5904\u7406\u80fd\u529b\u8981\u9ad8 \u8fc7Slave\u7fa4\u4e2d\u5176\u4ed6\u7684\u8001\u673a\u5668\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u7ed9\u8fd9\u4e2a\u673a\u5668\u591a\u5206\u914d\u4e00\u4e9b\u8d1f\u8f7d\u4ee5\u6700\u6709\u6548\u7684\u5229\u7528\u8d44\u6e90\u3002\u4e00\u4e2a\u7b80\u5355\u7684\u5229\u7528Apache proxy_balancer_module\u7684\u4f8b\u5b50\u5982\u4e0b\uff1a**<br \/>\n**<\/p>\n<hr \/>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/>46<br \/>47<br \/>48<br \/>49<br \/>50<br \/>51<br \/>52<br \/>53<br \/>54<br \/>55<br \/>56<br \/>57<br \/>58<br \/>59<br \/>60<br \/>61<br \/>62<br \/><\/div><\/td><td><div class=\"text codecolorer\">1\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002 <br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n3 <br \/>\n4 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n5<br \/>\n6 <br \/>\n7 &nbsp; &nbsp; &nbsp; &nbsp; LoadModule proxy_module modules\/mod_proxy.so <br \/>\n8 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n9 <br \/>\n10 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n11<br \/>\n12 <br \/>\n13 &nbsp; &nbsp; &nbsp; &nbsp; LoadModule proxy_balancer_module modules\/mod_proxy_balancer.so <br \/>\n14 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n15 <br \/>\n16 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n17<br \/>\n18 <br \/>\n19 &nbsp; &nbsp; &nbsp; &nbsp; LoadModule proxy_http_module modules\/mod_proxy_http.so <br \/>\n20 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n21 <br \/>\n22 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n23<br \/>\n24 <br \/>\n25 &nbsp; &nbsp; &nbsp; &nbsp; \u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002 <br \/>\n26 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n27 <br \/>\n28 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n29<br \/>\n30 <br \/>\n31 &nbsp; &nbsp; &nbsp; &nbsp; &amp;lt;Proxy &nbsp;balancer:\/\/mycluster&amp;gt; <br \/>\n32 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n33 <br \/>\n34 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n35<br \/>\n36 <br \/>\n37 &nbsp; &nbsp; &nbsp; &nbsp; BalancerMember &amp;quot;http:\/\/slave1:8008\/App&amp;quot;\u00a0\u00a0 loadfactor=4 <br \/>\n38 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n39 <br \/>\n40 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n41<br \/>\n42 <br \/>\n43 &nbsp; &nbsp; &nbsp; &nbsp; BalancerMember &amp;quot;http:\/\/slave2:8008\/App&amp;quot;\u00a0\u00a0 loadfactor=3 <br \/>\n44 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n45 <br \/>\n46 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n47<br \/>\n48 <br \/>\n49 &nbsp; &nbsp; &nbsp; &nbsp; BalancerMember &amp;quot;http:\/\/slave3:8008\/App&amp;quot;\u00a0\u00a0 loadfactor=3 <br \/>\n50 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n51 <br \/>\n52 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n53<br \/>\n54 <br \/>\n55 &nbsp; &nbsp; &nbsp; &nbsp; .................... <br \/>\n56 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n57 <br \/>\n58 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n59<br \/>\n60 <br \/>\n61 &nbsp; &nbsp; &nbsp; &nbsp; \/\/\/slave load ratio 4:3:3.<br \/>\n62<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<p>\u6700\u7ec8\uff0cFlickr\u91c7\u7528\u4e86\u4e00\u79cd\u975e\u5e38\u201c\u8f7b\u91cf\u201d\u4f46\u6709\u6548\u7684\u201c\u7b80\u6613\u201dPHP\u5b9e\u73b0\uff0c\u57fa\u672c\u7684\u4ee3\u7801\u53ea\u670910\u51e0\u884c\uff1a<\/p>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-php\" style=\"overflow:auto;white-space:nowrap;width:800px;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/>46<br \/>47<br \/>48<br \/>49<br \/>50<br \/>51<br \/>52<br \/>53<br \/>54<br \/>55<br \/>56<br \/>57<br \/>58<br \/>59<br \/>60<br \/>61<br \/>62<br \/>63<br \/>64<br \/>65<br \/>66<br \/>67<br \/>68<br \/>69<br \/>70<br \/>71<br \/>72<br \/>73<br \/>74<br \/>75<br \/>76<br \/>77<br \/>78<br \/>79<br \/>80<br \/>81<br \/>82<br \/>83<br \/>84<br \/>85<br \/>86<br \/>87<br \/>88<br \/>89<br \/>90<br \/>91<br \/>92<br \/>93<br \/>94<br \/>95<br \/>96<br \/>97<br \/>98<br \/>99<br \/>100<br \/>101<br \/>102<br \/>103<br \/>104<br \/>105<br \/>106<br \/>107<br \/>108<br \/>109<br \/>110<br \/>111<br \/>112<br \/>113<br \/>114<br \/>115<br \/>116<br \/><\/div><\/td><td><div class=\"text codecolorer\">1function <br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;db_connect( <br \/>\n3 &nbsp; &nbsp; &nbsp; &nbsp; $hosts <br \/>\n4 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n5 &nbsp; &nbsp; &nbsp; &nbsp; $user <br \/>\n6 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n7 &nbsp; &nbsp; &nbsp; &nbsp; $pass <br \/>\n8 &nbsp; &nbsp; &nbsp; &nbsp; ){ <br \/>\n9 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n10 <br \/>\n11 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n12<br \/>\n13 <br \/>\n14 &nbsp; &nbsp; &nbsp; &nbsp; shuffle( <br \/>\n15 &nbsp; &nbsp; &nbsp; &nbsp; $hosts <br \/>\n16 &nbsp; &nbsp; &nbsp; &nbsp; );\u00a0\u00a0\u00a0\u00a0 &nbsp;<br \/>\n17 &nbsp; &nbsp; &nbsp; &nbsp; \/\/shuffle()\u662fPHP\u51fd\u6570\uff0c\u4f5c\u7528\u662f\u5c06\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u987a\u5e8f\u968f\u673a\u6253\u4e71\u3002 <br \/>\n18 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n19 <br \/>\n20 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n21<br \/>\n22 <br \/>\n23 &nbsp; &nbsp; &nbsp; &nbsp; foreach <br \/>\n24 &nbsp; &nbsp; &nbsp; &nbsp; ( <br \/>\n25 &nbsp; &nbsp; &nbsp; &nbsp; $hosts <br \/>\n26 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;as <br \/>\n27 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$host <br \/>\n28 &nbsp; &nbsp; &nbsp; &nbsp; ){ <br \/>\n29 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n30 <br \/>\n31 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n32<br \/>\n33 <br \/>\n34 &nbsp; &nbsp; &nbsp; &nbsp; debug( <br \/>\n35 &nbsp; &nbsp; &nbsp; &nbsp; &amp;quot;Trying to connect to $host...&amp;quot; <br \/>\n36 &nbsp; &nbsp; &nbsp; &nbsp; ); <br \/>\n37 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n38 <br \/>\n39 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n40<br \/>\n41 <br \/>\n42 &nbsp; &nbsp; &nbsp; &nbsp; $dbh <br \/>\n43 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= @mysql_connect( <br \/>\n44 &nbsp; &nbsp; &nbsp; &nbsp; $host <br \/>\n45 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n46 &nbsp; &nbsp; &nbsp; &nbsp; $user <br \/>\n47 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n48 &nbsp; &nbsp; &nbsp; &nbsp; $pass <br \/>\n49 &nbsp; &nbsp; &nbsp; &nbsp; , 1); <br \/>\n50 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n51 <br \/>\n52 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n53<br \/>\n54 <br \/>\n55 &nbsp; &nbsp; &nbsp; &nbsp; if <br \/>\n56 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( <br \/>\n57 &nbsp; &nbsp; &nbsp; &nbsp; $dbh <br \/>\n58 &nbsp; &nbsp; &nbsp; &nbsp; ){ <br \/>\n59 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n60 <br \/>\n61 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n62<br \/>\n63 <br \/>\n64 &nbsp; &nbsp; &nbsp; &nbsp; debug( <br \/>\n65 &nbsp; &nbsp; &nbsp; &nbsp; &amp;quot;Connected to $host!&amp;quot; <br \/>\n66 &nbsp; &nbsp; &nbsp; &nbsp; ); <br \/>\n67 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n68 <br \/>\n69 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n70<br \/>\n71 <br \/>\n72 &nbsp; &nbsp; &nbsp; &nbsp; return <br \/>\n73 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$dbh <br \/>\n74 &nbsp; &nbsp; &nbsp; &nbsp; ; <br \/>\n75 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n76 <br \/>\n77 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n78<br \/>\n79 <br \/>\n80 &nbsp; &nbsp; &nbsp; &nbsp; } <br \/>\n81 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n82 <br \/>\n83 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n84<br \/>\n85 <br \/>\n86 &nbsp; &nbsp; &nbsp; &nbsp; debug( <br \/>\n87 &nbsp; &nbsp; &nbsp; &nbsp; &amp;quot;Failed to connect to $host!&amp;quot; <br \/>\n88 &nbsp; &nbsp; &nbsp; &nbsp; ); <br \/>\n89 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n90 <br \/>\n91 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n92<br \/>\n93 <br \/>\n94 &nbsp; &nbsp; &nbsp; &nbsp; } <br \/>\n95 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n96 <br \/>\n97 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n98<br \/>\n99 <br \/>\n100 &nbsp; &nbsp; &nbsp; &nbsp; debug( <br \/>\n101 &nbsp; &nbsp; &nbsp; &nbsp; &amp;quot;Failed to connect to all hosts in list - giving up!&amp;quot; <br \/>\n102 &nbsp; &nbsp; &nbsp; &nbsp; ); <br \/>\n103 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n104 <br \/>\n105 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n106<br \/>\n107 <br \/>\n108 &nbsp; &nbsp; &nbsp; &nbsp; return <br \/>\n109 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0; <br \/>\n110 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n111 <br \/>\n112 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n113<br \/>\n114 <br \/>\n115 &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>\n116<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">1 &nbsp;\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u5982\u679c\u9700\u8981\u5bf9\u7279\u5b9a\u7684Slave\u8d4b\u4e88\u66f4\u9ad8\u7684\u8d1f\u8f7d\uff0c\u53ea\u8981\u5728$hosts\u4e2d\u591a\u51fa\u73b0\u4e00\u6b21\u6216\u591a\u6b21\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6bb5\u4ee3\u7801\u53ea\u8981\u7a0d\u7a0d\u6539\u8fdb\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u529f\u80fd\uff0c\u5982\u5f53connect\u5931\u8d25\u65f6\u81ea\u52a8\u5c06host\u4ecehosts\u5217\u8868\u4e2d\u53bb\u9664\u7b49\u3002 &nbsp; <br \/>\n2<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<p>\u201cMaster\u201d-&quot;Slave&quot;\u6a21\u5f0f\u7684\u7f3a\u70b9\u662f\u5b83\u5e76\u6ca1\u6709\u5bf9\u4e8e\u201c\u5199&#x27;\u64cd\u4f5c\u63d0\u4f9b\u6269\u5c55\u80fd\u529b\uff0c\u800c\u4e14\u5b58\u5728\u5355\u70b9\u6545\u969c\uff0c\u5373\u4e00\u65e6Master\u6545\u969c\uff0c\u6574\u4e2a\u7f51\u7ad9\u5c06\u4e27\u5931\u201c\u66f4\u65b0\u201d \u7684\u80fd\u529b\u3002\u89e3\u51b3\u7684\u529e\u6cd5\u91c7\u7528\u201cMaster&quot;-&quot;Master&quot;\u6a21\u5f0f\uff0c\u5373\u4e24\u53f0\u670d\u52a1\u5668\u4e92\u4e3a\u201dMaster\u201c-&quot;Slave&quot;,\u8fd9\u6837\u4e0d\u4ec5\u201d\u8bfb\/\u5199\u201c\u80fd\u529b\u6269\u5c55\u4e86\u4e00 \u500d\uff0c\u800c\u4e14\u6709\u6548\u907f\u514d\u4e86\u201d\u5355\u70b9\u6545\u969c\u201c\uff0c\u7ed3\u5408\u5df2\u6709\u7684\u201cMaster&quot;-&quot;Slave&quot;,\u6574\u4e2a\u6570\u636e\u5e93\u7684\u67b6\u6784\u5c31\u53d8\u6210\u4e86\u4e0b\u9762\u7684\u201d\u53cc\u6811\u201c\u7ed3\u6784\uff0c<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/>\u3002<br \/>\n<!-- -->\u201c\u53cc\u6811\u201d\u67b6\u6784\u5e76\u6ca1\u6709\u652f\u6491\u592a\u4e45\u7684\u65f6\u95f4\uff0c\u5927\u69826\u4e2a\u6708\u540e\uff0c\u968f\u7740\u7528\u6237\u7684\u6fc0\u589e\uff0c\u7cfb\u7edf\u518d\u4e00\u6b21\u8fbe\u5230\u4e86\u6781\u9650\uff0c\u4e0d\u4ec5\u201d\u5199\u201d\u64cd\u4f5c\u6210\u4e3a\u4e86\u74f6\u9888\uff0c\u800c\u4e14\u201c\u5f02\u6b65\u590d\u5236&quot;\u4e5f\u7531\u4e8e \u201dSlave\u201c\u670d\u52a1\u5668\u8fc7\u4e8e\u7e41\u5fd9\u800c\u51fa\u73b0\u4e86\u4e25\u91cd\u7684\u6ede\u540e\u800c\u9020\u6210\u8bfb\u6570\u636e\u7684\u4e0d\u4e00\u81f4\u3002\u90a3\u4e48\uff0c\u80fd\u4e0d\u80fd\u5728\u73b0\u6709\u67b6\u6784\u52a0\u4ee5\u89e3\u51b3\uff0c\u6bd4\u5982\u8bf4\u589e\u52a0\u65b0\u7684\u201dMaster\u201c\u670d\u52a1\u5668\u548c\u8003\u8651\u91c7 \u7528\u201d\u540c\u6b65\u590d\u5236\u201c\u5462\uff1f\u7b54\u6848\u662f\u5426\u5b9a\u7684\uff0c\u5728Master\u8d85\u8fc7\u4e24\u53f0\u7684\u8bbe\u7f6e\u4e2d\uff0c\u53ea\u80fd\u91c7\u7528\u201d\u95ed\u73af\u94fe\u201c\u7684\u65b9\u5f0f\u8fdb\u884c\u590d\u5236\uff0c\u5728\u5927\u6570\u636e\u91cf\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u5f88\u5bb9\u6613\u9020\u6210\u5728\u4efb\u610f\u65f6\u523b\u6ca1 \u6709\u4e00\u4e2aMaster\u6216Slave\u8282\u70b9\u662f\u5177\u6709\u5168\u90e8\u6700\u65b0\u6570\u636e\u7684\uff08\u6709\u70b9\u7c7b\u4f3c\u4e8e\u201d\u4eba\u4e00\u6b21\u4e5f\u4e0d\u80fd\u8e0f\u8fdb\u540c\u4e00\u6761\u6cb3\u201c\uff1f\uff09\uff0c\u8fd9\u6837\u5f88\u96be\u4fdd\u969c\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u800c\u4e14\u4e00\u65e6\u5176\u4e2d\u4e00\u4e2aMaster\u51fa\u73b0\u6545\u969c\uff0c\u5c06\u4e2d\u65ad\u6574\u4e2a\u590d\u5236\u94fe\uff1b\u800c\u5bf9\u4e8e\u201d\u540c\u6b65\u590d\u5236\u201c\uff0c\u5f53\u7136\u8fd9\u662f\u6d88\u9664\u201d\u590d\u5236\u6ede\u540e\u201c\u7684\u6700\u597d\u529e\u6cd5\uff0c\u4e0d\u8fc7\u5728\u5f53\u65f6MySQL\u7684\u540c\u6b65\u590d\u5236\u8fd8\u8fdc\u6ca1\u6709\u6210\u719f\u5230\u53ef\u4ee5\u8fd0\u7528\u5728\u6295\u4ea7\u73af\u5883\u4e2d\u3002<\/p>\n<p>Flickr\u7f51\u7ad9\u7684\u67b6\u6784\uff0c\u9700\u8981\u4e00\u6b21\u5927\u7684\u53d8\u5316\u6765\u89e3\u51b3\u957f\u671f\u6301\u7eed\u6269\u5c55\u7684\u95ee\u9898\u3002<\/p>\n<p><strong>Shard &#8211; \u5927\u578b\u7f51\u7ad9\u6570\u636e\u5e93\u6269\u5c55\u7684\u7ec8\u6781\u6b66\u5668\uff1f<\/strong><\/p>\n<p>2005\u5e74\uff17\u6708\uff0c\u53e6\u4e00\u4f4d\u5927\u725b(MySQL 2005\u30012006\u5e74\u5ea6 &quot;Application of the Year Award&quot;\u83b7\u5f97\u8005)Dathan Pattishall\u52a0\u5165\u4e86Flickr\u56e2\u961f\u3002\u4e00\u4e2a\u661f\u671f\u4e4b\u5185\uff0cDathan\u89e3\u51b3\u4e86Flickr\u6570\u636e\u5e9340%\u7684\u95ee\u9898\uff0c\u66f4\u91cd\u8981\u7684\u662f\uff0c\u4ed6\u4e3aFlickr\u5f15\u8fdb\u4e86 Shard\u67b6\u6784\uff0c\u4ece\u800c\u4f7fFlickr\u7f51\u7ad9\u5177\u5907\u4e86\u771f\u6b63\u201c\u7ebf\u6027\u201dScale-Out\u7684\u589e\u957f\u80fd\u529b\uff0c\u5e76\u4e00\u76f4\u6cbf\u7528\u81f3\u4eca\uff0c\u53d6\u5f97\u4e86\u5de8\u5927\u7684\u6210\u529f\u3002\u00a0<br \/>\n<!-- -->Shard\u4e3b\u8981\u662f\u4e3a\u4e86\u89e3\u51b3\u4f20\u7edf\u6570\u636e\u5e93Master\/Slave\u6a21\u5f0f\u4e0b\u5355\u4e00Master\u6570\u636e\u5e93\u7684\u201c\u5199\u201d\u74f6\u9888\u800c\u51fa\u73b0\u7684\uff0c\u7b80\u5355\u7684\u8bf4Shard\u5c31\u662f\u5c06\u4e00\u4e2a\u5927\u8868\u5206 \u5272\u6210\u591a\u4e2a\u5c0f\u8868\uff0c\u6bcf\u4e2a\u5c0f\u8868\u5b58\u50a8\u5728\u4e0d\u540c\u673a\u5668\u7684\u6570\u636e\u5e93\u4e0a\uff0c\u4ece\u800c\u5c06\u8d1f\u8f7d\u5206\u6563\u5230\u591a\u4e2a\u673a\u5668\u5e76\u884c\u5904\u7406\u800c\u6781\u5927\u7684\u63d0\u9ad8\u6574\u4e2a\u7cfb\u7edf\u7684\u201c\u5199\u201d\u6269\u5c55\u80fd\u529b\u3002\u76f8\u6bd4\u4f20\u7edf\u65b9\u5f0f\uff0c\u7531\u4e8e\u6bcf\u4e2a\u6570\u636e \u5e93\u90fd\u76f8\u5bf9\u8f83\u5c0f\uff0c\u4e0d\u4ec5\u8bfb\u5199\u64cd\u4f5c\u66f4\u5feb\uff0c\u751a\u81f3\u53ef\u4ee5\u5c06\u6574\u4e2a\u5c0f\u6570\u636e\u5e93\u7f13\u5b58\u5230\u5185\u5b58\u4e2d\uff0c\u800c\u4e14\u6bcf\u4e2a\u5c0f\u6570\u636e\u5e93\u7684\u5907\u4efd\uff0c\u6062\u590d\u4e5f\u53d8\u5f97\u76f8\u5bf9\u5bb9\u6613\uff0c\u540c\u65f6\u7531\u4e8e\u5206\u6563\u4e86\u98ce\u9669\uff0c\u5355\u4e2a\u5c0f\u6570\u636e\u5e93 \u7684\u6545\u969c\u4e0d\u4f1a\u5f71\u54cd\u5176\u4ed6\u7684\u6570\u636e\u5e93\uff0c\u4f7f\u6574\u4e2a\u7cfb\u7edf\u7684\u53ef\u9760\u6027\u4e5f\u5f97\u5230\u4e86\u663e\u8457\u7684\u63d0\u9ad8\u3002<br \/>\n<!-- -->\u5bf9\u4e8e\u5927\u591a\u6570\u7f51\u7ad9\u6765\u8bf4\uff0c\u4ee5\u7528\u6237\u4e3a\u5355\u4f4d\u8fdb\u884cShard\u5206\u5272\u662f\u6700\u5408\u9002\u4e0d\u8fc7\u7684\uff0c\u5e38\u89c1\u7684\u5206\u5272\u65b9\u6cd5\u6709\u6309\u5730\u57df\uff08\u6bd4\u5982\u90ae\u7f16\uff09\uff0c\u6309Key\u503c\uff08\u6bd4\u5982Hash\u7528\u6237ID),\u8fd9\u4e9b \u65b9\u6cd5\u53ef\u4ee5\u7b80\u5355\u7684\u901a\u8fc7\u5e94\u7528\u914d\u7f6e\u6587\u4ef6\u6216\u7b97\u6cd5\u6765\u5b9e\u73b0\uff0c\u4e00\u822c\u4e0d\u9700\u8981\u53e6\u5916\u7684\u6570\u636e\u5e93\uff0c\u7f3a\u70b9\u662f\u4e00\u65e6\u4e1a\u52a1\u589e\u52a0\uff0c\u9700\u8981\u518d\u6b21\u5206\u5272Shard\u65f6\u8981\u4fee\u6539\u73b0\u6709\u7684\u5e94\u7528\u7b97\u6cd5\u548c\u91cd\u65b0\u8ba1\u7b97\u6240 \u6709\u7684Shard KEY\u503c\uff1b\u800c\u6700\u4e3a\u7075\u6d3b\u7684\u505a\u6cd5\u662f\u4ee5\u201c\u76ee\u5f55\u201d\u670d\u52a1\u4e3a\u57fa\u7840\u7684\u5206\u5272\uff0c\u5373\u5728Shard\u4e4b\u524d\u52a0\u4e00\u4e2a\u4e2d\u592e\u6570\u636e\u5e93\uff08Global Lookup Cluster\uff09\uff0c\u5e94\u7528\u8981\u5148\u6839\u636e\u7528\u6237\u4e3b\u952e\u503c\u67e5\u8be2\u4e2d\u592e\u6570\u636e\u5e93\uff0c\u83b7\u5f97\u7528\u6237\u6570\u636e\u6240\u5728\u7684Shard\uff0c\u968f\u540e\u7684\u64cd\u4f5c\u518d\u8f6c\u5411Shard\u6240\u5728\u6570\u636e\u5e93\uff0c\u4f8b\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/><\/p>\n<p>\u800c\u5e94\u7528\u7684\u4e3b\u8981\u4fee\u6539\u5728\u4e8e\u8981\u6dfb\u52a0\u4e00\u4e2aLookup\u8bbf\u95ee\u5c42\uff0c\u4f8b\u5982\u5c06\u4ee5\u4e0b\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-csharp\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"text codecolorer\">1string <br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;connectionString = &nbsp;<br \/>\n3 &nbsp; &nbsp; &nbsp; &nbsp; @&amp;quot;Driver={MySQL};SERVER=dbserver;DATABASE=CustomerDB;&amp;quot; <br \/>\n4 &nbsp; &nbsp; &nbsp; &nbsp; ;\u00a0\u00a0\u00a0\u00a0\u00a0 &nbsp;<br \/>\n5 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n6 <br \/>\n7 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n8<br \/>\n9 <br \/>\n10 &nbsp; &nbsp; &nbsp; &nbsp; OdbcConnection conn = &nbsp;<br \/>\n11 &nbsp; &nbsp; &nbsp; &nbsp; new <br \/>\n12 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OdbcConnection(connectionString); <br \/>\n13 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n14 <br \/>\n15 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n16<br \/>\n17 <br \/>\n18 &nbsp; &nbsp; &nbsp; &nbsp; conn.Open();<br \/>\n19<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">1 &nbsp;\u53d8\u4e3a\uff1a <br \/>\n2<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-csharp\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/><\/div><\/td><td><div class=\"text codecolorer\">1string <br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;connectionString = GetDatabaseFor(customerId);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &nbsp;<br \/>\n3 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n4 <br \/>\n5 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n6<br \/>\n7 <br \/>\n8 &nbsp; &nbsp; &nbsp; &nbsp; OdbcConnection conn = &nbsp;<br \/>\n9 &nbsp; &nbsp; &nbsp; &nbsp; new <br \/>\n10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OdbcConnection(connectionString); <br \/>\n11 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n12 <br \/>\n13 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n14<br \/>\n15 <br \/>\n16 &nbsp; &nbsp; &nbsp; &nbsp; conn.Open();<br \/>\n17<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">1 &nbsp;GetDatabaseFor()\u51fd\u6570\u5b8c\u6210\u6839\u636e\u7528\u6237ID\u83b7\u53d6Shard connectionString\u7684\u4f5c\u7528\u3002 &nbsp; <br \/>\n2<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<p>\u5bf9\u5e94\u6211\u4eec\u524d\u9762\u6240\u63d0\u5230\u8fc7\u7684Flickr\u67b6\u6784<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/><br \/>\n<!-- -->Dual Tree Central Database\u5c31\u662f\u4e2d\u592e\u6570\u636e\u5e93\uff0c\u5b58\u653e\u7528\u6237\u8868\uff0c\u8bb0\u5f55\u7684\u4fe1\u606f\u662f\u7528\u6237\u4e3b\u952e\u4ee5\u53ca\u6b64\u7528\u6237\u5bf9\u4ee5\u7684\u6570\u636e\u5e93Shard\u533a\uff1b\u800cMaster-Master Shards\u5c31\u662f\u4e00\u4e2a\u4e2a\u7684Shard\u7528\u6237\u6570\u636e\u5e93\uff0c\u5b58\u50a8\u5b9e\u9645\u7684\u7528\u6237\u6570\u636e\u548c\u7167\u7247\u7684\u5143\u6570\u636e\uff08Meta Data)\u3002<\/p>\n<p>Flickr Shard\u7684\u8bbe\u8ba1\u6211\u4eec\u5728Flickr \u7f51\u7ad9\u67b6\u6784\u7814\u7a76\uff08\uff11\uff09\u4e2d\u5df2\u7ecf\u603b\u7ed3\u8fc7\u4e86\uff0c\u5728\u6b64\u4e0d\u518d\u8d58\u8ff0\u3002\u6211\u4eec\u5728\u6b64\u8c08\u4e00\u4e0bShard\u67b6\u6784\u7684\u4e3b\u8981\u95ee\u9898\u548cFlickr\u7684\u89e3\u51b3\u529e\u6cd5\uff1a\uff11\uff09Shard\u53ea\u9002\u7528\u4e8e\u4e0d\u9700\u8981 join\u64cd\u4f5c\u7684\u8868\uff0c\u56e0\u4e3a\u8de8Shard\u3000join\u64cd\u4f5c\u7684\u5f00\u9500\u592a\u5927\uff0c\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u5c06\u4e00\u4e2a\u7528\u6237\u7684\u6240\u6709\u6570\u636e\u5168\u90e8\u5b58\u653e\u5728\u540c\u4e00\u4e2aShard\u91cc\uff0c\u5bf9\u4e8e\u4e00\u4e9b\u4f20\u7edf\u65b9\u5f0f\u4e0b\u9700\u8981 \u8de8Shard\u67e5\u8be2\u7684\u6570\u636e\uff0c\u53ea\u80fd\u91c7\u53d6\u5197\u4f59\u7684\u65b9\u6cd5\uff0c\u6bd4\u5982Shard1\u7684\u7528\u6237A\u5bf9Shard2\u7684\u7528\u6237B\u7684\u7167\u7247\u8fdb\u884c\u4e86\u8bc4\u8bba\uff0c\u90a3\u4e48\u8fd9\u6761\u8bc4\u8bba\u5c06\u540c\u65f6\u5b58\u653e\u5728Shard1 \u548cShard2\u4e2d\u3002\u8fd9\u6837\u5c31\u5b58\u5728\u4e00\u4e2a\u6570\u636e\u4e00\u81f4\u6027\u7684\u95ee\u9898\uff0c\u5e38\u89c4\u7684\u505a\u6cd5\u662f\u7528\u6570\u636e\u5e93\u4e8b\u52a1(Transaction)\u3001\u201d\u4e24\u9636\u6bb5\u63d0\u4ea4\u201c(2 phase commit)\u6765\u89e3\u51b3\uff0c\u4f46\u505a\u8fc7\u4e24\u9636\u6bb5\u63d0\u4ea4\uff082PC\uff09\u5e94\u7528\u7684\u90fd\u77e5\u9053\uff0c2PC\u7684\u6548\u7387\u76f8\u5bf9\u8f83\u5dee\uff0c\u800c\u4e14\u5b9e\u9645\u4e0a\u4e5f\u4e0d\u80fd100%\u4fdd\u8bc1\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\uff1b\u53e6\u5916\uff0c\u4e00\u65e6 \u7531\u4e8e\u5176\u4e2d\u4e00\u4e2aShard\u6545\u969c\u800c\u63d0\u4ea4\u5931\u8d25\u56de\u6eda\uff0c\u7528\u6237\u53ea\u80fd\u653e\u5f03\u6216\u518d\u8bd5\u4e00\u904d\uff0c\u7528\u6237\u4f53\u9a8c\u8f83\u5dee\u3002Flickr\u5bf9\u4e8e\u6570\u636e\u4e00\u81f4\u6027\u7684\u89e3\u51b3\u65b9\u6848\u662fQueue\uff08Flickr\u7528 PHP\u5f00\u53d1\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684Queue\u7cfb\u7edf\uff0c\u5c06\u6240\u6709\u53ef\u4ee5\u5f02\u6b65\u7684\u4efb\u52a1\u90fd\u7528Queue\u6765\u5b9e\u73b0\uff0c\u6bcf\u5929\u5904\u7406\u9ad8\u8fbe\uff11\u5343\u4e07\u4ee5\u4e0a\u7684\u4efb\u52a1\u3002\uff09,\u4e8b\u5b9e\u4e0a\u5f53\u7528\u6237A\u5bf9\u7528\u6237B\u7684\u7167\u7247\u8fdb \u884c\u8bc4\u8bba\u65f6\uff0c\u4ed6\u5e76\u4e0d\u5173\u5fc3\u8fd9\u6761\u8bc4\u8bba\u4ec0\u4e48\u65f6\u5019\u51fa\u73b0\u5728\u7528\u6237B\u7684\u754c\u9762\u4e0a\uff0c\u5373\u5c06\u8fd9\u6761\u8bc4\u8bba\u6dfb\u52a0\u5230\u7528\u6237B\u7684\u4ea4\u6613\u662f\u53ef\u4ee5\u5f02\u6b65\u7684\uff0c\u5141\u8bb8\u4e00\u5b9a\u7684\u8fdf\u5ef6\uff0c\u901a\u8fc7Queue\u5904\u7406\uff0c\u65e2\u4fdd\u8bc1 \u4e86\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u53c8\u7f29\u77ed\u4e86\u7528\u6237\u7aef\u7684\u76f8\u5e94\u65f6\u95f4\uff0c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u6027\u80fd\u3002\uff12\uff09Shard\u7684\u53e6\u4e00\u4e2a\u4e3b\u8981\u95ee\u9898Rebalancing,\u65e2\u5f53\u73b0\u6709Shard\u7684\u8d1f\u8f7d\u8fbe\u5230\u4e00\u5b9a \u7684\u9600\u503c\uff0c\u5982\u4f55\u5c06\u73b0\u6709\u6570\u636e\u518d\u6b21\u5206\u5272\uff0cFlickr\u76ee\u524d\u7684\u65b9\u5f0f\u4f9d\u7136\u662f\u624b\u5de5\u7684\uff0c\u65e2\u4eba\u5de5\u6765\u786e\u5b9a\u54ea\u4e9b\u7528\u6237\u9700\u8981\u8fc1\u79fb\uff0c\u7136\u540e\u8fd0\u884c\u4e00\u4e2a\u540e\u53f0\u7a0b\u5e8f\u8fdb\u884c\u6570\u636e\u8fc1\u79fb\uff0c\u8fc1\u79fb\u7684\u8fc7\u7a0b\u7528 \u6237\u8d26\u6237\u5c06\u88ab\u9501\u4f4f\u3002\uff08\u636e\u8bf4Google\u505a\u5230\u4e86\u5b8c\u5168\u81ea\u52a8\u7684Rebalancing,\u672c\u7740\u201d\u8428\u5927\u201c\u5751\u91cc\u4e0d\u518d\u6316\u5751\u7684\u539f\u5219\uff0c\u5982\u679c\u6709\u673a\u4f1a\u7684\u8bdd\uff0c\u7559\u5230\u4e0b\u4e00\u4e2a\u7cfb\u5217\u518d\u7814\u7a76 \u5427\uff09<\/p>\n<p><strong><strong>Memcached\u7684\u5e94\u7528\u548c\u4e89\u8bba<\/strong><\/strong><\/p>\n<p>\u5927\u5bb6\u5e94\u8be5\u5df2\u7ecf\u6ce8\u610f\u5230\uff0cFlickr\u4e3a\u4e2d\u592e\u6570\u636e\u5e93\u914d\u7f6e\u4e86Memcached\u4f5c\u4e3a\u6570\u636e\u5e93\u7f13\u5b58\uff0c\u63a5\u4e0b\u6765\u7684\u95ee\u9898\u662f\uff0c\u4e3a\u4ec0\u4e48\u7528Memcached?\u4e3a\u4ec0\u4e48 Shard\u4e0d\u9700\u8981Memcached?Memcached\u548cMaster,Slave\u7684\u5173\u7cfb\u600e\u6837\uff1f\u7b14\u8005\u5c06\u8bd5\u56fe\u56de\u7b54\u8fd9\u4e9b\u95ee\u9898\u4f9b\u5927\u5bb6\u53c2\u8003\uff0c\u7f51\u4e0a\u7684\u76f8\u5173\u4e89\u8bba\u5f88 \u591a\uff0c\u6709\u4e9b\u95ee\u9898\u5c1a\u672a\u6709\u5b9a\u8bba\u3002<br \/>\n<!-- -->Memecached\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\uff0c\u5206\u5e03\u5f0f\u7684\uff0c\u5f00\u6e90\u7684\u5185\u5b58\u5bf9\u8c61\u7f13\u5b58\u7cfb\u7edf\uff0c\u987e\u540d\u601d\u4e49\uff0c\u5b83\u7684\u4e3b\u8981\u76ee\u7684\u662f\u5c06\u7ecf\u5e38\u8bfb\u53d6\u7684\u5bf9\u8c61\u653e\u5165\u5185\u5b58\u4ee5\u63d0\u9ad8\u6574\u4e2a\u7cfb\u7edf\uff0c\u5c24\u5176\u662f\u6570 \u636e\u5e93\u7684\u6269\u5c55\u80fd\u529b\u3002Memcached\u7684\u4e3b\u8981\u7ed3\u6784\u662f\u4e24\u4e2aHash Table,Server\u7aef\u7684HashTable\u4ee5key-value pair\u7684\u65b9\u5f0f\u5b58\u653e\u5bf9\u8c61\u503c\uff0c\u800cClient\u7aef\u7684HashTable\u7684\u5219\u51b3\u5b9a\u67d0\u4e00\u5bf9\u8c61\u5b58\u653e\u5728\u54ea\u4e00\u4e2aMemcached Server.\u4e3e\u4e2a\u4f8b\u5b50\u8bf4\uff0c\u540e\u53f0\u6709\uff13\u4e2aMemecached Server,A\u3001B\u3001C,Client1\u9700\u8981\u5c06\u4e00\u4e2a\u5bf9\u8c61\u540d\u4e3a\u201duserid123456\u201c\uff0c\u503c\u4e3a\u201c\u9c81\u4e01&quot;\u7684\u5b58\u5165\uff0c\u7ecf\u8fc7Client1\u7684Hash\u8ba1 \u7b97\uff0c&quot;userid123456&quot;\u7684\u503c\u5e94\u8be5\u653e\u5165Memcached ServerB, \u800c\u8fd9\u4e4b\u540e\uff0cClient2\u9700\u8981\u8bfb\u53d6&quot;userid123456&quot;\u7684\u503c\uff0c\u7ecf\u8fc7\u540c\u6837\u7684Hash\u8ba1\u7b97\uff0c\u5f97\u51fa&quot;userid123456&quot;\u7684\u503c\u5982\u679c\u5b58\u5728\u7684\u8bdd\u5e94\u8be5\u5728 Memcached ServerB\uff0c\u5e76\u4ece\u4e2d\u53d6\u51fa\u3002\u6700\u5999\u7684\u662fServer\u4e4b\u95f4\u5f7c\u6b64\u662f\u5b8c\u5168\u72ec\u7acb\u7684\uff0c\u5b8c\u5168\u4e0d\u77e5\u9053\u5bf9\u65b9\u7684\u5b58\u5728\uff0c\u6ca1\u6709\u4e00\u4e2a\u7c7b\u4f3c\u4e0eMaster\u6216Admin Server\u7684\u5b58\u5728\uff0c\u589e\u52a0\u548c\u51cf\u5c11Server\u53ea\u9700\u5728Client\u7aef&quot;\u6ce8\u518c&quot;\u5e76\u91cd\u65b0Hash\u5c31\u53ef\u4ee5\u4e86\u3002<br \/>\n<!-- -->Memcached\u4f5c\u4e3a\u6570\u636e\u5e93\u7f13\u5b58\u7684\u4f5c\u7528\u4e3b\u8981\u5728\u4e8e\u51cf\u8f7b\u751a\u81f3\u6d88\u9664\u9ad8\u8d1f\u8f7d\u6570\u636e\u5e93\u60c5\u51b5\u4e0b\u9891\u7e41\u8bfb\u53d6\u6240\u5e26\u6765\u7684Disk I\/O\u74f6\u9888\uff0c\u76f8\u5bf9\u4e8e\u6570\u636e\u5e93\u81ea\u8eab\u7684\u7f13\u5b58\u6765\u8bf4\uff0c\u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a\uff11\uff09Memecached\u7684\u7f13\u5b58\u662f\u5206\u5e03\u5f0f\u7684\uff0c\u800c\u6570\u636e\u5e93\u7684\u7f13\u5b58\u53ea\u9650\u4e8e\u672c\u673a\uff1b\uff12\uff09Memcached \u7f13\u5b58\u7684\u662f\u5bf9\u8c61\uff0c\u53ef\u4ee5\u662f\u7ecf\u8fc7\u590d\u6742\u8fd0\u7b97\u548c\u67e5\u8be2\u7684\u6700\u7ec8\u7ed3\u679c\uff0c\u5e76\u4e14\u4e0d\u9650\u4e8e\u6570\u636e\uff0c\u53ef\u4ee5\u662f\u4efb\u4f55\u5c0f\u4e8e\uff11MB\u7684\u5bf9\u8c61\uff0c\u6bd4\u5982html\u6587\u4ef6\u7b49\uff1b\u800c\u6570\u636e\u5e93\u7f13\u5b58\u662f\u4ee5&quot;row&quot;\u4e3a\u5355 \u4f4d\u7684\uff0c\u4e00\u65e6&quot;row&quot;\u4e2d\u7684\u4efb\u4f55\u6570\u636e\u66f4\u65b0\uff0c\u6574\u4e2a\u201crow&quot;\u5c06\u8fdb\u884c\u53ef\u80fd\u662f\u5bf9\u5e94\u7528\u6765\u8bf4\u4e0d\u5fc5\u8981\u7684\u66f4\u65b0\uff1b\uff13\uff09Memcached\u7684\u5b58\u53d6\u662f\u8f7b\u91cf\u7684\uff0c\u800c\u6570\u636e\u5e93\u7684\u5219\u76f8\u5bf9\u8f83 \u91cd\uff0c\u5728\u4f4e\u8d1f\u8f7d\u7684\u60c5\u51b5\u4e0b\uff0c\u4e00\u5bf9\u4e00\u7684\u6bd4\u8f83,Memcached\u7684\u6027\u80fd\u672a\u5fc5\u80fd\u8d85\u8fc7\u6570\u636e\u5e93\uff0c\u800c\u5728\u9ad8\u8d1f\u8f7d\u7684\u60c5\u51b5\u4e0b\u5219\u4f18\u52bf\u660e\u663e\u3002<br \/>\n<!-- -->Memcached\u5e76\u4e0d\u9002\u7528\u4e8e\u66f4\u65b0\u9891\u7e41\u7684\u6570\u636e\uff0c\u56e0\u4e3a\u9891\u7e41\u66f4\u65b0\u7684\u6570\u636e\u5bfc\u81f4\u5927\u91cf\u7684Memcached\u66f4\u65b0\u548c\u8f83\u4f4e\u7684\u7f13\u51b2\u547d\u4e2d\u7387\uff0c\u8fd9\u53ef\u80fd\u4e5f\u662f\u4e3a\u4ec0\u4e48Shard\u6ca1 \u6709\u96c6\u6210\u5b83\u7684\u539f\u56e0\uff1bMemcached\u66f4\u591a\u7684\u662f\u6269\u5c55\u4e86\u6570\u636e\u5e93\u7684\u201d\u8bfb\u201c\u64cd\u4f5c\uff0c\u8fd9\u4e00\u70b9\u4e0a\u5b83\u548cSlave\u7684\u4f5c\u7528\u6709\u91cd\u53e0\uff0c\u4ee5\u81f3\u4e8e\u6709\u4eba\u4e89\u8bba\u8bf4\u5e94\u8be5 \u8ba9&quot;Relication&quot;\u56de\u5230\u5b83\u6700\u521d\u7684\u76ee\u7684\u201dOnline Backup&quot;\u6570\u636e\u5e93\u4e0a\uff0c\u800c\u901a\u8fc7Memcached\u6765\u63d0\u4f9b\u6570\u636e\u5e93\u7684\u201c\u8bfb\u201d\u6269\u5c55\u3002\uff08\u5f53\u7136\u4e5f\u6709\u4eba\u8bf4\uff0c\u8003\u8651\u5230Memcached\u7684\u5bf9\u5e94\u7528\u5e26\u6765\u7684\u590d\u6742\u6027\uff0c\u8fd8\u662f\u614e \u7528\u3002\uff09<br \/>\n<!-- -->\u7136\u800c\uff0c\u5728\u4f53\u7cfb\u67b6\u6784\u4e2d\u589e\u52a0Memecached\u5e76\u4e0d\u662f\u6ca1\u6709\u4ee3\u4ef7\u7684\uff0c\u73b0\u6709\u7684\u5e94\u7528\u8981\u505a\u9002\u5f53\u7684\u4fee\u6539\u6765\u540c\u6b65Memcached\u548c\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\uff0c\u540c\u65f6Memcached\u4e0d\u63d0\u4f9b\u4efb\u4f55\u5197\u4f59\u548c\u201cfailover\u201d\u529f\u80fd\uff0c\u8fd9\u4e9b\u590d\u6742\u7684\u63a7\u5236\u90fd\u9700\u8981\u5e94\u7528\u6765\u5b9e\u73b0\u3002\u57fa\u672c\u7684\u5e94\u7528\u903b\u8f91\u5982\u4e0b\uff1a<\/p>\n<p>\u5bf9\u4e8e\u8bfb\u64cd\u4f5c\uff1a<\/p>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-php\" style=\"overflow:auto;white-space:nowrap;width:800px;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/><\/div><\/td><td><div class=\"text codecolorer\">1$data <br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= memcached_fetch( &nbsp;<br \/>\n3 &nbsp; &nbsp; &nbsp; &nbsp; $id <br \/>\n4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;); <br \/>\n5 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n6 <br \/>\n7 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n8<br \/>\n9 <br \/>\n10 &nbsp; &nbsp; &nbsp; &nbsp; return <br \/>\n11 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data <br \/>\n12 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <br \/>\n13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data <br \/>\n14 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n15 <br \/>\n16 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n17<br \/>\n18 <br \/>\n19 &nbsp; &nbsp; &nbsp; &nbsp; $data <br \/>\n20 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= db_fetch( &nbsp;<br \/>\n21 &nbsp; &nbsp; &nbsp; &nbsp; $id <br \/>\n22 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;); <br \/>\n23 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n24 <br \/>\n25 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n26<br \/>\n27 <br \/>\n28 &nbsp; &nbsp; &nbsp; &nbsp; memcached_store( &nbsp;<br \/>\n29 &nbsp; &nbsp; &nbsp; &nbsp; $id <br \/>\n30 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n31 &nbsp; &nbsp; &nbsp; &nbsp; $data <br \/>\n32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;); <br \/>\n33 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n34 <br \/>\n35 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n36<br \/>\n37 <br \/>\n38 &nbsp; &nbsp; &nbsp; &nbsp; return <br \/>\n39 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data <br \/>\n40 &nbsp; &nbsp; &nbsp; &nbsp; ;<br \/>\n41<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">1 &nbsp;\u5bf9\u4e8e\u5199\u64cd\u4f5c\uff1a &nbsp; <br \/>\n2<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-php\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/><\/div><\/td><td><div class=\"text codecolorer\">1db_store( &nbsp;<br \/>\n2 &nbsp; &nbsp; &nbsp; &nbsp; $id <br \/>\n3 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n4 &nbsp; &nbsp; &nbsp; &nbsp; $data <br \/>\n5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;); <br \/>\n6 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n7 <br \/>\n8 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n9<br \/>\n10 <br \/>\n11 &nbsp; &nbsp; &nbsp; &nbsp; memcached_store( &nbsp;<br \/>\n12 &nbsp; &nbsp; &nbsp; &nbsp; $id <br \/>\n13 &nbsp; &nbsp; &nbsp; &nbsp; , &nbsp;<br \/>\n14 &nbsp; &nbsp; &nbsp; &nbsp; $data <br \/>\n15 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);<br \/>\n16<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<pre>\n\n<div class=\"codecolorer-container text solarized-dark language-bash\" style=\"overflow:auto;white-space:nowrap;width:800px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">1 &nbsp;\u6211\u4eec\u770b\u5230\u5728\u6bcf\u4e00\u6b21\u6570\u636e\u66f4\u65b0\u90fd\u9700\u8981\u66f4\u65b0Memcached\uff0c\u800c\u4e14\u6570\u636e\u5e93\u6216Memcached\u4efb\u4f55\u4e00\u70b9\u5199\u9519\u8bef\u5e94\u7528\u5c31\u53ef\u80fd\u53d6\u5f97\u201c\u8fc7\u671f\u201d\u7684\u6570\u636e\u800c\u5f97\u5230\u9519\u8bef\u7684\u7ed3\u679c\uff0c\u5982\u4f55\u4fdd\u8bc1\u6570\u636e\u5e93\u548cMemcached\u7684\u540c\u6b65\u5462\uff1f <br \/>\n2<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n<\/pre>\n<p><strong><strong>\u590d\u5236\u6ede\u540e\u548c\u540c\u6b65\u95ee\u9898\u7684\u89e3\u51b3<\/strong><\/strong><\/p>\n<p>\u6211\u4eec\u77e5\u9053\u590d\u5236\u6ede\u540e\u7684\u4e3b\u8981\u539f\u56e0\u662f\u6570\u636e\u5e93\u8d1f\u8f7d\u8fc7\u5927\u800c\u9020\u6210\u5f02\u6b65\u590d\u5236\u7684\u5ef6\u8fdf\uff0cShard\u67b6\u6784\u6709\u6548\u7684\u5206\u6563\u4e86\u7cfb\u7edf\u8d1f\u8f7d\uff0c\u4ece\u800c\u5927\u5927\u51cf\u8f7b\u4e86\u8fd9\u4e00\u73b0\u8c61\uff0c\u4f46\u662f\u5e76\u4e0d\u80fd\u4ece\u6839\u672c\u4e0a\u6d88\u9664\uff0c\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\u8fd8\u662f\u8981\u9760\u826f\u597d\u7684\u5e94\u7528\u8bbe\u8ba1\u3002<br \/>\n<!-- -->\u5f53\u7528\u6237\u8bbf\u95ee\u5e76\u66f4\u65b0Shard\u6570\u636e\u65f6\uff0cFlickr\u91c7\u7528\u4e86\u5c06\u7528\u6237\u201c\u7c98\u201d\u5230\u67d0\u4e00\u673a\u5668\u7684\u505a\u6cd5\uff0c<br \/>\n<!-- -->$id = intval(substr($user_id, -10));<br \/>\n<!-- -->$id % $count_of_hosts_in_shard<br \/>\n<!-- -->\u5373\u540c\u4e00\u7528\u6237\u6bcf\u6b21\u767b\u5f55\u7684\u6240\u6709\u64cd\u4f5c\u5176\u5b9e\u90fd\u662f\u5728Shard\u4e2d\u7684\u4e00\u4e2aMaster\u4e0a\u8fd0\u884c\u7684\uff0c\u8fd9\u6837\u5373\u4f7f\u590d\u5236\u5230Slave\uff0c\u4e5f\u5c31\u662f\u53e6\u4e00\u53f0Master\u7684\u65f6\u5019\u6709\u5ef6\u65f6\uff0c\u4e5f\u4e0d\u4f1a\u5bf9\u7528\u6237\u6709\u5f71\u54cd\uff0c\u9664\u975e\u662f\u7528\u6237\u521a\u521a\u66f4\u65b0\uff0c\u5c1a\u672a\u590d\u5236\u800c\u8fd9\u53f0Master\u5c31\u51fa\u73b0\u6545\u969c\u4e86\uff0c\u4e0d\u8fc7\u8fd9\u79cd\u51e0\u7387\u5e94\u8be5\u5f88\u5c0f\u5427\u3002<br \/>\n<!-- -->\u5bf9\u4e8eCentral Database\u7684\u590d\u5236\u6ede\u540e\u548c\u540c\u6b65\u95ee\u9898\uff0cFlickr\u91c7\u7528\u4e86\u4e00\u79cd\u590d\u6742\u7684\u201cWrite Through Cache&quot;\u7684\u673a\u5236\u6765\u5904\u7406\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aqzt.com\/wp-content\/uploads\/20220222090802-40.jpg\" alt=\"\u70b9\u770b\u5168\u56fe\" \/>  &quot;Write Through Cache&quot;\u5c31\u662f\u5c06\u6240\u6709\u7684\u6570\u636e\u5e93\u201d\u5199\u201c\u64cd\u4f5c\u90fd\u5148\u5199\u5165\u201dCache&quot;\uff0c\u7136\u540e\u7531Cache\u7edf\u4e00\u53bb\u66f4\u65b0\u6570\u636e\u5e93\u7684\u5404\u4e2aNode,\u201cWrite Through Cache&quot;\u7ef4\u62a4\u6bcf\u4e00\u4e2aNode\u7684\u66f4\u65b0\u72b6\u6001\uff0c\u5f53\u6709\u8bfb\u8bf7\u6c42\u65f6\uff0c\u5373\u5c06\u8bf7\u6c42\u8f6c\u5411\u72b6\u6001\u4e3a\u201d\u5df2\u540c\u6b65\u201c\u7684Node\uff0c\u8fd9\u6837\u5373\u907f\u514d\u4e86\u590d\u5236\u6ede\u540e\u548cMemcached\u7684\u540c\u6b65\u95ee \u9898\uff0c\u4f46\u7f3a\u70b9\u662f\u5176\u5b9e\u73b0\u6781\u4e3a\u590d\u6742\uff0c\u201cWrite Throug Cache&quot;\u5c42\u7684\u4ee3\u7801\u9700\u8981\u8003\u8651\u548c\u5b9e\u73b0\u6240\u6709\u201djournal&quot;,&quot;Transaction\u201c\uff0c\u201cfailover\u201d\uff0c\u548c\u201crecovery&quot;\u8fd9\u4e9b\u6570\u636e\u5e93\u5df2\u7ecf \u5b9e\u73b0\u7684\u529f\u80fd\uff0c\u53e6\u5916\u8fd8\u8981\u8003\u8651\u81ea\u8eab\u7684&quot;failover&quot;\u95ee\u9898\u3002\u6211\u6ca1\u6709\u627e\u5230\u6709\u5173\u5177\u4f53\u5b9e\u73b0\u7684\u8bf4\u660e\uff0c\u53ea\u80fd\u731c\u6d4b\u8fd9\u4e00\u90e8\u5206\u7684\u5904\u7406\u53ef\u80fd\u4e5f\u662f\u76f4\u63a5\u5229\u7528\u6216\u662f\u5b9e\u73b0\u4e86\u7c7b\u4f3c\u4e8e Flickr\u7684Queue\u7cfb\u7edf\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flickr \u7f51\u7ad9\u67b6\u6784\u5206\u6790 Flickr.com \u662f\u7f51\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u7167\u7247\u5171\u4eab\u7f51\u7ad9\u4e4b\u4e00\uff0c\u8fd8\u8bb0\u5f97\u90a3\u4f4d\u7ed9Windows Vista\u62cd\u6444\u58c1\u7eb8\u7684Hamad Darwish\u5417\uff1f\u4ed6\u5c31\u662f\u5c06\u7167\u7247\u4e0a\u4f20\u5230Flickr\uff0c\u540e\u800c\u88ab\u5fae\u8f6f\u770b\u4e2d\u6210\u4e3aVista\u58c1\u7eb8\u5fa1\u7528\u6444\u5f71\u5e08\u3002 Flickr.com \u662f\u6700\u521d\u7531\u4f4d\u4e8e\u6e29\u54e5\u534e\u7684Ludicorp\u516c\u53f8\u5f00\u53d1\u8bbe\u8ba1\u5e76\u4e8e2004\u5e742\u6708\u6b63\u5f0f\u53d1\u5e03\u7684\uff0c\u7531\u4e8e\u5927\u91cf\u5e94\u7528\u4e86WEB 2.0\u6280\u672f\uff0c\u6ce8\u91cd\u7528\u6237\u4f53\u9a8c\uff0c\u4f7f\u5f97\u5176\u8fc5\u901f\u83b7\u5f97\u4e86\u5927\u91cf\u7684\u7528\u6237\uff0c2007\u5e7411\u6708\uff0cFlickr\u8fce\u6765\u4e86\u7b2c20\u4ebf\u5f20\u7167\u7247\uff0c\u4e00\u5e74\u540e\uff0c\u8fd9\u4e2a\u6570\u5b57\u5c31\u8fbe\u5230\u4e8630\u4ebf\uff0c\u5e76\u4e14\u8fd8 \u5728\u4ee5\u52a0\u901f\u5ea6\u589e<\/p>\n","protected":false},"author":1,"featured_media":23732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[2],"tags":[292,187,29,24,14,534,21,10,22,500,64,190],"collection":[],"_links":{"self":[{"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/posts\/23734"}],"collection":[{"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/comments?post=23734"}],"version-history":[{"count":0,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/posts\/23734\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/media\/23732"}],"wp:attachment":[{"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/media?parent=23734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/categories?post=23734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/tags?post=23734"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/aqzt.com\/wp-json\/wp\/v2\/collection?post=23734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}