{"id":199445,"date":"2024-05-10T01:03:36","date_gmt":"2024-05-09T17:03:36","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/199445.html"},"modified":"2024-05-10T01:03:45","modified_gmt":"2024-05-09T17:03:45","slug":"redis%e4%bd%bf%e7%94%a8%e7%9a%84%e6%98%af%e4%bb%80%e4%b9%88%e5%93%88%e5%b8%8c%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/199445.html","title":{"rendered":"redis\u4f7f\u7528\u7684\u662f\u4ec0\u4e48\u54c8\u5e0c\u7b97\u6cd5"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24140740\/ba574eee-883b-41be-be8a-228125ae9aa3.webp\" alt=\"redis\u4f7f\u7528\u7684\u662f\u4ec0\u4e48\u54c8\u5e0c\u7b97\u6cd5\" \/><\/p>\n<p><p>Redis\u4f7f\u7528\u7684\u54c8\u5e0c\u7b97\u6cd5\u4e3b\u8981\u662f <strong>MurmurHash<\/strong>\u3001<strong>\u54c8\u5e0c\u51fd\u6570<\/strong> \u548c <strong>\u4e00\u81f4\u6027\u54c8\u5e0c<\/strong>\u3002<strong>MurmurHash\u7b97\u6cd5<\/strong> \u4ee5\u5176\u9ad8\u6548\u3001\u4f4e\u78b0\u649e\u7387\u800c\u5e7f\u6cdb\u5e94\u7528\u4e8eRedis\u7684\u5185\u90e8\uff0c\u7528\u4e8e\u952e\u7684\u5206\u5e03\u548c\u6570\u636e\u5206\u7247\u7b49\u3002\u5b83\u6700\u5927\u7684\u7279\u70b9\u662f\u5373\u4fbf\u662f\u5fae\u5c0f\u7684\u8f93\u5165\u53d8\u5316\u4e5f\u4f1a\u4ea7\u751f\u5f88\u5927\u7684\u8f93\u51fa\u5dee\u5f02\uff0c\u8fd9\u6709\u52a9\u4e8e\u51cf\u5c11\u952e\u5206\u5e03\u7684\u4e0d\u5747\u5300\u6027\u3002<strong>\u54c8\u5e0c\u51fd\u6570<\/strong>\u5219\u7528\u4e8e\u54c8\u5e0c\u952e\u5bf9\u8c61\u5185\u90e8\u7684\u5b9e\u73b0\uff0c\u800c<strong>\u4e00\u81f4\u6027\u54c8\u5e0c<\/strong>\u7684\u7248\u672c\u4e3b\u8981\u88ab\u7528\u4e8eRedis\u96c6\u7fa4\u4e2d\u5904\u7406\u952e\u4e0e\u8282\u70b9\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\u3002\u5728Redis\u96c6\u7fa4\u4e2d\uff0c\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u80fd\u591f\u5728\u589e\u51cf\u8282\u70b9\u65f6\u6700\u5927\u9650\u5ea6\u51cf\u5c11\u952e\u7684\u8fc1\u79fb\uff0c\u4fdd\u8bc1\u96c6\u7fa4\u7684\u9ad8\u53ef\u7528\u6027\u548c\u5206\u5e03\u7684\u5747\u8861\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001MURMURHASH<\/h3>\n<\/p>\n<p><p>MurmurHash\u7b97\u6cd5\u56e0\u5176\u9ad8\u6027\u80fd\u548c\u5206\u5e03\u5747\u5300\u6027\u5728Redis\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u5b83\u80fd\u591f\u5feb\u901f\u5730\u5bf9\u6570\u636e\u8fdb\u884c\u54c8\u5e0c\uff0c\u5e76\u4e14\u5373\u4f7f\u662f\u5f88\u5c0f\u7684\u8f93\u5165\u5dee\u5f02\u4e5f\u4f1a\u5bfc\u81f4\u54c8\u5e0c\u7ed3\u679c\u5927\u4e0d\u76f8\u540c\uff0c\u8fd9\u6709\u52a9\u4e8e\u9632\u6b62\u51fa\u73b0\u8fc7\u591a\u7684\u54c8\u5e0c\u78b0\u649e\u3002<\/p>\n<\/p>\n<p><p>MurmurHash\u7b97\u6cd5\u5728Redis\u4e2d\u5177\u6709\u591a\u79cd\u7528\u9014\uff0c\u6700\u5178\u578b\u7684\u662f\u7528\u6765\u4e3a\u5b57\u7b26\u4e32\u952e\u751f\u6210\u4e00\u4e2a\u6574\u6570\u7684\u54c8\u5e0c\u503c\u3002\u8fd9\u4e2a\u54c8\u5e0c\u503c\u7ecf\u5e38\u7528\u4e8e\u8ba1\u7b97\u5e94\u8be5\u5c06\u952e\u5206\u914d\u5230\u54ea\u4e00\u4e2a\u54c8\u5e0c\u69fd\uff0c\u7279\u522b\u662f\u5728Redis\u96c6\u7fa4\u4e2d\u3002MurmurHash\u7b97\u6cd5\u80fd\u5feb\u901f\u5730\u5bf9\u4e0d\u540c\u957f\u5ea6\u7684\u8f93\u5165\u6570\u636e\u4ea7\u751f\u56fa\u5b9a\u5927\u5c0f\u7684\u8f93\u51fa\u7ed3\u679c\uff0c\u8fd9\u4e5f\u662fRedis\u9009\u62e9\u5b83\u7684\u539f\u56e0\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u54c8\u5e0c\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5728Redis\u4e2d\uff0c\u54c8\u5e0c\u8868\u662f\u6700\u57fa\u7840\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\uff0c\u5b83\u652f\u6301\u8bf8\u5982\u5b57\u7b26\u4e32\u3001\u54c8\u5e0c\u3001\u5217\u8868\u3001\u96c6\u5408\u548c\u6709\u5e8f\u96c6\u5408\u7b49Redis\u6570\u636e\u7c7b\u578b\u7684\u5e95\u5c42\u5b9e\u73b0\u3002\u54c8\u5e0c\u51fd\u6570\u786e\u4fdd\u952e\u503c\u5bf9\u88ab\u5e73\u5747\u5730\u5206\u5e03\u5728\u54c8\u5e0c\u8868\u4e2d\uff0c\u51cf\u5c11\u6f5c\u5728\u7684\u6027\u80fd\u74f6\u9888\u3002<\/p>\n<\/p>\n<p><p><strong>\u54c8\u5e0c\u952e\u5bf9\u8c61<\/strong>\u662f\u53e6\u4e00\u4e2a\u5728Redis\u4e2d\u5e7f\u6cdb\u8fd0\u7528\u54c8\u5e0c\u51fd\u6570\u7684\u4f8b\u5b50\uff0c\u8fd9\u4e2a\u529f\u80fd\u5141\u8bb8\u4f60\u5c06\u591a\u4e2a\u952e\u503c\u5bf9\u805a\u96c6\u5b58\u50a8\u5728\u4e00\u4e2aRedis\u952e\u5185\u90e8\u3002\u5728\u8fd9\u4e2a\u573a\u666f\u4e0b\uff0c\u54c8\u5e0c\u51fd\u6570\u6709\u52a9\u4e8e\u5feb\u901f\u5b9a\u4f4d\u5b50\u952e\u7684\u4f4d\u7f6e\uff0c\u5e76\u8fdb\u884c\u9ad8\u6548\u7684\u8bfb\u5199\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4e00\u81f4\u6027\u54c8\u5e0c<\/h3>\n<\/p>\n<p><p>\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u4e3b\u8981\u7528\u4e8eRedis\u96c6\u7fa4\uff0c\u89e3\u51b3\u4e86\u8282\u70b9\u589e\u51cf\u5bfc\u81f4\u7684\u5927\u89c4\u6a21\u6570\u636e\u8fc1\u79fb\u95ee\u9898\u3002\u5f53\u4f60\u5411Redis\u96c6\u7fa4\u4e2d\u6dfb\u52a0\u6216\u5220\u9664\u8282\u70b9\u65f6\uff0c\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u786e\u4fdd\u53ea\u6709\u4e00\u5c0f\u90e8\u5206\u7684\u952e\u9700\u8981\u88ab\u8fc1\u79fb\u81f3\u65b0\u7684\u8282\u70b9\u4e0a\uff0c\u4ece\u800c\u63d0\u9ad8\u4e86\u96c6\u7fa4\u64cd\u4f5c\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u5728Redis\u96c6\u7fa4\u4e2d\uff0c\u8282\u70b9\u95f4\u4f7f\u7528\u54c8\u5e0c\u69fd\u6765\u5b9a\u4f4d\u6570\u636e\u3002\u501f\u52a9\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\uff0c\u6bcf\u4e2a\u952e\u901a\u8fc7\u7279\u5b9a\u7684\u54c8\u5e0c\u51fd\u6570\u8ba1\u7b97\u51fa\u4e00\u4e2a\u54c8\u5e0c\u69fd\u7684\u503c\uff0c\u8fdb\u800c\u786e\u5b9a\u5e94\u8be5\u5b58\u653e\u5728\u54ea\u4e2a\u8282\u70b9\u4e0a\u3002\u8fd9\u6837\u7684\u6620\u5c04\u4fdd\u8bc1\u4e86\u6570\u636e\u5206\u5e03\u7684\u5747\u8861\u6027\u548c\u9ad8\u53ef\u7528\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u603b\u4f53\u6765\u8bf4\uff0cRedis\u91c7\u7528MurmurHash\u7b97\u6cd5\u6765\u5206\u914d\u54c8\u5e0c\u69fd\u548c\u5904\u7406\u6570\u636e\u5206\u7247\uff0c\u4f7f\u7528\u6807\u51c6\u54c8\u5e0c\u51fd\u6570\u6765\u652f\u6301\u6570\u636e\u7c7b\u578b\u5185\u90e8\u7684\u54c8\u5e0c\u8868\u5b9e\u73b0\uff0c\u5e76\u5229\u7528\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u6765\u7ba1\u7406\u96c6\u7fa4\u8282\u70b9\u95f4\u7684\u6570\u636e\u5206\u5e03\u3002\u8fd9\u4e9b\u54c8\u5e0c\u7b97\u6cd5\u7684\u7ec4\u5408\u4f7f\u5f97Redis\u80fd\u591f\u63d0\u4f9b\u9ad8\u6548\u3001\u53ef\u6269\u5c55\u3001\u53ef\u9760\u7684\u6570\u636e\u5b58\u50a8\u548c\u8bbf\u95ee\u670d\u52a1\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. Redis\u4f7f\u7528\u7684\u662f\u54ea\u79cd\u54c8\u5e0c\u7b97\u6cd5\uff1f<\/strong><\/p>\n<p>Redis\u4f7f\u7528\u7684\u662f\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\uff08Consistent Hashing\uff09\u3002<\/p>\n<p><strong>2. \u4e3a\u4ec0\u4e48Redis\u9009\u62e9\u4f7f\u7528\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\uff1f<\/strong><\/p>\n<p>\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u5177\u6709\u5f88\u597d\u7684\u8d1f\u8f7d\u5747\u8861\u6027\u80fd\u548c\u9ad8\u53ef\u7528\u6027\u3002Redis\u4f5c\u4e3a\u4e00\u4e2a\u5206\u5e03\u5f0f\u7f13\u5b58\u7cfb\u7edf\uff0c\u9700\u8981\u5c06\u6570\u636e\u5206\u5e03\u5728\u591a\u4e2a\u8282\u70b9\u4e0a\u8fdb\u884c\u5b58\u50a8\u548c\u8bfb\u53d6\uff0c\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u53ef\u4ee5\u4fdd\u8bc1\u5728\u65b0\u589e\u6216\u5220\u9664\u8282\u70b9\u65f6\uff0c\u6570\u636e\u7684\u91cd\u65b0\u5206\u5e03\u91cf\u6700\u5c0f\uff0c\u907f\u514d\u4e86\u5927\u89c4\u6a21\u7684\u6570\u636e\u8fc1\u79fb\uff0c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n<p><strong>3. \u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u5982\u4f55\u5b9e\u73b0\u6570\u636e\u7684\u5206\u5e03\u548c\u8def\u7531\uff1f<\/strong><\/p>\n<p>\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u5c06\u8282\u70b9\u7684\u54c8\u5e0c\u7a7a\u95f4\u5212\u5206\u4e3a\u4e00\u4e2a\u5706\u73af\uff0c\u6bcf\u4e2a\u8282\u70b9\u5728\u5706\u73af\u4e0a\u6709\u4e00\u4e2a\u552f\u4e00\u7684\u6807\u8bc6\u503c\uff08\u6bd4\u5982\u8282\u70b9\u7684\u54c8\u5e0c\u503c\uff09\u3002\u5f53\u9700\u8981\u5b58\u50a8\u6216\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u6839\u636e\u6570\u636e\u7684\u5173\u952e\u5b57\u8ba1\u7b97\u51fa\u4e00\u4e2a\u54c8\u5e0c\u503c\uff0c\u5728\u54c8\u5e0c\u7a7a\u95f4\u4e0a\u987a\u65f6\u9488\u627e\u5230\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7b49\u4e8e\u8be5\u54c8\u5e0c\u503c\u7684\u8282\u70b9\uff0c\u5c06\u6570\u636e\u5b58\u50a8\u5230\u8be5\u8282\u70b9\u4e2d\u3002\u5f53\u8282\u70b9\u589e\u52a0\u6216\u5220\u9664\u65f6\uff0c\u53ea\u6709\u5468\u56f4\u7684\u90e8\u5206\u6570\u636e\u9700\u8981\u91cd\u65b0\u6620\u5c04\u5230\u65b0\u7684\u8282\u70b9\uff0c\u5927\u90e8\u5206\u6570\u636e\u4ecd\u7136\u4fdd\u6301\u5728\u539f\u6709\u8282\u70b9\u4e0a\uff0c\u907f\u514d\u4e86\u5168\u5c40\u6570\u636e\u8fc1\u79fb\u7684\u5f00\u9500\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u6709\u6548\u5730\u964d\u4f4e\u6570\u636e\u7684\u8fc1\u79fb\u91cf\uff0c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u53ef\u6269\u5c55\u6027\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Redis\u4f7f\u7528\u7684\u54c8\u5e0c\u7b97\u6cd5\u4e3b\u8981\u662f MurmurHash\u3001\u54c8\u5e0c\u51fd\u6570 \u548c \u4e00\u81f4\u6027\u54c8\u5e0c\u3002MurmurHash\u7b97\u6cd5 \u4ee5\u5176 [&hellip;]","protected":false},"author":3,"featured_media":199454,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/199445"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=199445"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/199445\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/199454"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=199445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=199445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=199445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}