{"id":59813,"date":"2026-01-14T15:06:04","date_gmt":"2026-01-14T07:06:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/59813.html"},"modified":"2026-01-14T15:06:04","modified_gmt":"2026-01-14T07:06:04","slug":"redis%ef%bc%9aredis%e9%ab%98%e5%8f%af%e7%94%a8-%e5%89%af%e6%9c%ac%e3%80%81%e5%93%a8%e5%85%b5%e5%92%8c%e9%9b%86%e7%be%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/59813.html","title":{"rendered":"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>Redis\u9ad8\u53ef\u7528&#xff1a;\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4<\/li>\n<li>\n<ul>\n<li>Redis \u590d\u5236&#xff1a;\u9ad8\u53ef\u7528\u7684\u57fa\u77f3<\/li>\n<li>\n<ul>\n<li>\u6570\u636e\u540c\u6b65\u673a\u5236<\/li>\n<li>\u590d\u5236 ID \u4e0e \u504f\u79fb\u91cf<\/li>\n<li>\u5b8c\u5168\u91cd\u540c\u6b65 \u7684\u5185\u90e8\u6d41\u7a0b<\/li>\n<li>\u5173\u952e\u914d\u7f6e\u4e0e\u5b89\u5168\u6ce8\u610f\u4e8b\u9879<\/li>\n<li>\n<ul>\n<li>\u7981\u7528\u4e3b\u8282\u70b9\u6301\u4e45\u5316\u65f6\u7684\u98ce\u9669<\/li>\n<li>\u53ea\u8bfb\u4ece\u8282\u70b9<\/li>\n<li>\u6700\u5c0f\u5199\u5165\u526f\u672c\u6570<\/li>\n<li>\u952e\u7684\u8fc7\u671f\u5904\u7406<\/li>\n<\/ul>\n<\/li>\n<li>\u5e38\u7528\u547d\u4ee4<\/li>\n<\/ul>\n<\/li>\n<li>Redis Sentinel&#xff1a;\u975e\u96c6\u7fa4\u6a21\u5f0f\u4e0b\u7684\u9ad8\u53ef\u7528\u5b88\u62a4\u8005<\/li>\n<li>\n<ul>\n<li>Sentinel \u7684\u6838\u5fc3\u804c\u8d23<\/li>\n<li>Sentinel \u7684\u5206\u5e03\u5f0f\u67b6\u6784<\/li>\n<li>\n<ul>\n<li>\u6545\u969c\u68c0\u6d4b\u4e0e\u8f6c\u79fb\u6d41\u7a0b<\/li>\n<li>\u4e3b\u89c2\u4e0b\u7ebf vs \u5ba2\u89c2\u4e0b\u7ebf<\/li>\n<li>\u6cd5\u5b9a\u4eba\u6570 vs \u591a\u6570\u6d3e<\/li>\n<li>\u914d\u7f6e\u7eaa\u5143<\/li>\n<\/ul>\n<\/li>\n<li>\u90e8\u7f72\u6700\u4f73\u5b9e\u8df5<\/li>\n<li>\n<ul>\n<li>\u5e03\u5c40\u62d3\u6251<\/li>\n<li>\u907f\u514d\u201c\u8111\u88c2\u201d\u4e0e\u6570\u636e\u4e22\u5931<\/li>\n<\/ul>\n<\/li>\n<li>\u57fa\u672c\u914d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<li>Redis \u96c6\u7fa4&#xff1a;\u5b9e\u73b0\u6570\u636e\u7684\u6c34\u5e73\u6269\u5c55\u4e0e\u9ad8\u53ef\u7528<\/li>\n<li>\n<ul>\n<li>\u6838\u5fc3\u6982\u5ff5&#xff1a;\u6570\u636e\u5206\u7247\u4e0e\u54c8\u5e0c\u69fd<\/li>\n<li>\n<ul>\n<li>\u6570\u636e\u6d41\u8f6c\u793a\u610f\u56fe<\/li>\n<li>\u591a\u952e\u64cd\u4f5c\u4e0e Hash Tags<\/li>\n<\/ul>\n<\/li>\n<li>\u7f51\u7edc\u67b6\u6784&#xff1a;\u53cc\u7aef\u53e3\u8bbe\u8ba1<\/li>\n<li>\u9ad8\u53ef\u7528\u4e0e\u6545\u969c\u8f6c\u79fb\u673a\u5236<\/li>\n<li>\n<ul>\n<li>\u4e3b\u4ece\u6a21\u578b\u4e0e\u81ea\u52a8\u5207\u6362<\/li>\n<li>\u4e00\u81f4\u6027\u4fdd\u8bc1<\/li>\n<\/ul>\n<\/li>\n<li>\u5173\u952e\u914d\u7f6e\u53c2\u6570<\/li>\n<li>\u96c6\u7fa4\u8fd0\u7ef4\u5b9e\u6218\u6307\u5357<\/li>\n<li>\n<ul>\n<li>\u521b\u5efa\u96c6\u7fa4<\/li>\n<li>\u91cd\u5206\u7247<\/li>\n<li>\u589e\u52a0\u4e0e\u5220\u9664\u8282\u70b9<\/li>\n<\/ul>\n<\/li>\n<li>\u96c6\u7fa4\u4e0e\u590d\u5236\u3001\u54e8\u5175\u7684\u5173\u7cfb<\/li>\n<li>\n<ul>\n<li>\u96c6\u7fa4\u4e2d\u7684\u4e3b\u4ece\u8282\u70b9\u662f\u6307 Redis \u526f\u672c\u4e2d\u7684\u4e3b\u4ece\u8282\u70b9\u5417&#xff1f;<\/li>\n<li>\u6545\u969c\u81ea\u52a8\u6062\u590d\u662f\u5426\u4f7f\u7528\u4e86\u54e8\u5175&#xff1f;<\/li>\n<li>\u526f\u672c\u3001\u54e8\u5175\u3001\u96c6\u7fa4\u8fd9\u4e09\u4e2a\u662f\u5426\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<li>\u4ece\u5176\u4ed6\u6a21\u5f0f\u8fc1\u79fb\u5230\u96c6\u7fa4<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Redis\u9ad8\u53ef\u7528&#xff1a;\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4<\/h2>\n<p>\u5728\u6784\u5efa Redis \u670d\u52a1\u65f6&#xff0c;\u6211\u4eec\u901a\u5e38\u9762\u4e34\u4e09\u4e2a\u4e0d\u540c\u5c42\u7ea7\u7684\u9700\u6c42&#xff1a;\u6570\u636e\u5907\u4efd\u3001\u6545\u969c\u81ea\u52a8\u6062\u590d\u3001\u4ee5\u53ca\u6d77\u91cf\u6570\u636e\u5b58\u50a8\u3002Redis \u63d0\u4f9b\u4e86\u4e09\u79cd\u6838\u5fc3\u6a21\u5f0f\u6765\u5e94\u5bf9\u8fd9\u4e9b\u9700\u6c42&#xff1a;\u4e3b\u4ece\u590d\u5236\u3001\u54e8\u5175 \u548c \u96c6\u7fa4\u3002<\/p>\n<ul>\n<li>\u4e3b\u4ece\u590d\u5236&#xff1a;\u8fd9\u662f\u6700\u57fa\u7840\u7684\u6570\u636e\u5197\u4f59\u673a\u5236\u3002\u6570\u636e\u5355\u5411\u6d41\u52a8&#xff0c;\u4ece\u4e3b\u8282\u70b9\u590d\u5236\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u3002\u5b83\u4e3b\u8981\u7528\u4e8e\u6570\u636e\u5907\u4efd\u548c\u8bfb\u5199\u5206\u79bb\u3002\u5b83\u7684\u7279\u70b9\u662f\u7b80\u5355&#xff0c;\u4f46\u4e3b\u8282\u70b9\u5b95\u673a\u540e\u9700\u8981\u4eba\u5de5\u4ecb\u5165\u6216\u811a\u672c\u5904\u7406\u6545\u969c\u8f6c\u79fb&#xff0c;\u65e0\u6cd5\u81ea\u52a8\u6062\u590d\u3002<\/li>\n<\/ul>\n<p>  #mermaid-svg-ASXHF7ih0k7SLjSv{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-ASXHF7ih0k7SLjSv .error-icon{fill:#552222;}#mermaid-svg-ASXHF7ih0k7SLjSv .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-ASXHF7ih0k7SLjSv .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-ASXHF7ih0k7SLjSv .marker{fill:#333333;stroke:#333333;}#mermaid-svg-ASXHF7ih0k7SLjSv .marker.cross{stroke:#333333;}#mermaid-svg-ASXHF7ih0k7SLjSv svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-ASXHF7ih0k7SLjSv p{margin:0;}#mermaid-svg-ASXHF7ih0k7SLjSv .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster-label text{fill:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster-label span{color:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster-label span p{background-color:transparent;}#mermaid-svg-ASXHF7ih0k7SLjSv .label text,#mermaid-svg-ASXHF7ih0k7SLjSv span{fill:#333;color:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv .node rect,#mermaid-svg-ASXHF7ih0k7SLjSv .node circle,#mermaid-svg-ASXHF7ih0k7SLjSv .node ellipse,#mermaid-svg-ASXHF7ih0k7SLjSv .node polygon,#mermaid-svg-ASXHF7ih0k7SLjSv .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-ASXHF7ih0k7SLjSv .rough-node .label text,#mermaid-svg-ASXHF7ih0k7SLjSv .node .label text,#mermaid-svg-ASXHF7ih0k7SLjSv .image-shape .label,#mermaid-svg-ASXHF7ih0k7SLjSv .icon-shape .label{text-anchor:middle;}#mermaid-svg-ASXHF7ih0k7SLjSv .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-ASXHF7ih0k7SLjSv .rough-node .label,#mermaid-svg-ASXHF7ih0k7SLjSv .node .label,#mermaid-svg-ASXHF7ih0k7SLjSv .image-shape .label,#mermaid-svg-ASXHF7ih0k7SLjSv .icon-shape .label{text-align:center;}#mermaid-svg-ASXHF7ih0k7SLjSv .node.clickable{cursor:pointer;}#mermaid-svg-ASXHF7ih0k7SLjSv .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-ASXHF7ih0k7SLjSv .arrowheadPath{fill:#333333;}#mermaid-svg-ASXHF7ih0k7SLjSv .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-ASXHF7ih0k7SLjSv .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-ASXHF7ih0k7SLjSv .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-ASXHF7ih0k7SLjSv .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-ASXHF7ih0k7SLjSv .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-ASXHF7ih0k7SLjSv .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster text{fill:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv .cluster span{color:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-ASXHF7ih0k7SLjSv .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-ASXHF7ih0k7SLjSv rect.text{fill:none;stroke-width:0;}#mermaid-svg-ASXHF7ih0k7SLjSv .icon-shape,#mermaid-svg-ASXHF7ih0k7SLjSv .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-ASXHF7ih0k7SLjSv .icon-shape p,#mermaid-svg-ASXHF7ih0k7SLjSv .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-ASXHF7ih0k7SLjSv .icon-shape rect,#mermaid-svg-ASXHF7ih0k7SLjSv .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-ASXHF7ih0k7SLjSv .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-ASXHF7ih0k7SLjSv .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-ASXHF7ih0k7SLjSv :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>           <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u4ece\u590d\u5236\u67b6\u6784<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u5199\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u8bfb\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u8bfb\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u8bfb\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u5f02\u6b65\u590d\u5236<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"edgeLabel\"><\/p>\n<p>\u5f02\u6b65\u590d\u5236<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"nodeLabel\"><\/p>\n<p>\u5ba2\u6237\u7aef<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9 Master\u8d1f\u8d23\u5199<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 Replica 1<\/p>\n<p><\/span><\/p>\n<p>           <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 Replica 2<\/p>\n<p><\/span><\/p>\n<ul>\n<li>\u54e8\u5175&#xff1a;\u54e8\u5175\u662f\u8fd0\u884c\u5728\u7279\u6b8a\u6a21\u5f0f\u4e0b\u7684 Redis \u8fdb\u7a0b&#xff0c;\u5b83\u76d1\u63a7\u4e3b\u4ece\u590d\u5236\u67b6\u6784\u3002\u5f53\u4e3b\u8282\u70b9\u6545\u969c\u65f6&#xff0c;\u54e8\u5175\u4f1a\u81ea\u52a8\u6295\u7968\u9009\u4e3e\u4ece\u8282\u70b9\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9&#xff0c;\u5b9e\u73b0\u9ad8\u53ef\u7528\u3002\u5b83\u7684\u7279\u70b9\u662f\u81ea\u52a8\u6545\u969c\u8f6c\u79fb&#xff0c;\u7cfb\u7edf\u66f4\u5065\u58ee\u3002\u4f46\u6570\u636e\u4ecd\u5728\u5355\u4e2a\u4e3b\u8282\u70b9\u4e0a&#xff0c;\u5185\u5b58\u5bb9\u91cf\u53d7\u9650\u4e8e\u5355\u673a\u3002<\/li>\n<\/ul>\n<p>  #mermaid-svg-MCI0Ak6GLorELYmr{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-MCI0Ak6GLorELYmr .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-MCI0Ak6GLorELYmr .error-icon{fill:#552222;}#mermaid-svg-MCI0Ak6GLorELYmr .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-MCI0Ak6GLorELYmr .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-MCI0Ak6GLorELYmr .marker{fill:#333333;stroke:#333333;}#mermaid-svg-MCI0Ak6GLorELYmr .marker.cross{stroke:#333333;}#mermaid-svg-MCI0Ak6GLorELYmr svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-MCI0Ak6GLorELYmr p{margin:0;}#mermaid-svg-MCI0Ak6GLorELYmr .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-MCI0Ak6GLorELYmr .cluster-label text{fill:#333;}#mermaid-svg-MCI0Ak6GLorELYmr .cluster-label span{color:#333;}#mermaid-svg-MCI0Ak6GLorELYmr .cluster-label span p{background-color:transparent;}#mermaid-svg-MCI0Ak6GLorELYmr .label text,#mermaid-svg-MCI0Ak6GLorELYmr span{fill:#333;color:#333;}#mermaid-svg-MCI0Ak6GLorELYmr .node rect,#mermaid-svg-MCI0Ak6GLorELYmr .node circle,#mermaid-svg-MCI0Ak6GLorELYmr .node ellipse,#mermaid-svg-MCI0Ak6GLorELYmr .node polygon,#mermaid-svg-MCI0Ak6GLorELYmr .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-MCI0Ak6GLorELYmr .rough-node .label text,#mermaid-svg-MCI0Ak6GLorELYmr .node .label text,#mermaid-svg-MCI0Ak6GLorELYmr .image-shape .label,#mermaid-svg-MCI0Ak6GLorELYmr .icon-shape .label{text-anchor:middle;}#mermaid-svg-MCI0Ak6GLorELYmr .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-MCI0Ak6GLorELYmr .rough-node .label,#mermaid-svg-MCI0Ak6GLorELYmr .node .label,#mermaid-svg-MCI0Ak6GLorELYmr .image-shape .label,#mermaid-svg-MCI0Ak6GLorELYmr .icon-shape .label{text-align:center;}#mermaid-svg-MCI0Ak6GLorELYmr .node.clickable{cursor:pointer;}#mermaid-svg-MCI0Ak6GLorELYmr .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-MCI0Ak6GLorELYmr .arrowheadPath{fill:#333333;}#mermaid-svg-MCI0Ak6GLorELYmr .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-MCI0Ak6GLorELYmr .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-MCI0Ak6GLorELYmr .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MCI0Ak6GLorELYmr .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-MCI0Ak6GLorELYmr .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MCI0Ak6GLorELYmr .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-MCI0Ak6GLorELYmr .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-MCI0Ak6GLorELYmr .cluster text{fill:#333;}#mermaid-svg-MCI0Ak6GLorELYmr .cluster span{color:#333;}#mermaid-svg-MCI0Ak6GLorELYmr div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-MCI0Ak6GLorELYmr .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-MCI0Ak6GLorELYmr rect.text{fill:none;stroke-width:0;}#mermaid-svg-MCI0Ak6GLorELYmr .icon-shape,#mermaid-svg-MCI0Ak6GLorELYmr .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-MCI0Ak6GLorELYmr .icon-shape p,#mermaid-svg-MCI0Ak6GLorELYmr .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-MCI0Ak6GLorELYmr .icon-shape rect,#mermaid-svg-MCI0Ak6GLorELYmr .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-MCI0Ak6GLorELYmr .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-MCI0Ak6GLorELYmr .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-MCI0Ak6GLorELYmr :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6570\u636e\u5c42 \u4e3b\u4ece<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u54e8\u5175\u76d1\u63a7\u5c42<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u54e8\u5175\u8282\u70b9 1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u54e8\u5175\u8282\u70b9 2<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u54e8\u5175\u8282\u70b9 3<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9 Master<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5347\u4e3a\u65b0\u4e3b<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 Replica<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6545\u969c\u65f6: \u54e8\u5175\u534f\u5546<\/p>\n<p><\/span><\/p>\n<ul>\n<li>\u96c6\u7fa4&#xff1a;\u96c6\u7fa4\u662f Redis \u7684\u5206\u5e03\u5f0f\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u5c06\u6570\u636e\u81ea\u52a8\u5206\u7247\u5b58\u50a8\u5728\u591a\u4e2a\u4e3b\u8282\u70b9\u4e2d&#xff0c;\u6bcf\u4e2a\u4e3b\u8282\u70b9\u90fd\u6709\u4ece\u8282\u70b9\u3002\u5b83\u89e3\u51b3\u4e86\u5355\u673a\u5185\u5b58\u9650\u5236\u548c\u7f51\u7edc\u74f6\u9888\u95ee\u9898\u3002\u5b83\u7684\u7279\u70b9\u662f\u81ea\u52a8\u5206\u7247\u3001\u9ad8\u53ef\u7528\u3001\u6c34\u5e73\u6269\u5c55\u3002\u9002\u7528\u4e8e\u6d77\u91cf\u6570\u636e\u548c\u9ad8\u5e76\u53d1\u573a\u666f&#xff0c;\u4f46\u5ba2\u6237\u7aef\u903b\u8f91\u8f83\u590d\u6742&#xff0c;\u4e14\u4e0d\u652f\u6301\u8de8\u8282\u70b9\u7684\u591a\u952e\u64cd\u4f5c&#xff08;\u5982 Multi-key&#xff09;\u3002<\/li>\n<\/ul>\n<p>  #mermaid-svg-cym1hXhfY2q0foAS{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-cym1hXhfY2q0foAS .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-cym1hXhfY2q0foAS .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-cym1hXhfY2q0foAS .error-icon{fill:#552222;}#mermaid-svg-cym1hXhfY2q0foAS .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-cym1hXhfY2q0foAS .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-cym1hXhfY2q0foAS .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-cym1hXhfY2q0foAS .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-cym1hXhfY2q0foAS .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-cym1hXhfY2q0foAS .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-cym1hXhfY2q0foAS .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-cym1hXhfY2q0foAS .marker{fill:#333333;stroke:#333333;}#mermaid-svg-cym1hXhfY2q0foAS .marker.cross{stroke:#333333;}#mermaid-svg-cym1hXhfY2q0foAS svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-cym1hXhfY2q0foAS p{margin:0;}#mermaid-svg-cym1hXhfY2q0foAS .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-cym1hXhfY2q0foAS .cluster-label text{fill:#333;}#mermaid-svg-cym1hXhfY2q0foAS .cluster-label span{color:#333;}#mermaid-svg-cym1hXhfY2q0foAS .cluster-label span p{background-color:transparent;}#mermaid-svg-cym1hXhfY2q0foAS .label text,#mermaid-svg-cym1hXhfY2q0foAS span{fill:#333;color:#333;}#mermaid-svg-cym1hXhfY2q0foAS .node rect,#mermaid-svg-cym1hXhfY2q0foAS .node circle,#mermaid-svg-cym1hXhfY2q0foAS .node ellipse,#mermaid-svg-cym1hXhfY2q0foAS .node polygon,#mermaid-svg-cym1hXhfY2q0foAS .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-cym1hXhfY2q0foAS .rough-node .label text,#mermaid-svg-cym1hXhfY2q0foAS .node .label text,#mermaid-svg-cym1hXhfY2q0foAS .image-shape .label,#mermaid-svg-cym1hXhfY2q0foAS .icon-shape .label{text-anchor:middle;}#mermaid-svg-cym1hXhfY2q0foAS .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-cym1hXhfY2q0foAS .rough-node .label,#mermaid-svg-cym1hXhfY2q0foAS .node .label,#mermaid-svg-cym1hXhfY2q0foAS .image-shape .label,#mermaid-svg-cym1hXhfY2q0foAS .icon-shape .label{text-align:center;}#mermaid-svg-cym1hXhfY2q0foAS .node.clickable{cursor:pointer;}#mermaid-svg-cym1hXhfY2q0foAS .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-cym1hXhfY2q0foAS .arrowheadPath{fill:#333333;}#mermaid-svg-cym1hXhfY2q0foAS .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-cym1hXhfY2q0foAS .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-cym1hXhfY2q0foAS .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-cym1hXhfY2q0foAS .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-cym1hXhfY2q0foAS .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-cym1hXhfY2q0foAS .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-cym1hXhfY2q0foAS .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-cym1hXhfY2q0foAS .cluster text{fill:#333;}#mermaid-svg-cym1hXhfY2q0foAS .cluster span{color:#333;}#mermaid-svg-cym1hXhfY2q0foAS div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-cym1hXhfY2q0foAS .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-cym1hXhfY2q0foAS rect.text{fill:none;stroke-width:0;}#mermaid-svg-cym1hXhfY2q0foAS .icon-shape,#mermaid-svg-cym1hXhfY2q0foAS .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-cym1hXhfY2q0foAS .icon-shape p,#mermaid-svg-cym1hXhfY2q0foAS .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-cym1hXhfY2q0foAS .icon-shape rect,#mermaid-svg-cym1hXhfY2q0foAS .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-cym1hXhfY2q0foAS .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-cym1hXhfY2q0foAS .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-cym1hXhfY2q0foAS :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u96c6\u7fa4\u5206\u7247\u67b6\u6784<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Slot 10001-16383<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Slot 5001-10000<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Slot 0-5000<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8def\u7531\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8def\u7531\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8def\u7531\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9 A<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 A&#039;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9 B<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 B&#039;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9 C<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece\u8282\u70b9 C&#039;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5ba2\u6237\u7aef<\/p>\n<p><\/span><\/p>\n<table>\n<tr>\u7279\u6027\u7ef4\u5ea6\u4e3b\u4ece\u590d\u5236\u54e8\u5175\u96c6\u7fa4<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u6838\u5fc3\u76ee\u6807<\/td>\n<td align=\"left\">\u6570\u636e\u5197\u4f59\u3001\u8bfb\u5199\u5206\u79bb<\/td>\n<td align=\"left\">\u81ea\u52a8\u6545\u969c\u8f6c\u79fb (\u9ad8\u53ef\u7528)<\/td>\n<td align=\"left\">\u6570\u636e\u5206\u7247\u3001\u6c34\u5e73\u6269\u5c55 (\u9ad8\u5e76\u53d1&#043;\u5927\u5bb9\u91cf)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6570\u636e\u5206\u7247<\/td>\n<td align=\"left\">\u5426&#xff0c;\u6240\u6709\u6570\u636e\u90fd\u5728\u4e3b\u8282\u70b9<\/td>\n<td align=\"left\">\u5426&#xff0c;\u6240\u6709\u6570\u636e\u90fd\u5728\u4e3b\u8282\u70b9<\/td>\n<td align=\"left\">\u662f&#xff0c;\u6570\u636e\u5206\u6563\u5728\u591a\u4e2a\u4e3b\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5728\u7ebf\u6269\u5bb9<\/td>\n<td align=\"left\">\u624b\u52a8\u6dfb\u52a0\u4ece\u8282\u70b9&#xff0c;\u4e0d\u589e\u52a0\u5bb9\u91cf<\/td>\n<td align=\"left\">\u624b\u52a8\u6dfb\u52a0\u8282\u70b9&#xff0c;\u4e0d\u589e\u52a0\u5bb9\u91cf<\/td>\n<td align=\"left\">\u652f\u6301\u52a8\u6001\u6dfb\u52a0\u8282\u70b9\u5e76\u91cd\u65b0\u5206\u7247<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6545\u969c\u8f6c\u79fb<\/td>\n<td align=\"left\">\u9700\u8981\u4eba\u5de5\u4ecb\u5165\u6216\u811a\u672c<\/td>\n<td align=\"left\">\u81ea\u52a8\u5316 (Sentinel \u9009\u4e3e)<\/td>\n<td align=\"left\">\u81ea\u52a8\u5316 (\u8282\u70b9\u95f4\u901a\u4fe1\u6295\u7968)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u8fd0\u7ef4\u590d\u6742\u5ea6<\/td>\n<td align=\"left\">\u4f4e<\/td>\n<td align=\"left\">\u4e2d<\/td>\n<td align=\"left\">\u8f83\u9ad8<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5ba2\u6237\u7aef\u652f\u6301<\/td>\n<td align=\"left\">\u6240\u6709\u5ba2\u6237\u7aef\u5747\u652f\u6301<\/td>\n<td align=\"left\">\u5927\u591a\u6570\u5ba2\u6237\u7aef\u652f\u6301<\/td>\n<td align=\"left\">\u9700\u652f\u6301 Cluster \u534f\u8bae\u7684\u5ba2\u6237\u7aef<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u7f51\u7edc\u5206\u533a\u5bb9\u5fcd<\/td>\n<td align=\"left\">\u4e3b\u8282\u70b9\u5b95\u673a\u4e0d\u53ef\u5199<\/td>\n<td align=\"left\">\u5c11\u6570 Sentinel \u5b58\u6d3b\u5373\u53ef\u5de5\u4f5c<\/td>\n<td align=\"left\">\u591a\u6570 Master \u5b58\u6d3b\u5373\u53ef\u5de5\u4f5c (\u9700\u6ce8\u610f\u8111\u88c2)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u591a\u952e\u64cd\u4f5c<\/td>\n<td align=\"left\">\u652f\u6301<\/td>\n<td align=\"left\">\u652f\u6301<\/td>\n<td align=\"left\">\u4ec5\u5f53 key \u5728\u540c\u4e00 slot \u65f6\u652f\u6301 (\u4f7f\u7528 Hash Tag \u89e3\u51b3)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Redis \u590d\u5236&#xff1a;\u9ad8\u53ef\u7528\u7684\u57fa\u77f3<\/h3>\n<p>Redis \u7684\u590d\u5236\u673a\u5236\u662f\u5b9e\u73b0\u6570\u636e\u5907\u4efd\u3001\u8bfb\u53d6\u6269\u5c55\u548c\u9ad8\u53ef\u7528\u6027\u7684\u57fa\u7840\u3002\u5728\u6700\u5e95\u5c42&#xff0c;\u5b83\u91c7\u7528\u7684\u662f\u4e3b\u4ece\u590d\u5236 \u6a21\u5f0f\u3002\u8fd9\u79cd\u6a21\u5f0f\u7b80\u5355\u6613\u7528&#xff0c;\u5141\u8bb8\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u6210\u4e3a\u4e3b\u8282\u70b9\u7684\u7cbe\u786e\u526f\u672c\u3002 \u65e0\u8bba\u4e3b\u8282\u70b9\u53d1\u751f\u4ec0\u4e48\u60c5\u51b5&#xff0c;\u4ece\u8282\u70b9\u90fd\u4f1a\u5c1d\u8bd5\u81ea\u52a8\u91cd\u8fde\u5e76\u4e0e\u5176\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<h4>\u6570\u636e\u540c\u6b65\u673a\u5236<\/h4>\n<p>Redis\u4e3b\u8981\u4f9d\u8d56\u4ee5\u4e0b\u4e09\u79cd\u673a\u5236\u6765\u7ef4\u6301\u6570\u636e\u540c\u6b65&#xff1a;<\/p>\n<li>\u547d\u4ee4\u4f20\u64ad&#xff1a;\u5f53\u4e3b\u4ece\u8fde\u63a5\u6b63\u5e38\u65f6&#xff0c;\u4e3b\u8282\u70b9\u5c06\u63a5\u6536\u5230\u7684\u5199\u64cd\u4f5c&#xff08;\u5ba2\u6237\u7aef\u5199\u5165\u3001\u952e\u8fc7\u671f\u9a71\u9010\u7b49&#xff09;\u4ee5\u547d\u4ee4\u6d41\u7684\u5f62\u5f0f\u53d1\u9001\u7ed9\u4ece\u8282\u70b9\u3002<\/li>\n<li>\u90e8\u5206\u91cd\u540c\u6b65&#xff1a;\u5982\u679c\u8fde\u63a5\u65ad\u5f00&#xff08;\u7f51\u7edc\u6296\u52a8\u6216\u8d85\u65f6&#xff09;&#xff0c;\u4ece\u8282\u70b9\u91cd\u8fde\u540e\u4f1a\u5c1d\u8bd5\u83b7\u53d6\u65ad\u5f00\u671f\u95f4\u7f3a\u5931\u7684\u547d\u4ee4\u6d41\u3002<\/li>\n<li>\u5b8c\u5168\u91cd\u540c\u6b65&#xff1a;\u5982\u679c\u65e0\u6cd5\u8fdb\u884c\u90e8\u5206\u540c\u6b65&#xff08;\u4f8b\u5982\u7f3a\u5931\u7684\u6570\u636e\u592a\u65e7&#xff09;&#xff0c;\u4ece\u8282\u70b9\u4f1a\u8bf7\u6c42\u5b8c\u6574\u7684\u6570\u636e\u96c6\u5feb\u7167\u3002\u4e3b\u8282\u70b9\u4f1a\u751f\u6210 RDB \u6587\u4ef6\u53d1\u9001\u7ed9\u4ece\u8282\u70b9&#xff0c;\u5e76\u540c\u6b65\u7f13\u51b2\u533a\u4e2d\u7684\u65b0\u5199\u547d\u4ee4\u3002<\/li>\n<p>  #mermaid-svg-WCw9v4wO6lHYTRY3{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-WCw9v4wO6lHYTRY3 .error-icon{fill:#552222;}#mermaid-svg-WCw9v4wO6lHYTRY3 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-WCw9v4wO6lHYTRY3 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .marker.cross{stroke:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-WCw9v4wO6lHYTRY3 p{margin:0;}#mermaid-svg-WCw9v4wO6lHYTRY3 defs #statediagram-barbEnd{fill:#333333;stroke:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 g.stateGroup text{fill:#9370DB;stroke:none;font-size:10px;}#mermaid-svg-WCw9v4wO6lHYTRY3 g.stateGroup text{fill:#333;stroke:none;font-size:10px;}#mermaid-svg-WCw9v4wO6lHYTRY3 g.stateGroup .state-title{font-weight:bolder;fill:#131300;}#mermaid-svg-WCw9v4wO6lHYTRY3 g.stateGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-WCw9v4wO6lHYTRY3 g.stateGroup line{stroke:#333333;stroke-width:1;}#mermaid-svg-WCw9v4wO6lHYTRY3 .transition{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-WCw9v4wO6lHYTRY3 .stateGroup .composit{fill:white;border-bottom:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .state-note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-WCw9v4wO6lHYTRY3 .state-note text{fill:black;stroke:none;font-size:10px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edgeLabel .label rect{fill:#ECECFF;opacity:0.5;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-WCw9v4wO6lHYTRY3 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-WCw9v4wO6lHYTRY3 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-WCw9v4wO6lHYTRY3 .edgeLabel .label text{fill:#333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .label div .edgeLabel{color:#333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .stateLabel text{fill:#131300;font-size:10px;font-weight:bold;}#mermaid-svg-WCw9v4wO6lHYTRY3 .node circle.state-start{fill:#333333;stroke:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .node .fork-join{fill:#333333;stroke:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .node circle.state-end{fill:#9370DB;stroke:white;stroke-width:1.5;}#mermaid-svg-WCw9v4wO6lHYTRY3 .end-state-inner{fill:white;stroke-width:1.5;}#mermaid-svg-WCw9v4wO6lHYTRY3 .node rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 #statediagram-barbEnd{fill:#333333;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .cluster-label,#mermaid-svg-WCw9v4wO6lHYTRY3 .nodeLabel{color:#131300;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-cluster rect.outer{rx:5px;ry:5px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-state .divider{stroke:#9370DB;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-state .title-state{rx:5px;ry:5px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-cluster.statediagram-cluster .inner{fill:white;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-cluster.statediagram-cluster-alt .inner{fill:#f0f0f0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-cluster .inner{rx:0;ry:0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-state rect.basic{rx:5px;ry:5px;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#f0f0f0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .note-edge{stroke-dasharray:5;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-note text{fill:black;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram-note .nodeLabel{color:black;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagram .edgeLabel{color:red;}#mermaid-svg-WCw9v4wO6lHYTRY3 #dependencyStart,#mermaid-svg-WCw9v4wO6lHYTRY3 #dependencyEnd{fill:#333333;stroke:#333333;stroke-width:1;}#mermaid-svg-WCw9v4wO6lHYTRY3 .statediagramTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-WCw9v4wO6lHYTRY3 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u63a5\u6536\u547d\u4ee4\u6d41<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u7f51\u7edc\u6545\u969c\/\u8d85\u65f6<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u91cd\u8fde\u6210\u529f\u4e14\u589e\u91cf\u5728\u7f13\u51b2\u533a<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u589e\u91cf\u4e22\u5931\u6216 ID \u4e0d\u5339\u914d<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8865\u9f50\u7f3a\u5931\u6570\u636e<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u52a0\u8f7d RDB \u53ca\u7f13\u51b2\u6570\u636e<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u8fde\u63a5\u5efa\u7acb<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u547d\u4ee4\u4f20\u64ad<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u94fe\u8def\u65ad\u5f00<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u90e8\u5206\u91cd\u540c\u6b65<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5b8c\u5168\u91cd\u540c\u6b65<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b\u8282\u70b9\u6301\u7eed\u53d1\u9001\u5199\u547d\u4ee4\u7ed9\u4ece\u8282\u70b9\u4fdd\u6301\u6570\u636e\u4e00\u81f4<\/p>\n<p><\/span><\/p>\n<h4>\u590d\u5236 ID \u4e0e \u504f\u79fb\u91cf<\/h4>\n<p>\u4e3a\u4e86\u5224\u65ad\u4e24\u4e2a\u5b9e\u4f8b\u7684\u6570\u636e\u662f\u5426\u4e00\u81f4&#xff0c;Redis \u4f7f\u7528\u4e86\u4e24\u4e2a\u6982\u5ff5&#xff1a;<\/p>\n<ul>\n<li>\u590d\u5236 ID&#xff1a;\u4e00\u4e2a\u6807\u8bb0\u6570\u636e\u96c6\u7279\u5b9a\u5386\u53f2\u7684\u5927\u578b\u4f2a\u968f\u673a\u5b57\u7b26\u4e32\u3002<\/li>\n<li>\u504f\u79fb\u91cf&#xff1a;\u4e00\u4e2a\u968f\u7740\u5904\u7406\u590d\u5236\u6d41\u800c\u4e0d\u65ad\u9012\u589e\u7684\u6570\u5b57\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4e24\u4e2a\u5b9e\u4f8b\u62e5\u6709\u76f8\u540c\u7684 \u590d\u5236 ID \u548c \u504f\u79fb\u91cf&#xff0c;\u5b83\u4eec\u7684\u6570\u636e\u5c31\u662f\u5b8c\u5168\u4e00\u81f4\u7684\u3002\u6b64\u5916&#xff0c; Redis \u5b9e\u4f8b\u5b9e\u9645\u4e0a\u7ef4\u62a4\u4e24\u4e2a ID&#xff1a;\u4e3b ID \u548c\u8f85\u52a9 ID\u3002\u8fd9\u662f\u4e3a\u4e86\u5904\u7406\u6545\u969c\u8f6c\u79fb \u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u5f53\u4e00\u4e2a\u4ece\u8282\u70b9\u88ab\u63d0\u5347\u4e3a\u4e3b\u8282\u70b9\u65f6&#xff0c;\u5b83\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u4e3b ID&#xff08;\u5f00\u542f\u65b0\u7684\u5386\u53f2&#xff09;\u3002<\/li>\n<li>\u540c\u65f6&#xff0c;\u5b83\u5c06\u65e7\u7684\u4e3b ID \u8bb0\u4e3a\u8f85\u52a9 ID\u3002<\/li>\n<li>\u4f5c\u7528&#xff1a;\u5176\u4ed6\u65e7\u7684\u4ece\u8282\u70b9\u91cd\u8fde\u65f6&#xff0c;\u53ef\u4ee5\u51ed\u501f\u8f85\u52a9 ID \u548c\u504f\u79fb\u91cf\u8fdb\u884c\u201c\u90e8\u5206\u91cd\u540c\u6b65\u201d&#xff0c;\u800c\u4e0d\u5fc5\u8fdb\u884c\u6602\u8d35\u7684\u201c\u5b8c\u5168\u91cd\u540c\u6b65\u201d\u3002\u8fd9\u907f\u514d\u4e86\u7f51\u7edc\u5206\u533a\u5bfc\u81f4\u65e7\u4e3b\u8282\u70b9\u6062\u590d\u65f6\u7684 ID \u51b2\u7a81\u3002<\/li>\n<\/ul>\n<h4>\u5b8c\u5168\u91cd\u540c\u6b65 \u7684\u5185\u90e8\u6d41\u7a0b<\/h4>\n<p>\u5f53\u9700\u8981\u8fdb\u884c\u5b8c\u5168\u540c\u6b65\u65f6&#xff0c;Redis \u4f1a\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\u3002\u8fd9\u662f\u4e00\u4e2a\u5de7\u5999\u7684\u540e\u53f0\u5904\u7406\u8fc7\u7a0b&#xff0c;\u65e8\u5728\u4e0d\u963b\u585e\u4e3b\u7ebf\u7a0b&#xff1a;<\/p>\n<p>     \u4ece\u8282\u70b9<\/p>\n<p>     \u78c1\u76d8<\/p>\n<p>     \u4e3b\u8282\u70b9 (\u5b50\u8fdb\u7a0b)<\/p>\n<p>     \u4e3b\u8282\u70b9 (\u7236\u8fdb\u7a0b)<\/p>\n<p>     \u5ba2\u6237\u7aef<\/p>\n<p>      \u4ece\u8282\u70b9<\/p>\n<p>      \u78c1\u76d8<\/p>\n<p>      \u4e3b\u8282\u70b9 (\u5b50\u8fdb\u7a0b)<\/p>\n<p>      \u4e3b\u8282\u70b9 (\u7236\u8fdb\u7a0b)<\/p>\n<p>      \u5ba2\u6237\u7aef<\/p>\n<p>  #mermaid-svg-LYPW2hXRjCPVgAlf{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-LYPW2hXRjCPVgAlf .error-icon{fill:#552222;}#mermaid-svg-LYPW2hXRjCPVgAlf .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-LYPW2hXRjCPVgAlf .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-LYPW2hXRjCPVgAlf .marker{fill:#333333;stroke:#333333;}#mermaid-svg-LYPW2hXRjCPVgAlf .marker.cross{stroke:#333333;}#mermaid-svg-LYPW2hXRjCPVgAlf svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-LYPW2hXRjCPVgAlf p{margin:0;}#mermaid-svg-LYPW2hXRjCPVgAlf .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LYPW2hXRjCPVgAlf text.actor&gt;tspan{fill:black;stroke:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-LYPW2hXRjCPVgAlf .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-LYPW2hXRjCPVgAlf .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-LYPW2hXRjCPVgAlf #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-LYPW2hXRjCPVgAlf .sequenceNumber{fill:white;}#mermaid-svg-LYPW2hXRjCPVgAlf #sequencenumber{fill:#333;}#mermaid-svg-LYPW2hXRjCPVgAlf #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-LYPW2hXRjCPVgAlf .messageText{fill:#333;stroke:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LYPW2hXRjCPVgAlf .labelText,#mermaid-svg-LYPW2hXRjCPVgAlf .labelText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .loopText,#mermaid-svg-LYPW2hXRjCPVgAlf .loopText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-LYPW2hXRjCPVgAlf .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-LYPW2hXRjCPVgAlf .noteText,#mermaid-svg-LYPW2hXRjCPVgAlf .noteText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-LYPW2hXRjCPVgAlf .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LYPW2hXRjCPVgAlf .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LYPW2hXRjCPVgAlf .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LYPW2hXRjCPVgAlf .actorPopupMenu{position:absolute;}#mermaid-svg-LYPW2hXRjCPVgAlf .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 \/ 0.4));}#mermaid-svg-LYPW2hXRjCPVgAlf .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LYPW2hXRjCPVgAlf .actor-man circle,#mermaid-svg-LYPW2hXRjCPVgAlf line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-LYPW2hXRjCPVgAlf :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>     \u89e6\u53d1 BGSAVE<\/p>\n<p>     \u6b64\u65f6\u4ece\u8282\u70b9\u72b6\u6001\u4e0e\u4e3b\u8282\u70b9\u4e00\u81f4<\/p>\n<p>   \u5199\u5165\u65b0\u6570\u636e<\/p>\n<p>   \u7f13\u5b58\u5199\u547d\u4ee4\u5230\u5185\u5b58\u7f13\u51b2\u533a<\/p>\n<p>   Fork() \u521b\u5efa\u5b50\u8fdb\u7a0b<\/p>\n<p>   \u751f\u6210 RDB \u5feb\u7167\u6587\u4ef6<\/p>\n<p>   \u7ee7\u7eed\u5904\u7406\u8bf7\u6c42<\/p>\n<p>   \u5feb\u7167\u5b8c\u6210<\/p>\n<p>   \u901a\u77e5\u5b8c\u6210<\/p>\n<p>   \u53d1\u9001 RDB \u6587\u4ef6<\/p>\n<p>   \u4fdd\u5b58 RDB \u5230\u672c\u5730<\/p>\n<p>   \u52a0\u8f7d RDB \u5230\u5185\u5b58<\/p>\n<p>   \u53d1\u9001\u7f13\u51b2\u533a\u7684\u589e\u91cf\u547d\u4ee4<\/p>\n<ul>\n<li>\u65e0\u76d8\u590d\u5236&#xff1a;\u5982\u679c\u78c1\u76d8 IO \u662f\u74f6\u9888&#xff0c;\u53ef\u4ee5\u914d\u7f6e repl-diskless-sync\u3002\u5b50\u8fdb\u7a0b\u76f4\u63a5\u901a\u8fc7\u7f51\u7edc\u5c06 RDB \u53d1\u9001\u7ed9\u4ece\u8282\u70b9&#xff0c;\u8df3\u8fc7\u78c1\u76d8\u5b58\u50a8&#xff0c;\u63d0\u9ad8\u540c\u6b65\u901f\u5ea6\u3002<\/li>\n<\/ul>\n<h4>\u5173\u952e\u914d\u7f6e\u4e0e\u5b89\u5168\u6ce8\u610f\u4e8b\u9879<\/h4>\n<h5>\u7981\u7528\u4e3b\u8282\u70b9\u6301\u4e45\u5316\u65f6\u7684\u98ce\u9669<\/h5>\n<p>\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u5b89\u5168\u8b66\u544a\u3002\u5982\u679c\u5728\u590d\u5236\u914d\u7f6e\u4e2d&#xff0c;\u4e3b\u8282\u70b9\u5173\u95ed\u4e86\u6301\u4e45\u5316&#xff08;RDB\/AOF&#xff09;&#xff0c;\u5e76\u4e14\u914d\u7f6e\u4e86\u81ea\u52a8\u91cd\u542f&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u5f7b\u5e95\u4e22\u5931\u3002\u4e3a\u4e86\u6570\u636e\u5b89\u5168&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u5728\u4e3b\u8282\u70b9\u548c\u4ece\u8282\u70b9\u4e0a\u90fd\u5f00\u542f\u6301\u4e45\u5316\u3002\u5982\u679c\u5fc5\u987b\u5173\u95ed\u4e3b\u8282\u70b9\u6301\u4e45\u5316&#xff0c;\u5219\u7edd\u4e0d\u8981\u914d\u7f6e\u81ea\u52a8\u91cd\u542f\u3002<\/p>\n<p>  #mermaid-svg-NUjHuyGzgDJXT6mA{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-NUjHuyGzgDJXT6mA .error-icon{fill:#552222;}#mermaid-svg-NUjHuyGzgDJXT6mA .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-NUjHuyGzgDJXT6mA .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-NUjHuyGzgDJXT6mA .marker{fill:#333333;stroke:#333333;}#mermaid-svg-NUjHuyGzgDJXT6mA .marker.cross{stroke:#333333;}#mermaid-svg-NUjHuyGzgDJXT6mA svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-NUjHuyGzgDJXT6mA p{margin:0;}#mermaid-svg-NUjHuyGzgDJXT6mA .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster-label text{fill:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster-label span{color:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster-label span p{background-color:transparent;}#mermaid-svg-NUjHuyGzgDJXT6mA .label text,#mermaid-svg-NUjHuyGzgDJXT6mA span{fill:#333;color:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA .node rect,#mermaid-svg-NUjHuyGzgDJXT6mA .node circle,#mermaid-svg-NUjHuyGzgDJXT6mA .node ellipse,#mermaid-svg-NUjHuyGzgDJXT6mA .node polygon,#mermaid-svg-NUjHuyGzgDJXT6mA .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-NUjHuyGzgDJXT6mA .rough-node .label text,#mermaid-svg-NUjHuyGzgDJXT6mA .node .label text,#mermaid-svg-NUjHuyGzgDJXT6mA .image-shape .label,#mermaid-svg-NUjHuyGzgDJXT6mA .icon-shape .label{text-anchor:middle;}#mermaid-svg-NUjHuyGzgDJXT6mA .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-NUjHuyGzgDJXT6mA .rough-node .label,#mermaid-svg-NUjHuyGzgDJXT6mA .node .label,#mermaid-svg-NUjHuyGzgDJXT6mA .image-shape .label,#mermaid-svg-NUjHuyGzgDJXT6mA .icon-shape .label{text-align:center;}#mermaid-svg-NUjHuyGzgDJXT6mA .node.clickable{cursor:pointer;}#mermaid-svg-NUjHuyGzgDJXT6mA .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-NUjHuyGzgDJXT6mA .arrowheadPath{fill:#333333;}#mermaid-svg-NUjHuyGzgDJXT6mA .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-NUjHuyGzgDJXT6mA .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-NUjHuyGzgDJXT6mA .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-NUjHuyGzgDJXT6mA .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-NUjHuyGzgDJXT6mA .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-NUjHuyGzgDJXT6mA .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster text{fill:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA .cluster span{color:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-NUjHuyGzgDJXT6mA .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-NUjHuyGzgDJXT6mA rect.text{fill:none;stroke-width:0;}#mermaid-svg-NUjHuyGzgDJXT6mA .icon-shape,#mermaid-svg-NUjHuyGzgDJXT6mA .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-NUjHuyGzgDJXT6mA .icon-shape p,#mermaid-svg-NUjHuyGzgDJXT6mA .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-NUjHuyGzgDJXT6mA .icon-shape rect,#mermaid-svg-NUjHuyGzgDJXT6mA .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-NUjHuyGzgDJXT6mA .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-NUjHuyGzgDJXT6mA .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-NUjHuyGzgDJXT6mA :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u707e\u96be\u53d1\u751f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u521d\u59cb\u72b6\u6001<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5d29\u6e83<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u81ea\u52a8\u91cd\u542f\u6570\u636e\u4e3a\u7a7a<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u540c\u6b65<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u540c\u6b65<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b A\u65e0\u6301\u4e45\u5316<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece B &#8211; \u7a7a<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4ece C &#8211; \u7a7a<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>X<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e3b A &#8211; \u7a7a<\/p>\n<p><\/span><\/p>\n<h5>\u53ea\u8bfb\u4ece\u8282\u70b9<\/h5>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u4ece\u8282\u70b9\u662f\u53ea\u8bfb\u7684&#xff08;replica-read-only yes&#xff09;\u3002\u8fd9\u662f\u4e3a\u4e86\u9632\u6b62\u8bef\u64cd\u4f5c\u5bfc\u81f4\u4e3b\u4ece\u4e0d\u4e00\u81f4\u3002<\/p>\n<ul>\n<li>\u53ef\u5199\u4ece\u8282\u70b9&#xff1a;\u867d\u7136 Redis \u5141\u8bb8\u914d\u7f6e\u4ece\u8282\u70b9\u53ef\u5199&#xff0c;\u4f46\u8fd9\u662f\u4e0d\u63a8\u8350\u7684\u3002\n<ul>\n<li>\u5199\u5165\u7684\u6570\u636e\u662f\u4e34\u65f6\u7684&#xff0c;\u540c\u6b65\u540e\u4f1a\u88ab\u8986\u76d6\u3002<\/li>\n<li>\u5199\u5165\u4e0d\u4f1a\u88ab\u4f20\u64ad\u7ed9\u4e0b\u7ea7\u7684\u4ece\u8282\u70b9&#xff08;\u7ea7\u8054\u590d\u5236\u573a\u666f&#xff09;\u3002<\/li>\n<li>\u4e00\u65e6\u4ece\u8282\u70b9\u63d0\u5347\u4e3a\u4e3b\u8282\u70b9&#xff0c;\u8fd9\u4e9b\u4e34\u65f6\u6570\u636e\u53ef\u80fd\u4f1a\u5f15\u53d1\u6df7\u4e71\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5efa\u8bae&#xff1a;\u5982\u679c\u9700\u8981\u5728\u4ece\u8282\u70b9\u4e0a\u8ba1\u7b97\u6570\u636e&#xff0c;\u4f7f\u7528 SORT_RO\u3001EVAL_RO \u7b49\u53ea\u8bfb\u547d\u4ee4&#xff0c;\u800c\u4e0d\u662f\u5199\u5165\u4e34\u65f6\u952e\u3002<\/li>\n<\/ul>\n<h5>\u6700\u5c0f\u5199\u5165\u526f\u672c\u6570<\/h5>\n<p>\u4e3a\u4e86\u589e\u5f3a\u6570\u636e\u5b89\u5168\u6027&#xff0c;\u60a8\u53ef\u4ee5\u914d\u7f6e\u4e3b\u8282\u70b9&#xff1a;\u53ea\u6709\u5f53\u81f3\u5c11 N \u4e2a\u4ece\u8282\u70b9\u8fde\u63a5\u6210\u529f\u4e14\u5ef6\u8fdf\u5c0f\u4e8e M \u79d2\u65f6&#xff0c;\u624d\u63a5\u53d7\u5199\u64cd\u4f5c\u3002<\/p>\n<p>\u76f8\u5173\u914d\u7f6e\u53c2\u6570&#xff1a;<\/p>\n<ul>\n<li>min-replicas-to-write &lt;\u6570\u91cf&gt;<\/li>\n<li>min-replicas-max-lag &lt;\u79d2\u6570&gt;<\/li>\n<\/ul>\n<p>\u8fd9\u662f\u4e00\u79cd\u201c\u5c3d\u529b\u800c\u4e3a\u201d\u7684\u6570\u636e\u5b89\u5168\u673a\u5236&#xff0c;\u867d\u7136\u4e0d\u80fd\u4fdd\u8bc1\u5f3a\u4e00\u81f4\u6027&#xff08;\u56e0\u4e3a\u590d\u5236\u662f\u5f02\u6b65\u7684&#xff09;&#xff0c;\u4f46\u80fd\u5c06\u6570\u636e\u4e22\u5931\u7684\u65f6\u95f4\u7a97\u53e3\u9650\u5236\u5728\u51e0\u79d2\u949f\u5185\u3002<\/p>\n<h5>\u952e\u7684\u8fc7\u671f\u5904\u7406<\/h5>\n<p>Redis \u590d\u5236\u4e2d&#xff0c;\u952e\u7684\u8fc7\u671f\u662f\u7531\u4e3b\u8282\u70b9\u9a71\u52a8\u7684&#xff1a;<\/p>\n<li>\u4e3b\u8282\u70b9\u952e\u8fc7\u671f -&gt; \u751f\u6210 DEL \u547d\u4ee4 -&gt; \u53d1\u9001\u7ed9\u4ece\u8282\u70b9\u3002<\/li>\n<li>\u4ece\u8282\u70b9\u88ab\u52a8\u6267\u884c DEL&#xff0c;\u4e0d\u72ec\u7acb\u8ba1\u7b97\u8fc7\u671f\u65f6\u95f4\u3002<\/li>\n<li>Lua \u811a\u672c&#xff1a;\u5728\u811a\u672c\u6267\u884c\u671f\u95f4&#xff0c;\u4e3b\u8282\u70b9\u7684\u903b\u8f91\u65f6\u949f\u662f\u201c\u51bb\u7ed3\u201d\u7684&#xff0c;\u4ee5\u4fdd\u8bc1\u4e3b\u4ece\u6267\u884c\u811a\u672c\u7684\u7ed3\u679c\u4e00\u81f4\u3002<\/li>\n<h4>\u5e38\u7528\u547d\u4ee4<\/h4>\n<table>\n<tr>\u547d\u4ee4\/\u914d\u7f6e\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">INFO replication<\/td>\n<td align=\"left\">\u67e5\u770b\u590d\u5236\u72b6\u6001\u3001\u8fde\u63a5\u7684\u4ece\u8282\u70b9\u3001\u504f\u79fb\u91cf\u7b49\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">ROLE<\/td>\n<td align=\"left\">\u67e5\u770b\u5b9e\u4f8b\u89d2\u8272&#xff08;master\/replica&#xff09;\u53ca\u5176\u8be6\u7ec6\u590d\u5236\u4fe1\u606f\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">replicaof &lt;ip&gt; &lt;port&gt;<\/td>\n<td align=\"left\">\u5c06\u5f53\u524d\u5b9e\u4f8b\u914d\u7f6e\u4e3a\u6307\u5b9a\u5730\u5740\u7684\u4ece\u8282\u70b9\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">WAIT &lt;replicas&gt; &lt;timeout&gt;<\/td>\n<td align=\"left\">\u963b\u585e\u5f53\u524d\u5ba2\u6237\u7aef&#xff0c;\u76f4\u5230\u5199\u64cd\u4f5c\u88ab\u6307\u5b9a\u6570\u91cf\u7684\u4ece\u8282\u70b9\u786e\u8ba4&#xff08;\u4f2a\u540c\u6b65&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">masterauth &lt;password&gt;<\/td>\n<td align=\"left\">\u8bbe\u7f6e\u4ece\u8282\u70b9\u8fde\u63a5\u4e3b\u8282\u70b9\u6240\u9700\u7684\u5bc6\u7801\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Redis Sentinel&#xff1a;\u975e\u96c6\u7fa4\u6a21\u5f0f\u4e0b\u7684\u9ad8\u53ef\u7528\u5b88\u62a4\u8005<\/h3>\n<p>\u5728\u4e0a\u4e00\u8282\u4e2d&#xff0c;\u6211\u4eec\u4e86\u89e3\u4e86 Redis \u5982\u4f55\u901a\u8fc7\u4e3b\u4ece\u590d\u5236 \u6765\u5b9e\u73b0\u6570\u636e\u5907\u4efd\u548c\u8bfb\u5199\u5206\u79bb\u3002\u4f46\u662f&#xff0c;\u5355\u7eaf\u7684\u4e3b\u4ece\u590d\u5236\u6709\u4e00\u4e2a\u81f4\u547d\u7684\u5f31\u70b9&#xff1a;\u4e3b\u8282\u70b9\u6545\u969c\u65e0\u6cd5\u81ea\u52a8\u6062\u590d\u3002\u5982\u679c\u4e3b\u8282\u70b9\u5b95\u673a&#xff0c;\u4ece\u8282\u70b9\u867d\u7136\u62e5\u6709\u6570\u636e&#xff0c;\u4f46\u4e0d\u4f1a\u81ea\u52a8\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9&#xff0c;\u9664\u975e\u6709\u4eba\u5de5\u4ecb\u5165\u3002 \u8fd9\u5c31\u662f Redis Sentinel \u767b\u573a\u7684\u65f6\u523b\u3002Sentinel \u662f Redis \u7684\u9ad8\u53ef\u7528\u89e3\u51b3\u65b9\u6848&#xff0c;\u5b83\u8fd0\u884c\u5728\u7279\u6b8a\u7684\u6a21\u5f0f\u4e0b&#xff0c;\u8d1f\u8d23\u76d1\u63a7\u3001\u901a\u77e5\u548c\u81ea\u52a8\u6545\u969c\u8f6c\u79fb\u3002<\/p>\n<h4>Sentinel \u7684\u6838\u5fc3\u804c\u8d23<\/h4>\n<p>Sentinel \u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u76d1\u63a7\u5de5\u5177&#xff0c;\u5b83\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5206\u5e03\u5f0f\u7cfb\u7edf&#xff0c;\u4e3b\u8981\u627f\u62c5\u4ee5\u4e0b\u56db\u4e2a\u804c\u8d23&#xff1a;<\/p>\n<li>\u76d1\u63a7&#xff1a;\u6301\u7eed\u68c0\u67e5\u4e3b\u8282\u70b9\u548c\u4ece\u8282\u70b9\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<li>\u901a\u77e5&#xff1a;\u5f53\u88ab\u76d1\u63a7\u7684\u5b9e\u4f8b\u51fa\u73b0\u95ee\u9898\u65f6&#xff0c;\u901a\u8fc7 API \u901a\u77e5\u7cfb\u7edf\u7ba1\u7406\u5458\u6216\u5176\u4ed6\u7a0b\u5e8f\u3002<\/li>\n<li>\u81ea\u52a8\u6545\u969c\u8f6c\u79fb&#xff1a;\u8fd9\u662f\u6838\u5fc3\u529f\u80fd\u3002\u5f53\u4e3b\u8282\u70b9\u5931\u6548\u65f6&#xff0c;Sentinel \u4f1a\u53d1\u8d77\u6545\u969c\u8f6c\u79fb\u6d41\u7a0b&#xff1a;\u5c06\u4e00\u4e2a\u4ece\u8282\u70b9\u5347\u7ea7\u4e3a\u65b0\u7684\u4e3b\u8282\u70b9&#xff0c;\u91cd\u65b0\u914d\u7f6e\u5176\u4ed6\u4ece\u8282\u70b9&#xff0c;\u5e76\u901a\u77e5\u5ba2\u6237\u7aef\u65b0\u7684\u5730\u5740\u3002<\/li>\n<li>\u914d\u7f6e\u63d0\u4f9b\u8005&#xff1a;Sentinel \u5145\u5f53\u5ba2\u6237\u7aef\u7684\u6743\u5a01\u670d\u52a1\u53d1\u73b0\u6e90\u3002\u5ba2\u6237\u7aef\u8fde\u63a5 Sentinel \u8be2\u95ee&#xff1a;\u201c\u8c01\u662f\u5f53\u524d\u7684\u4e3b\u8282\u70b9&#xff1f;\u201d&#xff0c;Sentinel \u4f1a\u8fd4\u56de\u6700\u65b0\u7684\u5730\u5740\u3002\u5982\u679c\u53d1\u751f\u6545\u969c\u8f6c\u79fb&#xff0c;Sentinel \u4f1a\u81ea\u52a8\u66f4\u65b0\u8fd9\u4e2a\u5730\u5740\u3002<\/li>\n<h4>Sentinel \u7684\u5206\u5e03\u5f0f\u67b6\u6784<\/h4>\n<p>Sentinel \u672c\u8eab\u88ab\u8bbe\u8ba1\u4e3a\u4e00\u4e2a\u5206\u5e03\u5f0f\u7cfb\u7edf\u3002\u8fd9\u610f\u5473\u7740\u60a8\u4e0d\u80fd\u53ea\u8fd0\u884c\u4e00\u4e2a Sentinel \u8fdb\u7a0b&#xff0c;\u5426\u5219 Sentinel \u672c\u8eab\u5c31\u6210\u4e86\u5355\u70b9\u6545\u969c\u3002 \u4e3a\u4e86\u5b9e\u73b0\u9ad8\u53ef\u7528&#xff0c;\u60a8\u9700\u8981\u8fd0\u884c\u591a\u4e2a Sentinel \u8fdb\u7a0b\u534f\u540c\u5de5\u4f5c\u3002\u5b83\u4eec\u4e4b\u95f4\u901a\u8fc7Gossip\u534f\u8bae\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n<h5>\u6545\u969c\u68c0\u6d4b\u4e0e\u8f6c\u79fb\u6d41\u7a0b<\/h5>\n<p>\u7406\u89e3 Sentinel \u7684\u5173\u952e\u662f\u533a\u5206\u4e3b\u89c2\u4e0b\u7ebf \u548c \u5ba2\u89c2\u4e0b\u7ebf&#xff0c;\u4ee5\u53ca\u6cd5\u5b9a\u4eba\u6570 \u4e0e \u591a\u6570\u6d3e \u7684\u6982\u5ff5\u3002 \u4e0b\u56fe\u5c55\u793a\u4e86\u4ece\u4e3b\u8282\u70b9\u6545\u969c\u5230\u5b8c\u6210\u6545\u969c\u8f6c\u79fb\u7684\u5b8c\u6574\u8fc7\u7a0b&#xff1a;<\/p>\n<p>     \u5ba2\u6237\u7aef<\/p>\n<p>     \u4ece\u8282\u70b9 R<\/p>\n<p>     Sentinel 3<\/p>\n<p>     Sentinel 2<\/p>\n<p>     Sentinel 1<\/p>\n<p>     \u4e3b\u8282\u70b9 M<\/p>\n<p>      \u5ba2\u6237\u7aef<\/p>\n<p>      \u4ece\u8282\u70b9 R<\/p>\n<p>      Sentinel 3<\/p>\n<p>      Sentinel 2<\/p>\n<p>      Sentinel 1<\/p>\n<p>      \u4e3b\u8282\u70b9 M<\/p>\n<p>  #mermaid-svg-KWUm6Hho07hVws0V{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-KWUm6Hho07hVws0V .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-KWUm6Hho07hVws0V .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-KWUm6Hho07hVws0V .error-icon{fill:#552222;}#mermaid-svg-KWUm6Hho07hVws0V .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-KWUm6Hho07hVws0V .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-KWUm6Hho07hVws0V .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-KWUm6Hho07hVws0V .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-KWUm6Hho07hVws0V .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-KWUm6Hho07hVws0V .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-KWUm6Hho07hVws0V .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-KWUm6Hho07hVws0V .marker{fill:#333333;stroke:#333333;}#mermaid-svg-KWUm6Hho07hVws0V .marker.cross{stroke:#333333;}#mermaid-svg-KWUm6Hho07hVws0V svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-KWUm6Hho07hVws0V p{margin:0;}#mermaid-svg-KWUm6Hho07hVws0V .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KWUm6Hho07hVws0V text.actor&gt;tspan{fill:black;stroke:none;}#mermaid-svg-KWUm6Hho07hVws0V .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-KWUm6Hho07hVws0V .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-KWUm6Hho07hVws0V .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-KWUm6Hho07hVws0V .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-KWUm6Hho07hVws0V #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-KWUm6Hho07hVws0V .sequenceNumber{fill:white;}#mermaid-svg-KWUm6Hho07hVws0V #sequencenumber{fill:#333;}#mermaid-svg-KWUm6Hho07hVws0V #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-KWUm6Hho07hVws0V .messageText{fill:#333;stroke:none;}#mermaid-svg-KWUm6Hho07hVws0V .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KWUm6Hho07hVws0V .labelText,#mermaid-svg-KWUm6Hho07hVws0V .labelText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-KWUm6Hho07hVws0V .loopText,#mermaid-svg-KWUm6Hho07hVws0V .loopText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-KWUm6Hho07hVws0V .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-KWUm6Hho07hVws0V .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-KWUm6Hho07hVws0V .noteText,#mermaid-svg-KWUm6Hho07hVws0V .noteText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-KWUm6Hho07hVws0V .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KWUm6Hho07hVws0V .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KWUm6Hho07hVws0V .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KWUm6Hho07hVws0V .actorPopupMenu{position:absolute;}#mermaid-svg-KWUm6Hho07hVws0V .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 \/ 0.4));}#mermaid-svg-KWUm6Hho07hVws0V .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KWUm6Hho07hVws0V .actor-man circle,#mermaid-svg-KWUm6Hho07hVws0V line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-KWUm6Hho07hVws0V :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>     \u4e3b\u8282\u70b9\u5b95\u673a<\/p>\n<p>     \u9009\u4e3e\u9636\u6bb5<\/p>\n<p>   \u8fde\u63a5\u65ad\u5f00<\/p>\n<p>   1<\/p>\n<p>   \u8fde\u63a5\u65ad\u5f00<\/p>\n<p>   2<\/p>\n<p>   \u8d85\u65f6\u672a\u54cd\u5e94 (SDOWN)<\/p>\n<p>   3<\/p>\n<p>   \u8d85\u65f6\u672a\u54cd\u5e94 (SDOWN)<\/p>\n<p>   4<\/p>\n<p>   \u786e\u8ba4\u4e3b\u8282\u70b9\u72b6\u6001?<\/p>\n<p>   5<\/p>\n<p>   \u786e\u8ba4\u4e0b\u7ebf (ODOWN<\/p>\n<p>   \u8fbe\u5230\u6cd5\u5b9a\u4eba\u6570)<\/p>\n<p>   6<\/p>\n<p>   \u6295\u7968\u8bf7\u6c42 (\u6211\u8d1f\u8d23\u6545\u969c\u8f6c\u79fb)<\/p>\n<p>   7<\/p>\n<p>   \u6295\u7968\u540c\u610f<\/p>\n<p>   8<\/p>\n<p>   \u6295\u7968\u8bf7\u6c42<\/p>\n<p>   9<\/p>\n<p>   \u6295\u7968\u540c\u610f<\/p>\n<p>   10<\/p>\n<p>   SLAVEOF NO ONE<\/p>\n<p>   (\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9)<\/p>\n<p>   11<\/p>\n<p>   \u65ad\u5f00\u65e7\u4e3b\u8fde\u63a5<\/p>\n<p>   12<\/p>\n<p>   \u786e\u8ba4\u5df2\u5347\u7ea7<\/p>\n<p>   13<\/p>\n<p>   \u5e7f\u64ad\u65b0\u914d\u7f6e (Epoch &#043;1)<\/p>\n<p>   14<\/p>\n<p>   \u5e7f\u64ad\u65b0\u914d\u7f6e (Epoch &#043;1)<\/p>\n<p>   15<\/p>\n<p>   \u8be2\u95ee\u4e3b\u8282\u70b9\u5730\u5740?<\/p>\n<p>   16<\/p>\n<p>   \u8fd4\u56de\u65b0\u4e3b\u8282\u70b9\u5730\u5740<\/p>\n<p>   17<\/p>\n<h5>\u4e3b\u89c2\u4e0b\u7ebf vs \u5ba2\u89c2\u4e0b\u7ebf<\/h5>\n<ul>\n<li>SDOWN (Subjective Down)&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u5c40\u90e8\u72b6\u6001\u3002\u5355\u4e2a Sentinel \u53d1\u73b0\u67d0\u4e2a\u5b9e\u4f8b\u5728 down-after-milliseconds \u6beb\u79d2\u5185\u6ca1\u6709\u56de\u590d PING&#xff0c;\u5c31\u8ba4\u4e3a\u5b83\u4e3b\u89c2\u4e0b\u7ebf\u4e86\u3002<\/li>\n<li>ODOWN (Objective Down)&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u5168\u5c40\u72b6\u6001\u3002\u5f53\u8db3\u591f\u6570\u91cf\u7684 Sentinel&#xff08;\u8fbe\u5230\u914d\u7f6e\u7684 quorum&#xff09;\u90fd\u8ba4\u4e3a\u4e3b\u8282\u70b9\u662f SDOWN \u65f6&#xff0c;\u4e3b\u8282\u70b9\u88ab\u6807\u8bb0\u4e3a ODOWN\u3002<\/li>\n<li>\u6ce8\u610f&#xff1a;\u53ea\u6709\u4e3b\u8282\u70b9\u4f1a\u88ab\u6807\u8bb0\u4e3a ODOWN\u3002\u4ece\u8282\u70b9\u6216 Sentinel \u6545\u969c\u901a\u5e38\u4e0d\u9700\u8981\u89e6\u53d1\u590d\u6742\u7684\u6545\u969c\u8f6c\u79fb\u903b\u8f91\u3002<\/li>\n<\/ul>\n<h5>\u6cd5\u5b9a\u4eba\u6570 vs \u591a\u6570\u6d3e<\/h5>\n<p>\u8fd9\u4e24\u4e2a\u53c2\u6570\u51b3\u5b9a\u4e86\u7cfb\u7edf\u7684\u654f\u611f\u5ea6\u548c\u5b89\u5168\u6027&#xff0c;\u4e5f\u662f\u5bb9\u6613\u6df7\u6dc6\u7684\u5730\u65b9&#xff1a;<\/p>\n<ul>\n<li>Quorum (\u6cd5\u5b9a\u4eba\u6570)&#xff1a;\u5728 sentinel monitor &lt;master-name&gt; &lt;ip&gt; &lt;port&gt; &lt;quorum&gt; \u4e2d\u914d\u7f6e\u3002\n<ul>\n<li>\u4f5c\u7528&#xff1a;\u6807\u8bb0\u4e3b\u8282\u70b9\u4e3a ODOWN\u3002<\/li>\n<li>\u4f8b\u5b50&#xff1a;\u5982\u679c\u6709 5 \u4e2a Sentinel&#xff0c;Quorum \u8bbe\u4e3a 2\u3002\u53ea\u8981\u6709 2 \u4e2a Sentinel \u8ba4\u4e3a\u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u4e3b\u8282\u70b9\u5c31\u4f1a\u88ab\u6807\u8bb0\u4e3a ODOWN\u3002<\/li>\n<\/ul>\n<\/li>\n<li>Majority (\u591a\u6570\u6d3e)&#xff1a;Sentinel \u603b\u6570\u7684\u4e00\u534a &#043; 1\u3002\n<ul>\n<li>\u4f5c\u7528&#xff1a;\u6388\u6743\u6267\u884c\u6545\u969c\u8f6c\u79fb\u3002<\/li>\n<li>\u89c4\u5219&#xff1a;\u5373\u4f7f\u4e3b\u8282\u70b9\u5df2\u7ecf\u88ab\u6807\u8bb0\u4e3a ODOWN&#xff0c;Sentinel \u4f9d\u7136\u5fc5\u987b\u83b7\u5f97\u591a\u6570\u6d3e \u7684\u6388\u6743\u624d\u80fd\u771f\u6b63\u5f00\u59cb\u6267\u884c slaveof no one \u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5b89\u5168\u673a\u5236&#xff1a;\u8fd9\u9632\u6b62\u4e86\u201c\u8111\u88c2\u201d\u3002\u5373\u4f7f\u7f51\u7edc\u5206\u533a\u5bfc\u81f4\u5c11\u6570\u6d3e Sentinel \u8ba4\u4e3a\u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u5b83\u4eec\u65e0\u6cd5\u83b7\u5f97\u591a\u6570\u6d3e\u6388\u6743&#xff0c;\u56e0\u6b64\u4e0d\u4f1a\u542f\u52a8\u6545\u969c\u8f6c\u79fb\u3002<\/p>\n<h5>\u914d\u7f6e\u7eaa\u5143<\/h5>\n<p>\u8fd9\u662f Sentinel \u7684\u7248\u672c\u53f7\u673a\u5236\u3002\u6bcf\u6b21\u6210\u529f\u8fdb\u884c\u6545\u969c\u8f6c\u79fb&#xff0c;\u914d\u7f6e\u7eaa\u5143 \u5c31\u4f1a &#043;1\u3002<\/p>\n<ul>\n<li>\u5f53 Sentinel \u5e7f\u64ad\u65b0\u7684\u914d\u7f6e&#xff08;\u4e3b\u8282\u70b9\u53d8\u66f4&#xff09;\u65f6&#xff0c;\u4f1a\u9644\u5e26\u8fd9\u4e2a\u7eaa\u5143\u53f7\u3002<\/li>\n<li>\u7eaa\u5143\u53f7\u5927\u7684\u914d\u7f6e\u88ab\u89c6\u4e3a\u201c\u66f4\u65b0\u201d&#xff0c;\u4f1a\u8986\u76d6\u65e7\u7684\u914d\u7f6e\u3002<\/li>\n<li>\u8fd9\u4fdd\u8bc1\u4e86\u6240\u6709 Sentinel \u6700\u7ec8\u4f1a\u6536\u655b\u5230\u540c\u4e00\u4e2a\u914d\u7f6e&#xff08;\u6700\u7ec8\u4e00\u81f4\u6027&#xff09;\u3002<\/li>\n<\/ul>\n<h4>\u90e8\u7f72\u6700\u4f73\u5b9e\u8df5<\/h4>\n<p>\u4e3a\u4e86\u6784\u5efa\u4e00\u4e2a\u5065\u58ee\u7684 Sentinel \u90e8\u7f72&#xff0c;\u8bf7\u9075\u5faa\u4ee5\u4e0b\u539f\u5219&#xff1a;<\/p>\n<h5>\u5e03\u5c40\u62d3\u6251<\/h5>\n<p>\u63a8\u8350\u7684\u62d3\u6251&#xff08;\u4e09\u8282\u70b9\u90e8\u7f72&#xff09;&#xff1a; \u5c06 Sentinel \u548c Redis \u8fdb\u7a0b\u5206\u5e03\u5728\u4e09\u4e2a\u72ec\u7acb\u7684\u7269\u7406\u673a\u6216\u865a\u62df\u673a\u4e0a\u3002<\/p>\n<p>  #mermaid-svg-HCdwRTxY5vJa8iN5{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-HCdwRTxY5vJa8iN5 .error-icon{fill:#552222;}#mermaid-svg-HCdwRTxY5vJa8iN5 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-HCdwRTxY5vJa8iN5 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .marker.cross{stroke:#333333;}#mermaid-svg-HCdwRTxY5vJa8iN5 svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-HCdwRTxY5vJa8iN5 p{margin:0;}#mermaid-svg-HCdwRTxY5vJa8iN5 .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster-label text{fill:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster-label span{color:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster-label span p{background-color:transparent;}#mermaid-svg-HCdwRTxY5vJa8iN5 .label text,#mermaid-svg-HCdwRTxY5vJa8iN5 span{fill:#333;color:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .node rect,#mermaid-svg-HCdwRTxY5vJa8iN5 .node circle,#mermaid-svg-HCdwRTxY5vJa8iN5 .node ellipse,#mermaid-svg-HCdwRTxY5vJa8iN5 .node polygon,#mermaid-svg-HCdwRTxY5vJa8iN5 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .rough-node .label text,#mermaid-svg-HCdwRTxY5vJa8iN5 .node .label text,#mermaid-svg-HCdwRTxY5vJa8iN5 .image-shape .label,#mermaid-svg-HCdwRTxY5vJa8iN5 .icon-shape .label{text-anchor:middle;}#mermaid-svg-HCdwRTxY5vJa8iN5 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .rough-node .label,#mermaid-svg-HCdwRTxY5vJa8iN5 .node .label,#mermaid-svg-HCdwRTxY5vJa8iN5 .image-shape .label,#mermaid-svg-HCdwRTxY5vJa8iN5 .icon-shape .label{text-align:center;}#mermaid-svg-HCdwRTxY5vJa8iN5 .node.clickable{cursor:pointer;}#mermaid-svg-HCdwRTxY5vJa8iN5 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .arrowheadPath{fill:#333333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HCdwRTxY5vJa8iN5 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-HCdwRTxY5vJa8iN5 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HCdwRTxY5vJa8iN5 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster text{fill:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 .cluster span{color:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-HCdwRTxY5vJa8iN5 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-HCdwRTxY5vJa8iN5 rect.text{fill:none;stroke-width:0;}#mermaid-svg-HCdwRTxY5vJa8iN5 .icon-shape,#mermaid-svg-HCdwRTxY5vJa8iN5 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HCdwRTxY5vJa8iN5 .icon-shape p,#mermaid-svg-HCdwRTxY5vJa8iN5 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-HCdwRTxY5vJa8iN5 .icon-shape rect,#mermaid-svg-HCdwRTxY5vJa8iN5 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HCdwRTxY5vJa8iN5 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-HCdwRTxY5vJa8iN5 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-HCdwRTxY5vJa8iN5 :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7269\u7406\u673a 3<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7269\u7406\u673a 2<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7269\u7406\u673a 1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u76d1\u63a7<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Redis Master<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Sentinel 1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Redis Replica 1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Sentinel 2<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Redis Replica 2<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Sentinel 3<\/p>\n<p><\/span><\/p>\n<p>\u5173\u952e\u914d\u7f6e&#xff1a;<\/p>\n<ul>\n<li>Quorum \u8bbe\u7f6e\u4e3a 2&#xff1a;\u8fd9\u610f\u5473\u7740\u9700\u8981\u81f3\u5c11 2 \u4e2a Sentinel \u540c\u610f\u4e3b\u8282\u70b9\u6302\u4e86&#xff0c;\u624d\u80fd\u89e6\u53d1 ODOWN\u3002<\/li>\n<li>\u4f18\u52bf&#xff1a;\n<ul>\n<li>\u5982\u679c\u7269\u7406\u673a 1 \u5b95\u673a&#xff08;M1 \u548c S1 \u6302\u4e86&#xff09;&#xff0c;\u5269\u4e0b\u7684 S2 \u548c S3 \u4f9d\u7136\u6784\u6210\u591a\u6570\u6d3e&#xff08;2\/3&#xff09;&#xff0c;\u53ef\u4ee5\u6388\u6743 S2 \u6216 S3 \u8fdb\u884c\u6545\u969c\u8f6c\u79fb\u3002<\/li>\n<li>\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u5269\u4e0b\u7684 S2\/S3 \u4f9d\u7136\u53ef\u4ee5\u83b7\u53d6\u65b0\u4e3b\u8282\u70b9\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>\u907f\u514d\u201c\u8111\u88c2\u201d\u4e0e\u6570\u636e\u4e22\u5931<\/h5>\n<p>\u7531\u4e8e Redis \u590d\u5236\u662f\u5f02\u6b65\u7684&#xff0c;\u5728\u7f51\u7edc\u5206\u533a\u53d1\u751f\u65f6&#xff0c;\u65e7\u7684\u4e3b\u8282\u70b9\u53ef\u80fd\u4ecd\u7136\u63a5\u53d7\u5199\u5165&#xff0c;\u800c\u65b0\u7684\u4e3b\u8282\u70b9\u5df2\u7ecf\u4ea7\u751f\u3002\u5f53\u5206\u533a\u6062\u590d\u65f6&#xff0c;\u65e7\u4e3b\u8282\u70b9\u4f1a\u88ab\u91cd\u65b0\u914d\u7f6e\u4e3a\u4ece\u8282\u70b9&#xff0c;\u5bfc\u81f4\u5176\u4e0a\u7684\u5199\u5165\u6570\u636e\u4e22\u5931\u3002<\/p>\n<p>\u7f13\u89e3\u63aa\u65bd&#xff1a; \u5728 Redis \u914d\u7f6e\u4e2d\u542f\u7528 min-replicas-to-write&#xff1a;<\/p>\n<p>min-replicas-to-write 1<br \/>\nmin-replicas-max-lag 10<\/p>\n<p>\u8fd9\u610f\u5473\u7740&#xff1a;\u4e3b\u8282\u70b9\u5fc5\u987b\u81f3\u5c11\u80fd\u5199\u5165 1 \u4e2a\u4ece\u8282\u70b9&#xff0c;\u5426\u5219\u62d2\u7edd\u5199\u8bf7\u6c42\u3002\u5728\u7f51\u7edc\u5206\u533a\u53d1\u751f\u65f6&#xff0c;\u65e7\u4e3b\u8282\u70b9\u4f1a\u8fc5\u901f\u5931\u53bb\u8fde\u63a5&#xff0c;\u4ece\u800c\u505c\u6b62\u63a5\u53d7\u5199\u5165&#xff0c;\u5927\u5927\u51cf\u5c11\u6570\u636e\u4e22\u5931\u7a97\u53e3\u3002<\/p>\n<h4>\u57fa\u672c\u914d\u7f6e<\/h4>\n<p>\u4e00\u4e2a\u6700\u5c0f\u7684 sentinel.conf \u793a\u4f8b&#xff1a;<\/p>\n<p># \u76d1\u63a7\u540d\u4e3a mymaster \u7684\u4e3b\u8282\u70b9&#xff0c;IP 127.0.0.1&#xff0c;\u7aef\u53e3 6379&#xff0c;\u6cd5\u5b9a\u4eba\u6570\u4e3a 2<br \/>\nsentinel monitor mymaster 127.0.0.1 6379 2<\/p>\n<p># 30\u79d2\u5185\u65e0\u54cd\u5e94\u89c6\u4e3a\u4e3b\u89c2\u4e0b\u7ebf<br \/>\nsentinel down-after-milliseconds mymaster 30000<\/p>\n<p># \u6545\u969c\u8f6c\u79fb\u8d85\u65f6\u65f6\u95f4&#xff08;3\u5206\u949f&#xff09;<br \/>\nsentinel failover-timeout mymaster 180000<\/p>\n<p># \u6545\u969c\u8f6c\u79fb\u65f6&#xff0c;\u540c\u65f6\u6709\u591a\u5c11\u4e2a\u4ece\u8282\u70b9\u540c\u6b65\u65b0\u4e3b\u8282\u70b9&#xff08;\u6570\u5b57\u8d8a\u5c0f\u5bf9\u7f51\u7edc\u5f71\u54cd\u8d8a\u5c0f&#xff09;<br \/>\nsentinel parallel-syncs mymaster 1<\/p>\n<h3>Redis \u96c6\u7fa4&#xff1a;\u5b9e\u73b0\u6570\u636e\u7684\u6c34\u5e73\u6269\u5c55\u4e0e\u9ad8\u53ef\u7528<\/h3>\n<p>\u5728\u4e4b\u524d\u7684\u7ae0\u8282\u4e2d&#xff0c;\u6211\u4eec\u63a2\u8ba8\u4e86\u201c\u4e3b\u4ece\u590d\u5236\u201d&#xff08;\u6570\u636e\u5197\u4f59&#xff09;\u548c\u201c\u54e8\u5175\u201d&#xff08;\u9ad8\u53ef\u7528\u76d1\u63a7&#xff09;\u3002\u867d\u7136\u8fd9\u4e24\u4e2a\u529f\u80fd\u7ec4\u5408\u5728\u4e00\u8d77\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u975e\u5e38\u5065\u58ee\u7684\u5355\u8282\u70b9 Redis \u670d\u52a1&#xff0c;\u4f46\u5b83\u4eec\u53d7\u9650\u4e8e\u5355\u673a\u7684\u5185\u5b58\u5927\u5c0f\u548c CPU \u6027\u80fd\u3002\u5f53\u6570\u636e\u91cf\u8fbe\u5230\u51e0\u5341 TB \u6216\u8005\u5355\u673a\u541e\u5410\u91cf\u6210\u4e3a\u74f6\u9888\u65f6&#xff0c;\u6211\u4eec\u9700\u8981 Redis Cluster\u3002 Redis Cluster \u662f Redis \u7684\u5206\u5e03\u5f0f\u89e3\u51b3\u65b9\u6848&#xff0c;\u5b83\u63d0\u4f9b\u4e86\u81ea\u52a8\u5206\u7247 \u548c \u9ad8\u53ef\u7528 \u7684\u80fd\u529b\u3002\u5b83\u5c06\u6570\u636e\u81ea\u52a8\u5206\u5272\u5230\u591a\u4e2a\u8282\u70b9\u4e0a&#xff0c;\u4ece\u800c\u5b9e\u73b0\u6c34\u5e73\u6269\u5c55&#xff0c;\u540c\u65f6\u5185\u7f6e\u4e86\u6545\u969c\u6062\u590d\u673a\u5236\u3002<\/p>\n<h4>\u6838\u5fc3\u6982\u5ff5&#xff1a;\u6570\u636e\u5206\u7247\u4e0e\u54c8\u5e0c\u69fd<\/h4>\n<p>Redis Cluster \u4e0d\u4f7f\u7528\u4f20\u7edf\u7684\u4e00\u81f4\u6027\u54c8\u5e0c&#xff0c;\u800c\u662f\u4f7f\u7528\u4e00\u79cd\u79f0\u4e3a \u54c8\u5e0c\u69fd \u7684\u6982\u5ff5\u3002<\/p>\n<ul>\n<li>\u603b\u69fd\u4f4d\u6570&#xff1a;\u96c6\u7fa4\u5171\u6709 16384 \u4e2a\u54c8\u5e0c\u69fd\u3002<\/li>\n<li>\u8ba1\u7b97\u65b9\u5f0f&#xff1a;\u6bcf\u4e2a Key \u6839\u636e\u5176\u540d\u79f0\u8ba1\u7b97\u54c8\u5e0c\u503c&#xff1a;CRC16(key) % 16384\u3002<\/li>\n<li>\u5206\u914d&#xff1a;\u8fd9 16384 \u4e2a\u69fd\u4f4d\u88ab\u5206\u914d\u7ed9\u96c6\u7fa4\u4e2d\u7684\u4e0d\u540c\u4e3b\u8282\u70b9\u3002<\/li>\n<\/ul>\n<h5>\u6570\u636e\u6d41\u8f6c\u793a\u610f\u56fe<\/h5>\n<p>\u4e0b\u56fe\u5c55\u793a\u4e86\u4e00\u4e2a Key \u662f\u5982\u4f55\u88ab\u8def\u7531\u5230\u7279\u5b9a\u8282\u70b9\u7684&#xff0c;\u4ee5\u53ca Key \u5982\u4f55\u5728\u5206\u7247\u4e2d\u5de5\u4f5c&#xff1a;<\/p>\n<p>  #mermaid-svg-oAzYDfWF94nHTWHU{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-oAzYDfWF94nHTWHU .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-oAzYDfWF94nHTWHU .error-icon{fill:#552222;}#mermaid-svg-oAzYDfWF94nHTWHU .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-oAzYDfWF94nHTWHU .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-oAzYDfWF94nHTWHU .marker{fill:#333333;stroke:#333333;}#mermaid-svg-oAzYDfWF94nHTWHU .marker.cross{stroke:#333333;}#mermaid-svg-oAzYDfWF94nHTWHU svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-oAzYDfWF94nHTWHU p{margin:0;}#mermaid-svg-oAzYDfWF94nHTWHU .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-oAzYDfWF94nHTWHU .cluster-label text{fill:#333;}#mermaid-svg-oAzYDfWF94nHTWHU .cluster-label span{color:#333;}#mermaid-svg-oAzYDfWF94nHTWHU .cluster-label span p{background-color:transparent;}#mermaid-svg-oAzYDfWF94nHTWHU .label text,#mermaid-svg-oAzYDfWF94nHTWHU span{fill:#333;color:#333;}#mermaid-svg-oAzYDfWF94nHTWHU .node rect,#mermaid-svg-oAzYDfWF94nHTWHU .node circle,#mermaid-svg-oAzYDfWF94nHTWHU .node ellipse,#mermaid-svg-oAzYDfWF94nHTWHU .node polygon,#mermaid-svg-oAzYDfWF94nHTWHU .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-oAzYDfWF94nHTWHU .rough-node .label text,#mermaid-svg-oAzYDfWF94nHTWHU .node .label text,#mermaid-svg-oAzYDfWF94nHTWHU .image-shape .label,#mermaid-svg-oAzYDfWF94nHTWHU .icon-shape .label{text-anchor:middle;}#mermaid-svg-oAzYDfWF94nHTWHU .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-oAzYDfWF94nHTWHU .rough-node .label,#mermaid-svg-oAzYDfWF94nHTWHU .node .label,#mermaid-svg-oAzYDfWF94nHTWHU .image-shape .label,#mermaid-svg-oAzYDfWF94nHTWHU .icon-shape .label{text-align:center;}#mermaid-svg-oAzYDfWF94nHTWHU .node.clickable{cursor:pointer;}#mermaid-svg-oAzYDfWF94nHTWHU .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-oAzYDfWF94nHTWHU .arrowheadPath{fill:#333333;}#mermaid-svg-oAzYDfWF94nHTWHU .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-oAzYDfWF94nHTWHU .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-oAzYDfWF94nHTWHU .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oAzYDfWF94nHTWHU .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-oAzYDfWF94nHTWHU .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oAzYDfWF94nHTWHU .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-oAzYDfWF94nHTWHU .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-oAzYDfWF94nHTWHU .cluster text{fill:#333;}#mermaid-svg-oAzYDfWF94nHTWHU .cluster span{color:#333;}#mermaid-svg-oAzYDfWF94nHTWHU div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-oAzYDfWF94nHTWHU .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-oAzYDfWF94nHTWHU rect.text{fill:none;stroke-width:0;}#mermaid-svg-oAzYDfWF94nHTWHU .icon-shape,#mermaid-svg-oAzYDfWF94nHTWHU .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oAzYDfWF94nHTWHU .icon-shape p,#mermaid-svg-oAzYDfWF94nHTWHU .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-oAzYDfWF94nHTWHU .icon-shape rect,#mermaid-svg-oAzYDfWF94nHTWHU .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oAzYDfWF94nHTWHU .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-oAzYDfWF94nHTWHU .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-oAzYDfWF94nHTWHU :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Redis Cluster \u67b6\u6784<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u8282\u70b9\u4e0e\u69fd\u4f4d\u6620\u5c04<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u53d6\u6a21 16384<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u69fd\u4f4d 0-5000<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>Master-Sentinel<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>Master-Sentinel<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>Master-Sentinel<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8bf7\u6c42<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u91cd\u5b9a\u5411<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u8fd4\u56de\u6570\u636e<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5ba2\u6237\u7aef<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Key: user:1001<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u8ba1\u7b97 CRC16<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Hash Slot 1234<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Master A<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Slot 5001-10000<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Master B<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Slot 10001-16383<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Master C<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Replica A1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Replica B1<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Replica C1<\/p>\n<p><\/span><\/p>\n<p>\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u8f7b\u677e\u6269\u5bb9&#xff1a;\u6dfb\u52a0\u65b0\u8282\u70b9\u65f6&#xff0c;\u53ea\u9700\u5c06\u4e00\u90e8\u5206\u69fd\u4f4d\u4ece\u65e7\u8282\u70b9\u8fc1\u79fb\u5230\u65b0\u8282\u70b9\u3002<\/li>\n<li>\u5728\u7ebf\u8fc1\u79fb&#xff1a;\u6570\u636e\u8fc1\u79fb\u8fc7\u7a0b\u4e0d\u9700\u8981\u505c\u6b62\u670d\u52a1\u3002<\/li>\n<\/ul>\n<h5>\u591a\u952e\u64cd\u4f5c\u4e0e Hash Tags<\/h5>\n<p>Redis Cluster \u9650\u5236&#xff1a;\u6d89\u53ca\u591a\u4e2a Key \u7684\u64cd\u4f5c&#xff08;\u5982 MGET, SUNION&#xff09;\u5fc5\u987b\u4f5c\u7528\u5728\u540c\u4e00\u4e2a\u69fd\u4f4d\u4e0a\u3002 \u5982\u679c\u9700\u8981\u8de8\u952e\u64cd\u4f5c&#xff0c;\u53ef\u4ee5\u4f7f\u7528 Hash Tags&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c Key \u5305\u542b {&#8230;} \u8fd9\u6837\u7684\u5b50\u5b57\u7b26\u4e32&#xff0c;\u53ea\u6709 {} \u5185\u7684\u5185\u5bb9\u53c2\u4e0e\u54c8\u5e0c\u8ba1\u7b97\u3002<\/li>\n<li>\u4f8b\u5982&#xff1a;user:{123}:profile \u548c user:{123}:orders \u4f1a\u88ab\u5206\u914d\u5230\u540c\u4e00\u4e2a\u69fd\u4f4d&#xff0c;\u56e0\u6b64\u53ef\u4ee5\u4e00\u8d77\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<h4>\u7f51\u7edc\u67b6\u6784&#xff1a;\u53cc\u7aef\u53e3\u8bbe\u8ba1<\/h4>\n<p>\u4e3a\u4e86\u4fdd\u8bc1\u96c6\u7fa4\u5185\u90e8\u901a\u4fe1\u7684\u9ad8\u6548&#xff0c;\u6bcf\u4e2a Redis Cluster \u8282\u70b9\u9700\u8981\u5f00\u653e\u4e24\u4e2a TCP \u7aef\u53e3&#xff1a;<\/p>\n<li>\u5ba2\u6237\u7aef\u7aef\u53e3&#xff1a;\u4f8b\u5982 6379\u3002\u7528\u4e8e\u670d\u52a1\u5ba2\u6237\u7aef\u8bf7\u6c42&#xff0c;\u4ee5\u53ca\u8282\u70b9\u95f4\u7684\u6570\u636e\u8fc1\u79fb\u3002<\/li>\n<li>\u96c6\u7fa4\u603b\u7ebf\u7aef\u53e3&#xff1a;\u9ed8\u8ba4\u4e3a\u5ba2\u6237\u7aef\u7aef\u53e3 &#043; 10000&#xff08;\u4f8b\u5982 16379&#xff09;\u3002\n<ul>\n<li>\u8fd9\u662f\u4e00\u4e2a\u8282\u70b9\u5bf9\u8282\u70b9\u7684\u901a\u4fe1\u901a\u9053&#xff0c;\u4f7f\u7528\u4e8c\u8fdb\u5236\u534f\u8bae&#xff0c;\u5e26\u5bbd\u548c\u5904\u7406\u5f00\u9500\u66f4\u4f4e\u3002<\/li>\n<li>\u7528\u4e8e\u6545\u969c\u68c0\u6d4b\u3001\u914d\u7f6e\u66f4\u65b0\u3001\u6545\u969c\u8f6c\u79fb\u6388\u6743\u7b49\u3002<\/li>\n<li>\u6ce8\u610f&#xff1a;\u5ba2\u6237\u7aef\u4e0d\u5e94\u8fde\u63a5\u6b64\u7aef\u53e3&#xff0c;\u4f46\u9632\u706b\u5899\u5fc5\u987b\u5f00\u653e\u6b64\u7aef\u53e3\u7ed9\u5176\u4ed6\u96c6\u7fa4\u8282\u70b9\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u9ad8\u53ef\u7528\u4e0e\u6545\u969c\u8f6c\u79fb\u673a\u5236<\/h4>\n<h5>\u4e3b\u4ece\u6a21\u578b\u4e0e\u81ea\u52a8\u5207\u6362<\/h5>\n<p>\u4e3a\u4e86\u4fdd\u6301\u9ad8\u53ef\u7528&#xff0c;\u96c6\u7fa4\u4e2d\u7684\u6bcf\u4e2a\u4e3b\u8282\u70b9\u90fd\u53ef\u4ee5\u6709\u591a\u4e2a\u4ece\u8282\u70b9\u3002\u6545\u969c\u8f6c\u79fb\u6d41\u7a0b&#xff08;\u5185\u7f6e\u673a\u5236&#xff09;&#xff1a;<\/p>\n<li>\u4e3b\u8282\u70b9 A \u5b95\u673a\u3002<\/li>\n<li>\u96c6\u7fa4\u5185\u5176\u4ed6\u4e3b\u8282\u70b9\u901a\u8fc7 Cluster Bus \u611f\u77e5 A \u4e0b\u7ebf&#xff08;Gossip\u534f\u8bae&#xff09;\u3002<\/li>\n<li>\u4e3b\u8282\u70b9 A \u7684\u4ece\u8282\u70b9&#xff08;\u5982 A1&#xff09;\u53d1\u8d77\u6295\u7968\u3002<\/li>\n<li>\u591a\u6570\u6d3e\u4e3b\u8282\u70b9\u540c\u610f\u540e&#xff0c;A1 \u88ab\u63d0\u5347\u4e3a\u65b0\u7684\u4e3b\u8282\u70b9\u3002<\/li>\n<li>\u96c6\u7fa4\u66f4\u65b0\u8def\u7531\u8868&#xff1a;A1 \u8d1f\u8d23 A \u539f\u672c\u7684\u69fd\u4f4d\u3002<\/li>\n<h5>\u4e00\u81f4\u6027\u4fdd\u8bc1<\/h5>\n<p>Redis Cluster \u4e0d\u4fdd\u8bc1\u5f3a\u4e00\u81f4\u6027\u3002\u5b83\u662f\u6700\u7ec8\u4e00\u81f4\u7684\u7cfb\u7edf&#xff0c;\u8fd9\u610f\u5473\u7740\u5728\u67d0\u4e9b\u6545\u969c\u573a\u666f\u4e0b&#xff0c;\u5df2\u7ecf\u786e\u8ba4\u7684\u5199\u5165\u53ef\u80fd\u4f1a\u4e22\u5931\u3002\u539f\u56e0&#xff1a;<\/p>\n<li>\u5f02\u6b65\u590d\u5236&#xff1a;\u5ba2\u6237\u7aef\u5411\u4e3b\u8282\u70b9 B \u5199\u5165\u6570\u636e -&gt; B \u8fd4\u56de OK -&gt; B \u5f02\u6b65\u53d1\u9001\u7ed9\u4ece\u8282\u70b9 B1\u3002\u5982\u679c B \u5728\u53d1\u9001\u7ed9 B1 \u4e4b\u524d\u5d29\u6e83&#xff0c;B1 \u63d0\u5347\u4e3a\u4e3b\u8282\u70b9&#xff0c;\u8fd9\u6761\u6570\u636e\u5c31\u4e22\u5931\u4e86\u3002<\/li>\n<li>\u7f51\u7edc\u5206\u533a&#xff08;\u8111\u88c2&#xff09;&#xff1a;\n<ul>\n<li>\u96c6\u7fa4\u88ab\u5206\u5272\u4e3a\u4e24\u90e8\u5206\u3002<\/li>\n<li>\u591a\u6570\u6d3e&#xff08;\u62e5\u6709\u5927\u591a\u6570 Master&#xff09;\u4fa7\u4f1a\u7ee7\u7eed\u5de5\u4f5c&#xff0c;\u5e76\u9009\u4e3e\u65b0\u7684\u4e3b\u8282\u70b9\u3002<\/li>\n<li>\u5c11\u6570\u6d3e&#xff08;\u88ab\u9694\u79bb\u7684\u65e7 Master&#xff09;\u4fa7\u5728\u8d85\u8fc7 cluster-node-timeout \u65f6\u95f4\u540e&#xff0c;\u4f1a\u505c\u6b62\u63a5\u53d7\u5199\u5165\u3002<\/li>\n<li>\u5982\u679c\u5728\u8d85\u65f6\u4e4b\u524d&#xff0c;\u5ba2\u6237\u7aef\u7ee7\u7eed\u5411\u5c11\u6570\u6d3e\u7684\u65e7 Master \u5199\u5165\u6570\u636e&#xff0c;\u8fd9\u4e9b\u6570\u636e\u5728\u5206\u533a\u6108\u5408\u540e\u5c06\u4e22\u5931\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u5173\u952e\u914d\u7f6e\u53c2\u6570<\/h4>\n<p>\u5728 redis.conf \u4e2d&#xff0c;Cluster \u6a21\u5f0f\u5f15\u5165\u4e86\u4ee5\u4e0b\u5173\u952e\u53c2\u6570&#xff1a;<\/p>\n<ul>\n<li>cluster-enabled &lt;yes\/no&gt;&#xff1a;\u662f\u5426\u542f\u7528\u96c6\u7fa4\u6a21\u5f0f\u3002<\/li>\n<li>cluster-config-file &lt;filename&gt;&#xff1a;\u8282\u70b9\u72b6\u6001\u81ea\u52a8\u4fdd\u5b58\u7684\u6587\u4ef6&#xff08;\u975e\u4eba\u5de5\u7f16\u8f91&#xff09;\u3002<\/li>\n<li>cluster-node-timeout &lt;milliseconds&gt;&#xff1a;\n<ul>\n<li>\u8282\u70b9\u88ab\u89c6\u4e3a\u5931\u6548\u7684\u8d85\u65f6\u65f6\u95f4\u3002<\/li>\n<li>\u4e5f\u662f\u63a7\u5236\u5206\u533a\u573a\u666f\u4e0b\u5c11\u6570\u6d3e\u4f55\u65f6\u505c\u6b62\u5199\u5165\u7684\u5173\u952e\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li>cluster-slave-validity-factor &lt;factor&gt;&#xff1a;\u63a7\u5236\u4ece\u8282\u70b9\u5728\u65ad\u5f00\u8fde\u63a5\u591a\u4e45\u540e\u4e0d\u518d\u5c1d\u8bd5\u53d1\u8d77\u6545\u969c\u8f6c\u79fb&#xff08;0 \u8868\u793a\u603b\u662f\u5c1d\u8bd5&#xff09;\u3002<\/li>\n<li>cluster-require-full-coverage &lt;yes\/no&gt;&#xff1a;\n<ul>\n<li>\u9ed8\u8ba4\u4e3a yes&#xff1a;\u5982\u679c\u6709\u4e00\u90e8\u5206\u69fd\u4f4d\u6ca1\u6709\u88ab\u4efb\u4f55\u8282\u70b9\u8986\u76d6&#xff0c;\u96c6\u7fa4\u505c\u6b62\u63a5\u53d7\u5199\u5165\u3002<\/li>\n<li>\u8bbe\u7f6e\u4e3a no&#xff1a;\u5373\u4f7f\u90e8\u5206\u69fd\u4f4d\u4e0d\u53ef\u7528&#xff0c;\u96c6\u7fa4\u4ecd\u5904\u7406\u5176\u4ed6\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<li>cluster-allow-reads-when-down &lt;yes\/no&gt;&#xff1a;\u662f\u5426\u5141\u8bb8\u5728\u96c6\u7fa4\u6807\u8bb0\u4e3a\u5931\u8d25&#xff08;\u6807\u8bb0\u4e3a down&#xff09;\u65f6&#xff0c;\u8282\u70b9\u5904\u7406\u53ea\u8bfb\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<h4>\u96c6\u7fa4\u8fd0\u7ef4\u5b9e\u6218\u6307\u5357<\/h4>\n<h5>\u521b\u5efa\u96c6\u7fa4<\/h5>\n<p>\u6700\u5c0f\u63a8\u8350\u914d\u7f6e\u662f 3 \u4e3b 3 \u4ece&#xff08;\u5171 6 \u4e2a\u8282\u70b9&#xff09;\u3002 \u4f7f\u7528 redis-cli \u5de5\u5177\u5feb\u901f\u521b\u5efa&#xff1a;<\/p>\n<p>redis-cli &#8211;cluster create <span class=\"token number\">127.0<\/span>.0.1:7000 <span class=\"token number\">127.0<\/span>.0.1:7001 <span class=\"token punctuation\">\\\\<\/span><br \/>\n<span class=\"token number\">127.0<\/span>.0.1:7002 <span class=\"token number\">127.0<\/span>.0.1:7003 <span class=\"token number\">127.0<\/span>.0.1:7004 <span class=\"token punctuation\">\\\\<\/span><br \/>\n<span class=\"token number\">127.0<\/span>.0.1:7005 &#8211;cluster-replicas <span class=\"token number\">1<\/span><\/p>\n<ul>\n<li>&#8211;cluster-replicas 1 \u8868\u793a\u6bcf\u4e2a\u4e3b\u8282\u70b9\u81ea\u52a8\u5206\u914d\u4e00\u4e2a\u4ece\u8282\u70b9\u3002<\/li>\n<li>\u547d\u4ee4\u6267\u884c\u540e&#xff0c;\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5206\u914d 16384 \u4e2a\u69fd\u4f4d\u3002<\/li>\n<\/ul>\n<h5>\u91cd\u5206\u7247<\/h5>\n<p>\u7528\u4e8e\u5e73\u8861\u6570\u636e\u8d1f\u8f7d\u3002<\/p>\n<p>redis-cli &#8211;cluster reshard <span class=\"token number\">127.0<\/span>.0.1:7000<\/p>\n<p>\u5de5\u5177\u4f1a\u5f15\u5bfc\u60a8&#xff1a;<\/p>\n<li>\u8981\u79fb\u52a8\u591a\u5c11\u4e2a\u69fd\u4f4d&#xff1f;<\/li>\n<li>\u63a5\u6536\u69fd\u4f4d\u7684\u76ee\u6807\u8282\u70b9 ID \u662f\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u4ece\u54ea\u4e9b\u6e90\u8282\u70b9\u79fb\u52a8&#xff1f;<\/li>\n<h5>\u589e\u52a0\u4e0e\u5220\u9664\u8282\u70b9<\/h5>\n<li>\u6dfb\u52a0\u65b0\u4e3b\u8282\u70b9&#xff1a;\n<ul>\n<li>\u542f\u52a8\u4e00\u4e2a\u914d\u7f6e\u597d\u7684\u7a7a Redis \u5b9e\u4f8b&#xff08;\u5982\u7aef\u53e3 7006&#xff09;\u3002<\/li>\n<li>\u6267\u884c redis-cli &#8211;cluster add-node 127.0.0.1:7006 127.0.0.1:7000\u3002<\/li>\n<li>\u6b64\u65f6\u8282\u70b9\u5df2\u52a0\u5165&#xff0c;\u4f46\u6ca1\u6709\u69fd\u4f4d\u3002\u9700\u8981\u901a\u8fc7 Resharding&#xff08;\u91cd\u5206\u7247&#xff09;\u5206\u914d\u69fd\u4f4d\u7ed9\u5b83\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u6dfb\u52a0\u65b0\u4ece\u8282\u70b9&#xff1a;\n<ul>\n<li>\u542f\u52a8\u7a7a\u5b9e\u4f8b\u3002<\/li>\n<li>\u6267\u884c redis-cli &#8211;cluster add-node &#8230; &#8211;cluster-slave\u3002\u5b83\u4f1a\u81ea\u52a8\u590d\u5236\u7ed9\u67d0\u4e2a\u526f\u672c\u8f83\u5c11\u7684\u4e3b\u8282\u70b9\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5220\u9664\u8282\u70b9&#xff1a;\n<ul>\n<li>\u5982\u679c\u662f\u4ece\u8282\u70b9&#xff0c;\u76f4\u63a5\u7528 redis-cli &#8211;cluster del-node \u5220\u9664\u3002<\/li>\n<li>\u5982\u679c\u662f\u4e3b\u8282\u70b9&#xff0c;\u5fc5\u987b\u5148\u901a\u8fc7 Resharding \u5c06\u5176\u69fd\u4f4d\u5168\u90e8\u79fb\u51fa&#xff0c;\u4f7f\u5176\u53d8\u7a7a&#xff0c;\u7136\u540e\u624d\u80fd\u5220\u9664\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u96c6\u7fa4\u4e0e\u590d\u5236\u3001\u54e8\u5175\u7684\u5173\u7cfb<\/h4>\n<h5>\u96c6\u7fa4\u4e2d\u7684\u4e3b\u4ece\u8282\u70b9\u662f\u6307 Redis \u526f\u672c\u4e2d\u7684\u4e3b\u4ece\u8282\u70b9\u5417&#xff1f;<\/h5>\n<p>\u662f\u7684&#xff0c;\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n<p>Redis Cluster \u4e2d\u7684\u201c\u4e3b\u8282\u70b9\u201d\u548c\u201c\u4ece\u8282\u70b9\u201d&#xff0c;\u672c\u8d28\u5c31\u662f\u6211\u4eec\u5728\u524d\u9762\u201c\u4e3b\u4ece\u590d\u5236\u201d\u7ae0\u8282\u4e2d\u4ecb\u7ecd\u7684\u540c\u4e00\u4e2a\u4e1c\u897f\u3002<\/p>\n<ul>\n<li>\u96c6\u7fa4\u4e3b\u8282\u70b9&#xff1a;\u5c31\u662f\u4e00\u4e2a\u5f00\u542f\u4e86 cluster-enabled yes \u7684\u666e\u901a Redis \u4e3b\u8282\u70b9&#xff0c;\u53ea\u662f\u5b83\u8fd8\u8d1f\u8d23\u7ba1\u7406\u4e00\u90e8\u5206\u54c8\u5e0c\u69fd\u3002<\/li>\n<li>\u96c6\u7fa4\u4ece\u8282\u70b9&#xff1a;\u5c31\u662f\u4e00\u4e2a\u5f00\u542f\u4e86 cluster-enabled yes \u7684\u666e\u901a Redis \u4ece\u8282\u70b9\u3002\u5b83\u901a\u8fc7\u6807\u51c6\u7684 PSYNC \u547d\u4ee4\u4ece\u4e3b\u8282\u70b9\u540c\u6b65\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u552f\u4e00\u7684\u533a\u522b\u5728\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u666e\u901a\u590d\u5236&#xff1a;\u4e3b\u8282\u70b9\u901a\u5e38\u53ea\u6709 1 \u4e2a&#xff0c;\u4ece\u8282\u70b9\u8d1f\u8d23\u5907\u4efd\u6216\u5206\u62c5\u8bfb\u538b\u529b\u3002<\/li>\n<li>\u96c6\u7fa4\u590d\u5236&#xff1a;\u4e3b\u8282\u70b9\u6709\u591a\u4e2a&#xff0c;\u6bcf\u4e2a\u4e3b\u8282\u70b9\u8d1f\u8d23\u4e0d\u540c\u7684\u6570\u636e&#xff08;\u69fd\u4f4d&#xff09;&#xff0c;\u4ece\u8282\u70b9\u8ddf\u968f\u5b83\u5bf9\u5e94\u7684\u4e3b\u8282\u70b9\u3002\u60a8\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3&#xff1a;Cluster \u5c31\u50cf\u662f\u4e00\u4e2a\u7531\u591a\u4e2a\u201c\u4e3b\u4ece\u590d\u5236\u5c0f\u7ec4\u201d\u7ec4\u6210\u7684\u5927\u8054\u76df\u3002<\/li>\n<\/ul>\n<h5>\u6545\u969c\u81ea\u52a8\u6062\u590d\u662f\u5426\u4f7f\u7528\u4e86\u54e8\u5175&#xff1f;<\/h5>\n<p>\u6ca1\u6709&#xff0c;\u5b8c\u5168\u72ec\u7acb\u3002<\/p>\n<p>Redis Cluster \u4e0d\u4f9d\u8d56 \u54e8\u5175 \u6765\u8fdb\u884c\u6545\u969c\u8f6c\u79fb\u3002\u5b83\u62e5\u6709\u4e00\u5957\u5b8c\u5168\u72ec\u7acb\u7684\u3001\u5185\u7f6e\u7684\u9ad8\u53ef\u7528\u673a\u5236\u3002<\/p>\n<ul>\n<li>\u54e8\u5175\u6a21\u5f0f&#xff1a;Sentinel \u662f\u8fd0\u884c\u5728 Redis \u5916\u90e8 \u7684\u72ec\u7acb\u8fdb\u7a0b&#xff0c;\u4f5c\u4e3a\u201c\u76d1\u5bdf\u5458\u201d\u76d1\u63a7 Redis\u3002\u5b83\u901a\u8fc7\u6295\u7968\u548c\u51b3\u7b56\u6765\u53d1\u8d77\u6545\u969c\u8f6c\u79fb\u3002<\/li>\n<li>\u96c6\u7fa4\u6a21\u5f0f&#xff1a;\u6545\u969c\u8f6c\u79fb\u7684\u903b\u8f91\u96c6\u6210\u5728 Redis \u8282\u70b9\u5185\u90e8\u3002\u8282\u70b9\u4e4b\u95f4\u901a\u8fc7\u4e8c\u8fdb\u5236\u7684 Cluster Bus&#xff08;\u96c6\u7fa4\u603b\u7ebf&#xff09;\u4ea4\u6362\u4fe1\u606f\u3002\u5f53\u4e3b\u8282\u70b9 A \u5b95\u673a&#xff0c;\u5b83\u7684\u4ece\u8282\u70b9 A1\u3001A2 \u4e4b\u95f4\u4f1a\u901a\u8fc7 Gossip \u534f\u8bae\u611f\u77e5&#xff0c;\u5e76\u8fdb\u884c\u5185\u90e8\u6295\u7968&#xff0c;\u76f4\u63a5\u5c06 A1 \u63d0\u5347\u4e3a\u4e3b\u8282\u70b9\u3002<\/li>\n<\/ul>\n<p>\u5173\u952e\u533a\u522b&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u4f7f\u7528 Sentinel&#xff0c;\u60a8\u7684\u67b6\u6784\u91cc\u5fc5\u987b\u8fd0\u884c Sentinel \u8fdb\u7a0b\u3002<\/li>\n<li>\u5982\u679c\u60a8\u4f7f\u7528 Cluster&#xff0c;\u60a8\u7684\u67b6\u6784\u91cc\u4e0d\u9700\u8981 \u8fd0\u884c Sentinel \u8fdb\u7a0b&#xff0c;Cluster \u81ea\u5df1\u5c31\u80fd\u641e\u5b9a\u3002<\/li>\n<\/ul>\n<h5>\u526f\u672c\u3001\u54e8\u5175\u3001\u96c6\u7fa4\u8fd9\u4e09\u4e2a\u662f\u5426\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528&#xff1f;<\/h5>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5173\u4e8e\u67b6\u6784\u9009\u578b\u7684\u95ee\u9898\u3002\u7b54\u6848\u662f&#xff1a;\u673a\u5236\u4e0a\u53ef\u4ee5\u6df7\u5408&#xff0c;\u4f46\u67b6\u6784\u4e0a\u901a\u5e38\u662f\u4e92\u65a5\u7684\u3002<\/p>\n<p>\u6211\u4eec\u8981\u5206\u6e05\u201c\u673a\u5236\u201d\u548c\u201c\u89e3\u51b3\u65b9\u6848\u201d\u4e24\u4e2a\u5c42\u9762&#xff1a;<\/p>\n<ul>\n<li>Redis \u590d\u5236&#xff1a;\u8fd9\u662f\u5e95\u5c42\u673a\u5236\u3002Cluster \u672c\u8eab\u5c31\u662f\u5efa\u7acb\u5728\u590d\u5236\u4e4b\u4e0a\u7684&#xff0c;\u6240\u4ee5\u96c6\u7fa4\u80af\u5b9a\u7528\u4e86\u590d\u5236\u3002<\/li>\n<li>Sentinel vs Cluster&#xff1a;\u8fd9\u662f\u4e24\u4e2a\u5e76\u5217\u7684\u9ad8\u53ef\u7528\/\u6269\u5c55\u89e3\u51b3\u65b9\u6848\u3002\u4e0d\u8981\u6df7\u7528\u3002<\/li>\n<\/ul>\n<p>\u4e3a\u4ec0\u4e48\u4e0d\u5efa\u8bae\u6df7\u7528 Sentinel \u548c Cluster&#xff1f;<\/p>\n<ul>\n<li>\u529f\u80fd\u91cd\u590d&#xff1a;Sentinel \u7ba1\u76d1\u63a7\u548c\u6545\u969c\u8f6c\u79fb&#xff0c;Cluster \u4e5f\u80fd\u7ba1\u76d1\u63a7\u548c\u6545\u969c\u8f6c\u79fb\u3002\u540c\u65f6\u7528\u5c31\u662f\u753b\u86c7\u6dfb\u8db3\u3002<\/li>\n<li>\u903b\u8f91\u51b2\u7a81&#xff1a;Sentinel \u4e0d\u7406\u89e3\u201c\u69fd\u4f4d\u201d\u7684\u6982\u5ff5\u3002\u5982\u679c Cluster \u53d1\u751f\u4e86\u4e3b\u8282\u70b9\u5207\u6362&#xff0c;Sentinel \u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u611f\u77e5 Cluster \u7684\u62d3\u6251\u72b6\u6001&#xff0c;\u53cd\u4e4b\u4ea6\u7136\u3002<\/li>\n<\/ul>\n<p>\u6b63\u786e\u7684\u67b6\u6784\u9009\u62e9\u8def\u5f84&#xff1a;<\/p>\n<table>\n<tr>\u9700\u6c42\u573a\u666f\u63a8\u8350\u65b9\u6848\u5305\u542b\u7684\u6280\u672f\u5173\u7cfb\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u7b80\u5355\u7f13\u5b58<\/td>\n<td align=\"left\">\u5355\u673a Redis<\/td>\n<td align=\"left\">\u65e0<\/td>\n<td align=\"left\">\u6700\u57fa\u7840\u6a21\u5f0f\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6570\u636e\u5b89\u5168 &#043; \u8bfb\u5199\u5206\u79bb<\/td>\n<td align=\"left\">\u4e3b\u4ece\u590d\u5236<\/td>\n<td align=\"left\">\u526f\u672c\u673a\u5236<\/td>\n<td align=\"left\">\u57fa\u7840\u6a21\u5f0f &#043; \u5197\u4f59\u5907\u4efd\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u81ea\u52a8\u6545\u969c\u6062\u590d (\u5355\u673a\u6570\u636e\u91cf)<\/td>\n<td align=\"left\">\u54e8\u5175 &#043; \u4e3b\u4ece\u590d\u5236<\/td>\n<td align=\"left\">\u526f\u672c\u673a\u5236 &#043; Sentinel<\/td>\n<td align=\"left\">\u54e8\u5175\u4f5c\u4e3a\u5916\u6302\u7684\u5927\u8111&#xff0c;\u76d1\u63a7\u4e3b\u4ece\u3002\u8fd9\u662f\u6700\u7ecf\u5178\u7684\u751f\u4ea7\u914d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6d77\u91cf\u6570\u636e (\u5355\u673a\u5b58\u4e0d\u4e0b) &#043; \u9ad8\u5e76\u53d1<\/td>\n<td align=\"left\">Redis Cluster<\/td>\n<td align=\"left\">\u526f\u672c\u673a\u5236 &#043; \u96c6\u7fa4\u903b\u8f91<\/td>\n<td align=\"left\">\u96c6\u7fa4\u81ea\u5e26\u9ad8\u53ef\u7528\u80fd\u529b&#xff0c;\u4e0d\u9700\u8981 Sentinel\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u4ece\u5176\u4ed6\u6a21\u5f0f\u8fc1\u79fb\u5230\u96c6\u7fa4<\/h4>\n<p>\u5982\u679c\u60a8\u76ee\u524d\u5728\u4f7f\u7528\u5355\u673a\u6216 Sentinel \u6a21\u5f0f&#xff0c;\u60f3\u8981\u8fc1\u79fb\u5230 Cluster&#xff1a;<\/p>\n<li>\u505c\u6b62\u5ba2\u6237\u7aef&#xff1a;\u76ee\u524d\u4e0d\u652f\u6301\u70ed\u8fc1\u79fb\u3002<\/li>\n<li>\u751f\u6210 AOF \u6587\u4ef6&#xff1a;\u5bf9\u73b0\u6709\u4e3b\u8282\u70b9\u6267\u884c BGREWRITEAOF\u3002<\/li>\n<li>\u521b\u5efa\u7a7a\u96c6\u7fa4&#xff1a;\u542f\u52a8 N \u4e2a\u65b0\u7684 Cluster \u8282\u70b9&#xff0c;\u4e0d\u5206\u914d\u6570\u636e\u3002<\/li>\n<li>\u66ff\u6362\u6570\u636e&#xff1a;\u505c\u6b62\u65b0\u8282\u70b9&#xff0c;\u5c06\u751f\u6210\u7684 AOF \u6587\u4ef6\u590d\u5236\u5230\u5bf9\u5e94\u7684\u65b0\u8282\u70b9\u76ee\u5f55\u4e2d\u3002<\/li>\n<li>\u542f\u52a8\u5e76\u4fee\u590d&#xff1a;\u542f\u52a8\u65b0\u8282\u70b9\u3002\u5b83\u4eec\u4f1a\u52a0\u8f7d AOF \u6570\u636e\u3002\u4f7f\u7528 redis-cli &#8211;cluster fix \u547d\u4ee4\u5c06 Key \u8fc1\u79fb\u5230\u6b63\u786e\u7684\u69fd\u4f4d\u5bf9\u5e94\u7684\u8282\u70b9\u4e0a\u3002<\/li>\n<li>\u5207\u6362\u5ba2\u6237\u7aef&#xff1a;\u66f4\u65b0\u5ba2\u6237\u7aef\u4f7f\u7528\u652f\u6301 Cluster \u7684\u5e93&#xff0c;\u5e76\u91cd\u65b0\u4e0a\u7ebf\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u76ee\u5f55Redis\u9ad8\u53ef\u7528&#xff1a;\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4Redis \u590d\u5236&#xff1a;\u9ad8\u53ef\u7528\u7684\u57fa\u77f3\u6570\u636e\u540c\u6b65\u673a\u5236\u590d\u5236 ID \u4e0e \u504f\u79fb\u91cf\u5b8c\u5168\u91cd\u540c\u6b65 \u7684\u5185\u90e8\u6d41\u7a0b\u5173\u952e\u914d\u7f6e\u4e0e\u5b89\u5168\u6ce8\u610f\u4e8b\u9879\u7981\u7528\u4e3b\u8282\u70b9\u6301\u4e45\u5316\u65f6\u7684\u98ce\u9669\u53ea\u8bfb\u4ece\u8282\u70b9\u6700\u5c0f\u5199\u5165\u526f\u672c\u6570\u952e\u7684\u8fc7\u671f\u5904\u7406\u5e38\u7528\u547d\u4ee4Redis Sentinel&#xff1a;\u975e\u96c6\u7fa4\u6a21\u5f0f\u4e0b\u7684\u9ad8\u53ef\u7528\u5b88\u62a4\u8005Sentinel \u7684\u6838\u5fc3\u804c\u8d23Sentinel \u7684\u5206\u5e03\u5f0f\u67b6\u6784\u6545\u969c\u68c0\u6d4b\u4e0e\u8f6c\u79fb\u6d41\u7a0b\u4e3b\u89c2\u4e0b\u7ebf vs \u5ba2\u89c2\u4e0b\u7ebf\u6cd5\u5b9a\u4eba\u6570 vs \u591a\u6570\u6d3e\u914d\u7f6e\u7eaa\u5143\u90e8\u7f72\u6700\u4f73\u5b9e\u8df5\u5e03\u5c40\u62d3\u6251\u907f\u514d\u201c\u8111\u88c2\u201d\u4e0e<\/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,1862,100],"topic":[],"class_list":["post-59813","post","type-post","status-publish","format-standard","hentry","category-server","tag-redis","tag-wpf","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\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\/59813.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u76ee\u5f55Redis\u9ad8\u53ef\u7528&#xff1a;\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4Redis \u590d\u5236&#xff1a;\u9ad8\u53ef\u7528\u7684\u57fa\u77f3\u6570\u636e\u540c\u6b65\u673a\u5236\u590d\u5236 ID \u4e0e \u504f\u79fb\u91cf\u5b8c\u5168\u91cd\u540c\u6b65 \u7684\u5185\u90e8\u6d41\u7a0b\u5173\u952e\u914d\u7f6e\u4e0e\u5b89\u5168\u6ce8\u610f\u4e8b\u9879\u7981\u7528\u4e3b\u8282\u70b9\u6301\u4e45\u5316\u65f6\u7684\u98ce\u9669\u53ea\u8bfb\u4ece\u8282\u70b9\u6700\u5c0f\u5199\u5165\u526f\u672c\u6570\u952e\u7684\u8fc7\u671f\u5904\u7406\u5e38\u7528\u547d\u4ee4Redis Sentinel&#xff1a;\u975e\u96c6\u7fa4\u6a21\u5f0f\u4e0b\u7684\u9ad8\u53ef\u7528\u5b88\u62a4\u8005Sentinel \u7684\u6838\u5fc3\u804c\u8d23Sentinel \u7684\u5206\u5e03\u5f0f\u67b6\u6784\u6545\u969c\u68c0\u6d4b\u4e0e\u8f6c\u79fb\u6d41\u7a0b\u4e3b\u89c2\u4e0b\u7ebf vs \u5ba2\u89c2\u4e0b\u7ebf\u6cd5\u5b9a\u4eba\u6570 vs \u591a\u6570\u6d3e\u914d\u7f6e\u7eaa\u5143\u90e8\u7f72\u6700\u4f73\u5b9e\u8df5\u5e03\u5c40\u62d3\u6251\u907f\u514d\u201c\u8111\u88c2\u201d\u4e0e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/59813.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-14T07:06:04+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=\"26 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59813.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/59813.html\",\"name\":\"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-14T07:06:04+00:00\",\"dateModified\":\"2026-01-14T07:06:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/59813.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/59813.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59813.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\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\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\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\/59813.html","og_locale":"zh_CN","og_type":"article","og_title":"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u76ee\u5f55Redis\u9ad8\u53ef\u7528&#xff1a;\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4Redis \u590d\u5236&#xff1a;\u9ad8\u53ef\u7528\u7684\u57fa\u77f3\u6570\u636e\u540c\u6b65\u673a\u5236\u590d\u5236 ID \u4e0e \u504f\u79fb\u91cf\u5b8c\u5168\u91cd\u540c\u6b65 \u7684\u5185\u90e8\u6d41\u7a0b\u5173\u952e\u914d\u7f6e\u4e0e\u5b89\u5168\u6ce8\u610f\u4e8b\u9879\u7981\u7528\u4e3b\u8282\u70b9\u6301\u4e45\u5316\u65f6\u7684\u98ce\u9669\u53ea\u8bfb\u4ece\u8282\u70b9\u6700\u5c0f\u5199\u5165\u526f\u672c\u6570\u952e\u7684\u8fc7\u671f\u5904\u7406\u5e38\u7528\u547d\u4ee4Redis Sentinel&#xff1a;\u975e\u96c6\u7fa4\u6a21\u5f0f\u4e0b\u7684\u9ad8\u53ef\u7528\u5b88\u62a4\u8005Sentinel \u7684\u6838\u5fc3\u804c\u8d23Sentinel \u7684\u5206\u5e03\u5f0f\u67b6\u6784\u6545\u969c\u68c0\u6d4b\u4e0e\u8f6c\u79fb\u6d41\u7a0b\u4e3b\u89c2\u4e0b\u7ebf vs \u5ba2\u89c2\u4e0b\u7ebf\u6cd5\u5b9a\u4eba\u6570 vs \u591a\u6570\u6d3e\u914d\u7f6e\u7eaa\u5143\u90e8\u7f72\u6700\u4f73\u5b9e\u8df5\u5e03\u5c40\u62d3\u6251\u907f\u514d\u201c\u8111\u88c2\u201d\u4e0e","og_url":"https:\/\/www.wsisp.com\/helps\/59813.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-14T07:06:04+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"26 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/59813.html","url":"https:\/\/www.wsisp.com\/helps\/59813.html","name":"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\u96c6\u7fa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-14T07:06:04+00:00","dateModified":"2026-01-14T07:06:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/59813.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/59813.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/59813.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Redis\uff1aRedis\u9ad8\u53ef\u7528\u2014\u2014\u526f\u672c\u3001\u54e8\u5175\u548c\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\/59813","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=59813"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59813\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=59813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=59813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=59813"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=59813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}