{"id":121714,"date":"2026-11-03T12:48:37","date_gmt":"2026-11-03T04:48:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/121714.html"},"modified":"2026-11-03T12:48:37","modified_gmt":"2026-11-03T04:48:37","slug":"redis-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e4%ba%94%ef%bc%89%ef%bc%9a%e9%ab%98%e5%8f%af%e7%94%a8-%e4%b8%bb%e4%bb%8e%e5%a4%8d%e5%88%b6%e4%b8%8e%e5%93%a8%e5%85%b5%e9%9b%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/121714.html","title":{"rendered":"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4"},"content":{"rendered":"<p>\u5355\u673a Redis \u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u6570\u636e\u600e\u4e48\u5907\u4efd&#xff1f;\u8fd9\u7bc7\u8bb2 Redis \u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff1a;\u4e3b\u4ece\u590d\u5236\u8ba9\u6570\u636e\u6709\u5907\u4efd\u3001\u8bfb\u5199\u5206\u79bb&#xff0c;\u54e8\u5175\u8ba9\u6545\u969c\u81ea\u52a8\u5207\u6362&#xff0c;\u4fdd\u8bc1\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u4e3b\u4ece\u590d\u5236&#xff1f;<\/h3>\n<h4>1.1 \u5355\u673a Redis \u7684\u9690\u60a3<\/h4>\n<p>\u5355\u673a\u90e8\u7f72 Redis \u6709\u4e09\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<li>\u5355\u70b9\u6545\u969c \u2014 \u8fd9\u53f0\u673a\u5668\u4e00\u6302&#xff0c;\u6240\u6709\u4f9d\u8d56 Redis \u7684\u670d\u52a1\u5168\u90e8\u762b\u75ea<\/li>\n<li>\u6570\u636e\u6ca1\u6709\u5907\u4efd \u2014 \u673a\u5668\u78c1\u76d8\u635f\u574f&#xff0c;\u5185\u5b58\u91cc\u7684\u6570\u636e\u5168\u6ca1\u4e86<\/li>\n<li>\u8bfb\u6027\u80fd\u74f6\u9888 \u2014 \u6240\u6709\u8bfb\u8bf7\u6c42\u90fd\u538b\u5728\u4e00\u53f0\u673a\u5668\u4e0a&#xff0c;\u625b\u4e0d\u4f4f\u9ad8\u5e76\u53d1<\/li>\n<h4>1.2 \u4e3b\u4ece\u590d\u5236\u7684\u601d\u8def<\/h4>\n<p>\u4e3b\u4ece\u590d\u5236&#xff08;Master-Slave Replication&#xff09;&#xff1a;\u4e00\u53f0\u4e3b\u8282\u70b9&#xff08;Master&#xff09;\u8d1f\u8d23\u5199&#xff0c;\u4e00\u53f0\u6216\u591a\u53f0\u4ece\u8282\u70b9&#xff08;Slave&#xff09;\u8d1f\u8d23\u8bfb&#xff0c;\u6570\u636e\u5b9e\u65f6\u540c\u6b65\u5230\u4ece\u8282\u70b9\u3002<\/p>\n<p>             \u5199\u8bf7\u6c42<br \/>\n              \u2193<br \/>\n          \u250c\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2510<br \/>\n          \u2502 Master \u2502   \u2190 \u552f\u4e00\u80fd\u5199\u7684<br \/>\n          \u2514\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2518<br \/>\n      \u590d\u5236\u540c\u6b65 \u2502<br \/>\n      \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n   \u250c\u2500\u2500\u2534\u2500\u2500\u2510      \u250c\u2500\u2500\u2534\u2500\u2500\u2510<br \/>\n   \u2502Slave1\u2502      \u2502Slave2\u2502  \u2190 \u53ea\u8d1f\u8d23\u8bfb<br \/>\n   \u2514\u2500\u2500\u2500\u2500\u2500\u2518      \u2514\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n      \u2191 \u8bfb\u8bf7\u6c42      \u2191 \u8bfb\u8bf7\u6c42<\/p>\n<p>\u4e3b\u4ece\u590d\u5236\u89e3\u51b3\u4e86\u4e09\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<li>\u5bb9\u707e\u5907\u4efd \u2014 \u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u4ece\u8282\u70b9\u8fd8\u6709\u6570\u636e&#xff0c;\u53ef\u4ee5\u9876\u4e0a<\/li>\n<li>\u8bfb\u5199\u5206\u79bb \u2014 \u5199\u8d70\u4e3b\u8282\u70b9&#xff0c;\u8bfb\u8d70\u4ece\u8282\u70b9&#xff0c;\u5206\u62c5\u8bfb\u538b\u529b&#xff0c;\u63d0\u5347\u541e\u5410<\/li>\n<li>\u9ad8\u53ef\u7528\u57fa\u7840 \u2014 \u914d\u5408\u54e8\u5175&#xff0c;\u4e3b\u8282\u70b9\u6545\u969c\u80fd\u81ea\u52a8\u5207\u6362<\/li>\n<hr \/>\n<h3>\u4e8c\u3001\u5982\u4f55\u914d\u7f6e\u4e3b\u4ece<\/h3>\n<h4>2.1 \u547d\u4ee4\u884c\u65b9\u5f0f&#xff08;\u4e34\u65f6&#xff09;<\/h4>\n<p>\u4ece\u8282\u70b9\u4e0a\u7528 slaveof \u6307\u5b9a\u4e3b\u8282\u70b9&#xff1a;<\/p>\n<p># \u5728\u4ece\u8282\u70b9\u4e0a\u6267\u884c<br \/>\nSLAVEOF 192.168.1.100 6379<br \/>\n# \u8ba9\u5f53\u524d\u8282\u70b9\u6210\u4e3a 192.168.1.100:6379 \u7684\u4ece\u8282\u70b9<\/p>\n<h4>2.2 \u914d\u7f6e\u6587\u4ef6\u65b9\u5f0f&#xff08;\u63a8\u8350&#xff09;<\/h4>\n<p>\u5728\u4ece\u8282\u70b9\u7684 redis.conf \u91cc\u52a0&#xff1a;<\/p>\n<p># \u6307\u5b9a\u4e3b\u8282\u70b9\u5730\u5740<br \/>\nslaveof 192.168.1.100 6379<br \/>\n# \u4e3b\u8282\u70b9\u6709\u5bc6\u7801\u5c31\u914d\u7f6e<br \/>\nmasterauth 123456<\/p>\n<p>\u91cd\u542f\u4ece\u8282\u70b9\u5373\u53ef\u751f\u6548\u3002<\/p>\n<h4>2.3 \u67e5\u770b\u590d\u5236\u72b6\u6001<\/h4>\n<p>\u7528 info replication \u67e5\u770b&#xff1a;<\/p>\n<p>127.0.0.1:6379&gt; info replication<br \/>\nrole:master          # \u89d2\u8272&#xff1a;\u4e3b\u8282\u70b9<br \/>\nconnected_slaves:2   # \u67092\u4e2a\u4ece\u8282\u70b9<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u590d\u5236\u539f\u7406<\/h3>\n<h4>3.1 \u5168\u91cf\u590d\u5236 vs \u589e\u91cf\u590d\u5236<\/h4>\n<p>\u4e3b\u4ece\u540c\u6b65\u5206\u4e24\u79cd\u60c5\u51b5&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21\u540c\u6b65&#xff08;\u5168\u91cf\u590d\u5236&#xff09;&#xff1a;<\/p>\n<li>\u4ece\u8282\u70b9\u53d1 PSYNC \u8bf7\u6c42<\/li>\n<li>\u4e3b\u8282\u70b9\u751f\u6210 RDB \u5feb\u7167&#xff08;\u5185\u5b58\u6570\u636e\u7684\u5b8c\u6574\u955c\u50cf&#xff09;&#xff0c;\u540c\u65f6\u628a\u671f\u95f4\u7684\u65b0\u547d\u4ee4\u8bb0\u5f55\u5728\u590d\u5236\u79ef\u538b\u7f13\u51b2\u533a<\/li>\n<li>\u4e3b\u8282\u70b9\u628a RDB \u53d1\u7ed9\u4ece\u8282\u70b9&#xff0c;\u4ece\u8282\u70b9\u52a0\u8f7d&#xff0c;\u5f97\u5230\u4e3b\u8282\u70b9\u7684\u5b8c\u6574\u6570\u636e<\/li>\n<li>\u4e3b\u8282\u70b9\u628a\u79ef\u538b\u7f13\u51b2\u533a\u91cc\u7684\u65b0\u547d\u4ee4\u8865\u53d1\u7ed9\u4ece\u8282\u70b9<\/li>\n<p>\u540e\u7eed\u540c\u6b65&#xff08;\u589e\u91cf\u590d\u5236&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u4e3b\u8282\u70b9\u6bcf\u6b21\u5199\u64cd\u4f5c&#xff0c;\u90fd\u628a\u547d\u4ee4\u53d1\u7ed9\u4ece\u8282\u70b9\u6267\u884c<\/li>\n<li>\u4ece\u8282\u70b9\u6301\u7eed\u8ddf\u8fdb\u4e3b\u8282\u70b9\u7684\u6700\u65b0\u72b6\u6001<\/li>\n<\/ul>\n<h4>3.2 \u65ad\u7ebf\u91cd\u8fde<\/h4>\n<p>\u5982\u679c\u4e3b\u4ece\u8fde\u63a5\u4e2d\u65ad&#xff0c;\u4ece\u8282\u70b9\u91cd\u8fde\u540e&#xff0c;\u4f1a\u5c1d\u8bd5\u7528\u589e\u91cf\u590d\u5236\u8865\u4e0a\u65ad\u5f00\u7684\u547d\u4ee4\u2014\u2014\u53ea\u8981\u547d\u4ee4\u8fd8\u5728\u590d\u5236\u79ef\u538b\u7f13\u51b2\u533a\u91cc\u5c31\u80fd\u8865&#xff1b;\u5982\u679c\u65ad\u4e86\u592a\u4e45\u7f13\u51b2\u533a\u88ab\u8986\u76d6&#xff0c;\u5c31\u9000\u5316\u6210\u5168\u91cf\u590d\u5236\u3002<\/p>\n<hr \/>\n<h3>\u4e09-\u8865\u5145\u3001Redis \u6301\u4e45\u5316&#xff1a;RDB \u4e0e AOF<\/h3>\n<p>\u4e3b\u4ece\u590d\u5236\u7684\u5168\u91cf\u590d\u5236\u4f9d\u8d56 RDB&#xff0c;\u6240\u4ee5\u8fd9\u91cc\u628a Redis \u7684\u6301\u4e45\u5316\u673a\u5236\u4e00\u8d77\u8bb2\u4e86\u3002\u6301\u4e45\u5316\u89e3\u51b3\u7684\u662f&#034;Redis \u91cd\u542f\u540e\u6570\u636e\u4e0d\u4e22&#034;\u7684\u95ee\u9898\u3002<\/p>\n<h4>3.1 \u4e3a\u4ec0\u4e48\u9700\u8981\u6301\u4e45\u5316<\/h4>\n<p>Redis \u6570\u636e\u5728\u5185\u5b58\u91cc&#xff0c;\u4e00\u91cd\u542f\u5c31\u6ca1\u4e86\u3002\u4f46\u5982\u679c Redis \u6302\u4e86\u91cd\u542f\u540e\u6570\u636e\u5168\u90e8\u4e22\u5931&#xff0c;\u7f13\u5b58\u8fd8\u5f97\u91cd\u65b0\u4ece\u6570\u636e\u5e93\u52a0\u8f7d&#xff0c;\u9ad8\u5e76\u53d1\u4e0b\u77ac\u95f4\u538b\u57ae\u6570\u636e\u5e93\u3002\u6240\u4ee5\u8981\u628a\u6570\u636e\u843d\u76d8\u3002<\/p>\n<p>Redis \u6709\u4e24\u79cd\u6301\u4e45\u5316\u65b9\u5f0f&#xff1a;RDB&#xff08;\u5feb\u7167&#xff09; \u548c AOF&#xff08;\u8ffd\u52a0\u65e5\u5fd7&#xff09;\u3002<\/p>\n<h4>3.2 RDB \u5feb\u7167\u6301\u4e45\u5316<\/h4>\n<p>RDB \u662f\u628a\u67d0\u4e2a\u65f6\u523b\u7684\u5185\u5b58\u6570\u636e\u5b8c\u6574\u4fdd\u5b58\u6210\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff08;\u9ed8\u8ba4 dump.rdb&#xff09;\u3002\u4e3b\u4ece\u5168\u91cf\u590d\u5236\u4f20\u7684\u5c31\u662f\u8fd9\u4e2a\u6587\u4ef6\u3002<\/p>\n<p>\u89e6\u53d1\u65b9\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u624b\u52a8 SAVE&#xff08;\u963b\u585e&#xff09;\u6216 BGSAVE&#xff08;\u540e\u53f0\u5f02\u6b65&#xff09;<\/li>\n<li>\u914d\u7f6e\u81ea\u52a8\u89e6\u53d1&#xff1a;N\u79d2\u5185M\u6b21\u5199\u5c31\u4fdd\u5b58<\/li>\n<\/ul>\n<p># 60\u79d2\u5185\u67091000\u6b21\u5199&#xff0c;\u5c31\u751f\u6210\u5feb\u7167<br \/>\nsave 60 1000<\/p>\n<p>\u4f18\u70b9&#xff1a; \u6587\u4ef6\u5c0f\u3001\u52a0\u8f7d\u5feb\u3001\u9002\u5408\u5907\u4efd<br \/>\n\u7f3a\u70b9&#xff1a; \u662f&#034;\u67d0\u4e2a\u65f6\u95f4\u70b9\u7684\u5feb\u7167&#034;&#xff0c;\u4e24\u6b21\u5feb\u7167\u4e4b\u95f4\u7684\u6570\u636e\u53ef\u80fd\u4e22<\/p>\n<h4>3.3 AOF \u8ffd\u52a0\u6301\u4e45\u5316<\/h4>\n<p>AOF \u662f\u628a\u6bcf\u6b21\u5199\u547d\u4ee4\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\u91cc\u3002\u91cd\u542f\u65f6\u91cd\u653e\u65e5\u5fd7&#xff0c;\u6062\u590d\u6570\u636e\u3002<\/p>\n<p># \u5f00\u542fAOF<br \/>\nappendonly yes<br \/>\n# \u5199\u7b56\u7565&#xff1a;always\u6bcf\u6b21\u5199\u90fd\u843d\u76d8 \/ everysec\u6bcf\u79d2\u843d\u76d8 \/ no\u4ea4\u7ed9\u7cfb\u7edf<br \/>\nappendfsync everysec<\/p>\n<p>\u4f18\u70b9&#xff1a; \u6570\u636e\u4e22\u5931\u5c11&#xff08;everysec\u6700\u591a\u4e221\u79d2\u6570\u636e&#xff09;<br \/>\n\u7f3a\u70b9&#xff1a; \u6587\u4ef6\u5927\u3001\u91cd\u542f\u52a0\u8f7d\u6162<\/p>\n<h4>3.4 \u4e24\u79cd\u600e\u4e48\u9009<\/h4>\n<table>\n<tr>\u5bf9\u6bd4RDBAOF<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u636e\u5b8c\u6574\u6027<\/td>\n<td>\u53ef\u80fd\u4e22\u4e24\u6b21\u5feb\u7167\u95f4\u6570\u636e<\/td>\n<td>everysec\u6700\u591a\u4e221\u79d2<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u5927\u5c0f<\/td>\n<td>\u5c0f<\/td>\n<td>\u5927<\/td>\n<\/tr>\n<tr>\n<td>\u6062\u590d\u901f\u5ea6<\/td>\n<td>\u5feb<\/td>\n<td>\u6162<\/td>\n<\/tr>\n<tr>\n<td>\u5360\u7528CPU<\/td>\n<td>\u751f\u6210\u5feb\u7167\u65f6\u9ad8<\/td>\n<td>\u5199\u65e5\u5fd7\u6301\u7eed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u751f\u4ea7\u5b9e\u8df5&#xff1a;\u4e24\u4e2a\u90fd\u5f00&#xff0c;RDB \u505a\u51b7\u5907&#xff0c;AOF \u4fdd\u8bc1\u6570\u636e\u3002 Redis 4.0 \u4e4b\u540e\u8fd8\u652f\u6301 AOF \u91cd\u5199\u548c\u6df7\u5408\u6301\u4e45\u5316&#xff0c;\u8fd9\u91cc\u4e0d\u5c55\u5f00\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u54e8\u5175\u6a21\u5f0f&#xff08;Sentinel&#xff09;<\/h3>\n<h4>4.1 \u4e3b\u4ece\u590d\u5236\u7684\u7f3a\u70b9<\/h4>\n<p>\u4e3b\u4ece\u590d\u5236\u89e3\u51b3\u4e86\u5907\u4efd\u548c\u8bfb\u538b\u529b&#xff0c;\u4f46\u6709\u4e2a\u5927\u95ee\u9898&#xff1a;\u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u7cfb\u7edf\u5c31\u505c\u4e86\u3002<\/p>\n<ul>\n<li>\u4e3b\u8282\u70b9\u5b95\u673a\u540e&#xff0c;\u4ece\u8282\u70b9\u867d\u7136\u6709\u6570\u636e&#xff0c;\u4f46\u4e0d\u4f1a\u81ea\u52a8\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9<\/li>\n<li>\u5199\u8bf7\u6c42\u4ecd\u7136\u6307\u5411\u5df2\u5b95\u673a\u7684\u4e3b\u8282\u70b9&#xff0c;\u670d\u52a1\u4e2d\u65ad&#xff0c;\u9700\u8981\u4eba\u5de5\u4ecb\u5165<\/li>\n<\/ul>\n<h4>4.2 \u54e8\u5175\u662f\u4ec0\u4e48<\/h4>\n<p>\u54e8\u5175&#xff08;Sentinel&#xff09;\u5c31\u662f Redis \u7684&#034;\u76d1\u63a7&#043;\u81ea\u52a8\u6545\u969c\u8f6c\u79fb&#034;\u7ec4\u4ef6\u3002 \u5b83\u5e72\u4e09\u4ef6\u4e8b&#xff1a;<\/p>\n<li>\u76d1\u63a7 \u2014 \u6301\u7eed\u76d1\u63a7\u4e3b\u4ece\u8282\u70b9\u662f\u5426\u5b58\u6d3b<\/li>\n<li>\u901a\u77e5 \u2014 \u8282\u70b9\u6545\u969c\u65f6\u901a\u77e5\u5176\u4ed6\u8282\u70b9\u548c\u7ba1\u7406\u5458<\/li>\n<li>\u81ea\u52a8\u6545\u969c\u8f6c\u79fb \u2014 \u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u81ea\u52a8\u628a\u67d0\u4e2a\u4ece\u8282\u70b9\u63d0\u5347\u4e3a\u65b0\u4e3b\u8282\u70b9&#xff0c;\u5e76\u901a\u77e5\u5176\u4ed6\u4ece\u8282\u70b9\u548c\u5ba2\u6237\u7aef\u91cd\u65b0\u8fde\u63a5<\/li>\n<p>\u54e8\u5175 Sentinel<br \/>\n   \u2502 \u76d1\u63a7<br \/>\n   \u251c\u2500\u2500 \u76d1\u63a7 Master<br \/>\n   \u251c\u2500\u2500 \u76d1\u63a7 Slave1<br \/>\n   \u2514\u2500\u2500 \u76d1\u63a7 Slave2<\/p>\n<h4>4.3 \u54e8\u5175\u67b6\u6784<\/h4>\n<p>\u5b9e\u9645\u90e8\u7f72\u65f6&#xff0c;\u54e8\u5175\u672c\u8eab\u4e5f\u8981\u591a\u5b9e\u4f8b\u90e8\u7f72&#xff08;\u4e00\u822c3\u4e2a\u6216\u4ee5\u4e0a&#xff09;&#xff0c;\u907f\u514d\u54e8\u5175\u81ea\u5df1\u4e5f\u53d8\u6210\u5355\u70b9&#xff1a;<\/p>\n<p>         \u250c\u2500\u2500 Sentinel1<br \/>\nMaster \u2190 \u251c\u2500\u2500 Sentinel2    \u2190 \u4e09\u4e2a\u54e8\u5175\u4e92\u76f8\u76d1\u63a7&#xff0c;\u5171\u540c\u51b3\u7b56<br \/>\n         \u2514\u2500\u2500 Sentinel3<br \/>\n   \u2502<br \/>\nSlave1  Slave2<\/p>\n<p>\u4e3a\u4ec0\u4e48\u54e8\u5175\u8981\u591a\u6570&#xff1f; \u54e8\u5175\u5224\u65ad\u4e3b\u8282\u70b9\u662f\u5426\u6545\u969c&#xff0c;\u91c7\u7528&#034;\u4e3b\u89c2\u4e0b\u7ebf &#043; \u5ba2\u89c2\u4e0b\u7ebf&#034;\u673a\u5236&#xff1a;<\/p>\n<ul>\n<li>\u4e00\u4e2a\u54e8\u5175\u53d1\u73b0\u8054\u7cfb\u4e0d\u4e0a\u4e3b\u8282\u70b9 \u2192 \u4e3b\u89c2\u4e0b\u7ebf&#xff08;\u81ea\u5df1\u5224\u65ad&#xff09;<\/li>\n<li>\u591a\u6570\u54e8\u5175&#xff08;\u8d85\u8fc7\u4e00\u534a&#xff09;\u90fd\u8ba4\u4e3a\u4e3b\u8282\u70b9\u4e0b\u7ebf \u2192 \u5ba2\u89c2\u4e0b\u7ebf&#xff08;\u5927\u5bb6\u4e00\u81f4&#xff09;\u2192 \u624d\u89e6\u53d1\u6545\u969c\u8f6c\u79fb<\/li>\n<\/ul>\n<p>\u8fd9\u6837\u4e0d\u4f1a\u56e0\u4e3a\u7f51\u7edc\u6296\u52a8\u4e00\u4e2a\u54e8\u5175\u8bef\u5224\u5c31\u5207\u6362\u3002<\/p>\n<h4>4.4 \u6545\u969c\u8f6c\u79fb\u6d41\u7a0b<\/h4>\n<p>1. \u4e3b\u8282\u70b9 Master \u7a81\u7136\u5b95\u673a<br \/>\n2. \u54e8\u5175\u53d1\u73b0&#xff0c;\u6807\u8bb0\u4e3b\u89c2\u4e0b\u7ebf<br \/>\n3. \u591a\u6570\u54e8\u5175\u786e\u8ba4 \u2192 \u5ba2\u89c2\u4e0b\u7ebf<br \/>\n4. \u54e8\u5175\u4eec\u9009\u4e3e\u4e00\u4e2a Leader \u54e8\u5175<br \/>\n5. Leader \u54e8\u5175\u4ece\u4ece\u8282\u70b9\u91cc\u9009\u4e00\u4e2a&#xff08;\u4f18\u5148\u9009\u6570\u636e\u6700\u5168\u3001\u4f18\u5148\u7ea7\u6700\u9ad8\u3001runid\u6700\u5c0f\u7684&#xff09;<br \/>\n6. \u628a\u8fd9\u4e2a\u4ece\u8282\u70b9\u63d0\u5347\u4e3a\u65b0 Master<br \/>\n7. \u901a\u77e5\u5176\u4ed6\u4ece\u8282\u70b9\u91cd\u65b0\u6307\u5411\u65b0 Master<br \/>\n8. \u901a\u77e5\u5ba2\u6237\u7aef&#xff0c;\u5ba2\u6237\u7aef\u8fde\u63a5\u65b0 Master<\/p>\n<p>\u6574\u4e2a\u8fc7\u7a0b\u81ea\u52a8\u5b8c\u6210&#xff0c;\u4e1a\u52a1\u65e0\u9700\u4eba\u5de5\u4ecb\u5165&#xff0c;\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u54e8\u5175\u7684\u90e8\u7f72<\/h3>\n<h4>5.1 \u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>\u6bcf\u53f0\u54e8\u5175\u673a\u5668\u7684 sentinel.conf&#xff1a;<\/p>\n<p># \u76d1\u542c\u4e3b\u8282\u70b9&#xff08;mymaster\u662f\u81ea\u5b9a\u4e49\u540d\u79f0&#xff09;<br \/>\nsentinel monitor mymaster 192.168.1.100 6379 2<br \/>\n# 2\u8868\u793a&#xff1a;\u81f3\u5c112\u4e2a\u54e8\u5175\u540c\u610f\u624d\u7b97\u5ba2\u89c2\u4e0b\u7ebf<\/p>\n<p># \u4e3b\u8282\u70b9\u5bc6\u7801<br \/>\nsentinel auth-pass mymaster 123456<\/p>\n<p># \u4e3b\u8282\u70b9\u5b95\u673a\u540e&#xff0c;\u591a\u5c11\u6beb\u79d2\u5185\u6ca1\u54cd\u5e94\u7b97\u4e3b\u89c2\u4e0b\u7ebf<br \/>\nsentinel down-after-milliseconds mymaster 5000<\/p>\n<p># \u6545\u969c\u8f6c\u79fb\u540e&#xff0c;\u540c\u65f6\u80fd\u540c\u6b65\u5230\u51e0\u4e2a\u4ece\u8282\u70b9<br \/>\nsentinel parallel-syncs mymaster 1<\/p>\n<h4>5.2 \u542f\u52a8\u54e8\u5175<\/h4>\n<p>redis-sentinel \/path\/to\/sentinel.conf<\/p>\n<p>\u542f\u52a8\u591a\u4e2a\u54e8\u5175\u5b9e\u4f8b&#xff0c;\u6bcf\u4e2a\u7528\u4e0d\u540c\u914d\u7f6e&#xff08;port\u4e0d\u540c&#xff09;\u3002<\/p>\n<h4>5.3 Java \u5ba2\u6237\u7aef\u8fde\u63a5\u54e8\u5175<\/h4>\n<p><span class=\"token comment\">\/\/ \u914d\u7f6e\u54e8\u5175\u5730\u5740<\/span><br \/>\n<span class=\"token class-name\">Set<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> sentinels <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HashSet<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Arrays<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">asList<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    <span class=\"token string\">&#034;192.168.1.101:26379&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;192.168.1.102:26379&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string\">&#034;192.168.1.103:26379&#034;<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ Jedis \u8fde\u63a5\u54e8\u5175&#xff0c;\u81ea\u52a8\u53d1\u73b0\u5f53\u524d\u4e3b\u8282\u70b9<\/span><br \/>\n<span class=\"token class-name\">JedisSentinelPool<\/span> pool <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">JedisSentinelPool<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;mymaster&#034;<\/span><span class=\"token punctuation\">,<\/span> sentinels<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Jedis<\/span> jedis <span class=\"token operator\">&#061;<\/span> pool<span class=\"token punctuation\">.<\/span><span class=\"token function\">getResource<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    jedis<span class=\"token punctuation\">.<\/span><span class=\"token function\">set<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;name&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u5c0f\u660e&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5ba2\u6237\u7aef\u901a\u8fc7\u54e8\u5175\u627e\u5230\u5f53\u524d\u7684\u4e3b\u8282\u70b9&#xff0c;\u4e3b\u8282\u70b9\u5207\u6362\u540e&#xff0c;\u54e8\u5175\u4f1a\u544a\u77e5\u5ba2\u6237\u7aef\u65b0\u5730\u5740&#xff0c;\u5ba2\u6237\u7aef\u81ea\u52a8\u91cd\u8fde\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u8111\u88c2\u95ee\u9898&#xff08;Split Brain&#xff09;<\/h3>\n<h4>6.1 \u4ec0\u4e48\u662f\u8111\u88c2<\/h4>\n<p>\u54e8\u5175\u6a21\u5f0f\u4e0b\u6709\u4e2a\u7ecf\u5178\u95ee\u9898\u2014\u2014\u8111\u88c2\u3002\u573a\u666f&#xff1a;<\/p>\n<p>\u4e3b\u8282\u70b9\u548c\u54e8\u5175\u4e4b\u95f4\u7684\u7f51\u7edc\u65ad\u4e86&#xff08;\u4f46\u4e3b\u8282\u70b9\u672c\u8eab\u6ca1\u6302&#xff09;<br \/>\n\u54e8\u5175\u5224\u65ad\u4e3b\u8282\u70b9&#034;\u5ba2\u89c2\u4e0b\u7ebf&#034;&#xff08;\u591a\u6570\u540c\u610f&#xff09;<br \/>\n\u89e6\u53d1\u6545\u969c\u8f6c\u79fb&#xff0c;\u628a\u4e00\u4e2a\u4ece\u8282\u70b9\u63d0\u5347\u4e3a\u65b0\u4e3b\u8282\u70b9<br \/>\n\u540c\u65f6&#xff0c;\u539f\u4e3b\u8282\u70b9\u5176\u5b9e\u8fd8\u6d3b\u7740&#xff0c;\u8fd8\u5728\u63a5\u53d7\u5199\u8bf7\u6c42<br \/>\n\u2192 \u73b0\u5728\u6709\u4e24\u4e2a&#034;\u4e3b\u8282\u70b9&#034;\u5728\u5199\u6570\u636e&#xff0c;\u4e24\u8fb9\u6570\u636e\u4e0d\u4e00\u81f4&#xff08;\u8111\u88c2&#xff09;<\/p>\n<p>\u539f\u4e3b\u8282\u70b9\u7f51\u7edc\u6062\u590d\u540e&#xff0c;\u54e8\u5175\u4f1a\u8ba9\u5b83\u53d8\u6210\u4ece\u8282\u70b9&#xff0c;\u4f46\u5b83\u5df2\u7ecf\u5199\u4e86\u5f88\u591a\u6570\u636e&#xff0c;\u548c\u771f\u6b63\u7684\u4e3b\u8282\u70b9\u4e0d\u4e00\u81f4&#xff0c;\u8fd9\u4e9b\u6570\u636e\u5c31\u4e22\u4e86\u3002<\/p>\n<h4>6.2 \u600e\u4e48\u89e3\u51b3<\/h4>\n<p>\u4e24\u4e2a\u5173\u952e\u914d\u7f6e&#xff1a;<\/p>\n<p># \u4e3b\u8282\u70b9\u5fc5\u987b\u81f3\u5c11\u67091\u4e2a\u4ece\u8282\u70b9\u8fde\u63a5<br \/>\n# \u5426\u5219\u505c\u6b62\u63a5\u6536\u5199\u8bf7\u6c42<br \/>\nmin-slaves-to-write 1<\/p>\n<p># \u4ece\u8282\u70b9\u4e0e\u4e3b\u8282\u70b9\u7684\u6700\u5927\u5ef6\u8fdf\u8d85\u8fc710\u79d2<br \/>\n# \u4e3b\u8282\u70b9\u4e5f\u505c\u6b62\u63a5\u6536\u5199\u8bf7\u6c42<br \/>\nmin-slaves-max-lag 10<\/p>\n<p>\u610f\u601d\u662f&#xff1a;\u4e3b\u8282\u70b9\u5982\u679c\u53d1\u73b0\u81ea\u5df1\u8fde\u4e0d\u4e0a\u4ece\u8282\u70b9&#xff08;\u6216\u4ece\u8282\u70b9\u592a\u6162&#xff09;&#xff0c;\u5c31\u62d2\u7edd\u5199\u8bf7\u6c42&#xff0c;\u800c\u4e0d\u662f\u50bb\u50bb\u5730\u7ee7\u7eed\u5199\u3002\u8fd9\u6837\u5373\u4f7f\u53d1\u751f\u8111\u88c2&#xff0c;\u539f\u4e3b\u8282\u70b9\u4e5f\u4e0d\u4f1a\u5199\u5165\u65b0\u6570\u636e&#xff0c;\u7b49\u5b83\u6062\u590d\u6210\u4ece\u8282\u70b9\u65f6&#xff0c;\u6570\u636e\u8fd8\u662f\u5e72\u51c0\u7684\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001Redis Cluster \u96c6\u7fa4&#xff08;\u4e86\u89e3&#xff09;<\/h3>\n<p>\u4e3b\u4ece&#043;\u54e8\u5175\u89e3\u51b3\u4e86\u9ad8\u53ef\u7528&#xff0c;\u4f46\u8fd8\u6709\u4e2a\u95ee\u9898&#xff1a;\u6570\u636e\u91cf\u592a\u5927&#xff0c;\u4e00\u53f0\u4e3b\u8282\u70b9\u5b58\u4e0d\u4e0b\u3002<\/p>\n<p>Redis Cluster \u662f\u5b98\u65b9\u7684\u96c6\u7fa4\u65b9\u6848&#xff0c;\u89e3\u51b3\u6d77\u91cf\u6570\u636e\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u628a\u6570\u636e\u5206\u6210 16384 \u4e2a\u54c8\u5e0c\u69fd&#xff08;hash slot&#xff09;&#xff0c;\u5206\u5e03\u5230\u591a\u4e2a\u4e3b\u8282\u70b9<\/li>\n<li>\u6bcf\u4e2a\u4e3b\u8282\u70b9\u8d1f\u8d23\u4e00\u90e8\u5206\u69fd<\/li>\n<li>\u6bcf\u4e2a\u4e3b\u8282\u70b9\u53ef\u4ee5\u6709\u4ece\u8282\u70b9&#xff08;\u9ad8\u53ef\u7528&#xff09;<\/li>\n<li>\u5ba2\u6237\u7aef\u6839\u636e key \u7684\u54c8\u5e0c\u503c\u8def\u7531\u5230\u5bf9\u5e94\u8282\u70b9<\/li>\n<\/ul>\n<p>Cluster<br \/>\n \u251c\u2500\u2500 \u8282\u70b9A&#xff1a;\u69fd 0-5460<br \/>\n \u251c\u2500\u2500 \u8282\u70b9B&#xff1a;\u69fd 5461-10922<br \/>\n \u2514\u2500\u2500 \u8282\u70b9C&#xff1a;\u69fd 10923-16383<\/p>\n<p>\u4ec0\u4e48\u65f6\u5019\u7528 Cluster&#xff1f; \u5355\u53f0 Redis \u5185\u5b58\u4e0d\u591f\u3001\u9700\u8981\u6a2a\u5411\u6269\u5c55\u5bb9\u91cf\u65f6\u3002\u4e2d\u5c0f\u9879\u76ee\u5355\u4e3b&#043;\u54e8\u5175\u5c31\u591f\u4e86&#xff0c;\u4e0d\u7528\u4e0a\u96c6\u7fa4\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u9009\u578b\u603b\u7ed3<\/h3>\n<table>\n<tr>\u65b9\u6848\u89e3\u51b3\u7684\u95ee\u9898\u9002\u7528\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>\u5355\u673a<\/td>\n<td>\u65e0<\/td>\n<td>\u5f00\u53d1\u6d4b\u8bd5<\/td>\n<\/tr>\n<tr>\n<td>\u4e3b\u4ece\u590d\u5236<\/td>\n<td>\u5907\u4efd\u3001\u8bfb\u538b\u529b<\/td>\n<td>\u6570\u636e\u8981\u6709\u5907\u4efd<\/td>\n<\/tr>\n<tr>\n<td>\u4e3b\u4ece &#043; \u54e8\u5175<\/td>\n<td>\u9ad8\u53ef\u7528\u3001\u81ea\u52a8\u5207\u6362<\/td>\n<td>\u751f\u4ea7\u73af\u5883\u6807\u914d<\/td>\n<\/tr>\n<tr>\n<td>Cluster<\/td>\n<td>\u6d77\u91cf\u6570\u636e\u3001\u6a2a\u5411\u6269\u5c55<\/td>\n<td>\u6570\u636e\u91cf\u5de8\u5927\u7684\u573a\u666f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u751f\u4ea7\u73af\u5883\u6807\u914d&#xff1a;\u4e3b\u4ece\u590d\u5236 &#043; \u54e8\u5175\u3002 \u65e2\u4fdd\u8bc1\u6570\u636e\u6709\u5907\u4efd&#xff0c;\u53c8\u4fdd\u8bc1\u4e3b\u8282\u70b9\u6545\u969c\u81ea\u52a8\u5207\u6362&#xff0c;\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002<\/p>\n<hr \/>\n<h3>\u672c\u7bc7\u5c0f\u7ed3<\/h3>\n<ul>\n<li>\u4e3b\u4ece\u590d\u5236&#xff1a;\u4e3b\u5199\u4ece\u8bfb&#xff0c;\u6570\u636e\u5b9e\u65f6\u540c\u6b65&#xff0c;\u89e3\u51b3\u5907\u4efd\u548c\u8bfb\u538b\u529b<\/li>\n<li>\u5168\u91cf\u590d\u5236\u7528 RDB \u5feb\u7167&#xff0c;\u589e\u91cf\u590d\u5236\u6301\u7eed\u540c\u6b65&#xff0c;\u65ad\u7ebf\u7528\u7f13\u51b2\u533a\u8865<\/li>\n<li>\u54e8\u5175\u76d1\u63a7\u4e3b\u4ece&#xff0c;\u4e3b\u8282\u70b9\u6302\u4e86\u81ea\u52a8\u628a\u4ece\u8282\u70b9\u63d0\u5347\u4e3a\u65b0\u4e3b&#xff0c;\u6545\u969c\u8f6c\u79fb\u81ea\u52a8\u5b8c\u6210<\/li>\n<li>\u54e8\u5175\u8981\u591a\u5b9e\u4f8b\u90e8\u7f72&#xff08;\u22653\u4e2a&#xff09;&#xff0c;\u9760&#034;\u591a\u6570\u540c\u610f&#034;\u907f\u514d\u8bef\u5224<\/li>\n<li>\u8111\u88c2\u7528 min-slaves-to-write \u914d\u7f6e\u9632\u6b62\u4e3b\u8282\u70b9\u5b64\u519b\u5199\u6570\u636e<\/li>\n<li>\u6570\u636e\u91cf\u592a\u5927\u7528 Cluster&#xff0c;\u628a\u6570\u636e\u5206\u6563\u5230\u591a\u4e2a\u8282\u70b9<\/li>\n<li>\u751f\u4ea7\u6807\u914d&#xff1a;\u4e3b\u4ece &#043; \u54e8\u5175<\/li>\n<li>\u4e0b\u4e00\u7bc7\u8fdb\u5165\u9ad8\u5e76\u53d1\u4e13\u9898&#xff1a;\u7f13\u5b58\u7a7f\u900f\u3001\u51fb\u7a7f\u3001\u96ea\u5d29<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5355\u673a Redis \u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u6570\u636e\u600e\u4e48\u5907\u4efd&#xff1f;\u8fd9\u7bc7\u8bb2 Redis \u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff1a;\u4e3b\u4ece\u590d\u5236\u8ba9\u6570\u636e\u6709\u5907\u4efd\u3001\u8bfb\u5199\u5206\u79bb&#xff0c;\u54e8\u5175\u8ba9\u6545\u969c\u81ea\u52a8\u5207\u6362&#xff0c;\u4fdd\u8bc1\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4e00\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u4e3b\u4ece\u590d\u5236&#xff1f;<br \/>\n1.1 \u5355\u673a Redis \u7684\u9690\u60a3<br \/>\n\u5355\u673a\u90e8\u7f72 Redis \u6709\u4e09\u4e2a\u95ee\u9898&#xff1a;<br \/>\n\u5355\u70b9\u6545\u969c \u2014 \u8fd9\u53f0\u673a\u5668\u4e00\u6302&#xff0c;\u6240\u6709\u4f9d\u8d56 Redis \u7684\u670d\u52a1\u5168\u90e8\u762b\u75ea\u6570\u636e\u6ca1\u6709\u5907\u4efd \u2014 \u673a\u5668\u78c1\u76d8\u635f\u574f&#xff0c;\u5185\u5b58\u91cc\u7684\u6570\u636e\u5168\u6ca1<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[105,371,305],"topic":[],"class_list":["post-121714","post","type-post","status-publish","format-standard","hentry","category-server","tag-redis","tag-371","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/121714.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5355\u673a Redis \u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u6570\u636e\u600e\u4e48\u5907\u4efd&#xff1f;\u8fd9\u7bc7\u8bb2 Redis \u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff1a;\u4e3b\u4ece\u590d\u5236\u8ba9\u6570\u636e\u6709\u5907\u4efd\u3001\u8bfb\u5199\u5206\u79bb&#xff0c;\u54e8\u5175\u8ba9\u6545\u969c\u81ea\u52a8\u5207\u6362&#xff0c;\u4fdd\u8bc1\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4e00\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u4e3b\u4ece\u590d\u5236&#xff1f; 1.1 \u5355\u673a Redis \u7684\u9690\u60a3 \u5355\u673a\u90e8\u7f72 Redis \u6709\u4e09\u4e2a\u95ee\u9898&#xff1a; \u5355\u70b9\u6545\u969c \u2014 \u8fd9\u53f0\u673a\u5668\u4e00\u6302&#xff0c;\u6240\u6709\u4f9d\u8d56 Redis \u7684\u670d\u52a1\u5168\u90e8\u762b\u75ea\u6570\u636e\u6ca1\u6709\u5907\u4efd \u2014 \u673a\u5668\u78c1\u76d8\u635f\u574f&#xff0c;\u5185\u5b58\u91cc\u7684\u6570\u636e\u5168\u6ca1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/121714.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-03T04:48:37+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121714.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/121714.html\",\"name\":\"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-03T04:48:37+00:00\",\"dateModified\":\"2026-11-03T04:48:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/121714.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/121714.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121714.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/121714.html","og_locale":"zh_CN","og_type":"article","og_title":"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5355\u673a Redis \u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u6570\u636e\u600e\u4e48\u5907\u4efd&#xff1f;\u8fd9\u7bc7\u8bb2 Redis \u7684\u9ad8\u53ef\u7528\u65b9\u6848&#xff1a;\u4e3b\u4ece\u590d\u5236\u8ba9\u6570\u636e\u6709\u5907\u4efd\u3001\u8bfb\u5199\u5206\u79bb&#xff0c;\u54e8\u5175\u8ba9\u6545\u969c\u81ea\u52a8\u5207\u6362&#xff0c;\u4fdd\u8bc1\u670d\u52a1\u4e0d\u4e2d\u65ad\u3002\u4e00\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u4e3b\u4ece\u590d\u5236&#xff1f; 1.1 \u5355\u673a Redis \u7684\u9690\u60a3 \u5355\u673a\u90e8\u7f72 Redis \u6709\u4e09\u4e2a\u95ee\u9898&#xff1a; \u5355\u70b9\u6545\u969c \u2014 \u8fd9\u53f0\u673a\u5668\u4e00\u6302&#xff0c;\u6240\u6709\u4f9d\u8d56 Redis \u7684\u670d\u52a1\u5168\u90e8\u762b\u75ea\u6570\u636e\u6ca1\u6709\u5907\u4efd \u2014 \u673a\u5668\u78c1\u76d8\u635f\u574f&#xff0c;\u5185\u5b58\u91cc\u7684\u6570\u636e\u5168\u6ca1","og_url":"https:\/\/www.wsisp.com\/helps\/121714.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-03T04:48:37+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/121714.html","url":"https:\/\/www.wsisp.com\/helps\/121714.html","name":"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-03T04:48:37+00:00","dateModified":"2026-11-03T04:48:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/121714.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/121714.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/121714.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Redis \u5b66\u4e60\u7b14\u8bb0\uff08\u4e94\uff09\uff1a\u9ad8\u53ef\u7528\u2014\u2014\u4e3b\u4ece\u590d\u5236\u4e0e\u54e8\u5175\u96c6\u7fa4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=121714"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121714\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=121714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=121714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=121714"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=121714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}