{"rsdb":{"rid":"395060","subhead":"","postdate":"0","aid":"272460","fid":"57","uid":"1","topic":"1","content":"

\u3000\u3000a.\u4e1a\u52a1\u5206\u5272\uff0c\u5927\u96c6\u7fa4\u5206\u4e3a\u591a\u4e2a\u5c0f\u96c6\u7fa4\uff1b<\/p>

\u3000\u3000b.\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u6570\u636e\uff1b<\/p>

\u3000\u3000c.\u8c03\u6574\u6570\u636e\u8fc7\u671f\u7b56\u7565\u7b49\u3002
\uff084\uff09\u9002\u5ea6\u5197\u4f59\uff1aRedis\u53ef\u4ee5\u5728\u4e0d\u5f71\u54cd\u96c6\u7fa4\u670d\u52a1\u7684\u60c5\u51b5\u4e0b\u589e\u52a0\u8282\u70b9\uff0c\u56e0\u6b64\u8282\u70b9\u6570\u91cf\u9002\u5f53\u5197\u4f59\u5373\u53ef\uff0c\u4e0d\u7528\u592a\u5927\u3002<\/p>

\u96c6\u7fa4\u7684\u539f\u7406\uff1a<\/strong><\/span><\/p>

\u96c6\u7fa4\u6700\u6838\u5fc3\u7684\u529f\u80fd\u662f\u6570\u636e\u5206\u533a\uff0c\u56e0\u6b64\u9996\u5148\u4ecb\u7ecd\u6570\u636e\u7684\u5206\u533a\u89c4\u5219\uff1b\u7136\u540e\u4ecb\u7ecd\u96c6\u7fa4\u5b9e\u73b0\u7684\u7ec6\u8282\uff1a\u901a\u4fe1\u673a\u5236\u548c\u6570\u636e\u7ed3\u6784\uff1b\u6700\u540e\u4ee5cluster meet(\u8282\u70b9\u63e1\u624b)\u3001cluster addslots(\u69fd\u5206\u914d)\u4e3a\u4f8b\uff0c\u8bf4\u660e\u8282\u70b9\u662f\u5982\u4f55\u5229\u7528\u4e0a\u8ff0\u6570\u636e\u7ed3\u6784\u548c\u901a\u4fe1\u673a\u5236\u5b9e\u73b0\u96c6\u7fa4\u547d\u4ee4\u7684\u3002<\/p>

\u6570\u636e\u5206\u533a\u65b9\u6848\uff1a<\/span><\/strong>
\u3000\u3000\u6570\u636e\u5206\u533a\u6709\u987a\u5e8f\u5206\u533a\u3001\u54c8\u5e0c\u5206\u533a\u7b49\uff0c\u5176\u4e2d\u54c8\u5e0c\u5206\u533a\u7531\u4e8e\u5176\u5929\u7136\u7684\u968f\u673a\u6027\uff0c\u4f7f\u7528\u5e7f\u6cdb\uff1b\u96c6\u7fa4\u7684\u5206\u533a\u65b9\u6848\u4fbf\u662f\u54c8\u5e0c\u5206\u533a\u7684\u4e00\u79cd\u3002
\u3000\u3000\u54c8\u5e0c\u5206\u533a\u7684\u57fa\u672c\u601d\u8def\u662f\uff1a\u5bf9\u6570\u636e\u7684\u7279\u5f81\u503c\uff08\u5982key\uff09\u8fdb\u884c\u54c8\u5e0c\uff0c\u7136\u540e\u6839\u636e\u54c8\u5e0c\u503c\u51b3\u5b9a\u6570\u636e\u843d\u5728\u54ea\u4e2a\u8282\u70b9\u3002\u5e38\u89c1\u7684\u54c8\u5e0c\u5206\u533a\u5305\u62ec\uff1a\u54c8\u5e0c\u53d6\u4f59\u5206\u533a\u3001\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u3001\u5e26\u865a\u62df\u8282\u70b9\u7684\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u7b49\u3002
\u3000\u3000\uff081\uff09\u54c8\u5e0c\u53d6\u4f59\u5206\u533a
\u3000\u3000\u3000\u3000\u54c8\u5e0c\u53d6\u4f59\u5206\u533a\u601d\u8def\u975e\u5e38\u7b80\u5355\uff1a\u8ba1\u7b97key\u7684hash\u503c\uff0c\u7136\u540e\u5bf9\u8282\u70b9\u6570\u91cf\u8fdb\u884c\u53d6\u4f59\uff0c\u4ece\u800c\u51b3\u5b9a\u6570\u636e\u6620\u5c04\u5230\u54ea\u4e2a\u8282\u70b9\u4e0a\u3002\u8be5\u65b9\u6848\u6700\u5927\u7684\u95ee\u9898\u662f\uff0c\u5f53\u65b0\u589e\u6216\u5220\u51cf\u8282\u70b9\u65f6\uff0c\u8282\u70b9\u6570\u91cf\u53d1\u751f\u53d8\u5316\uff0c\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u6570\u636e\u90fd\u9700\u8981\u91cd\u65b0\u8ba1\u7b97\u6620\u5c04\u5173\u7cfb\uff0c\u5f15\u53d1\u5927\u89c4\u6a21\u6570\u636e\u8fc1\u79fb\u3002
\u3000\u3000\uff082\uff09\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a
\u3000\u3000\u3000\u3000\u4e00\u81f4\u6027\u54c8\u5e0c\u7b97\u6cd5\u5c06\u6574\u4e2a\u54c8\u5e0c\u503c\u7a7a\u95f4\u7ec4\u7ec7\u6210\u4e00\u4e2a\u865a\u62df\u7684\u5706\u73af\uff0c\u8303\u56f4\u4e3a0-2^32-1\uff1b\u5bf9\u4e8e\u6bcf\u4e2a\u6570\u636e\uff0c\u6839\u636ekey\u8ba1\u7b97hash\u503c\uff0c\u786e\u5b9a\u6570\u636e\u5728\u73af\u4e0a\u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u4ece\u6b64\u4f4d\u7f6e\u6cbf\u73af\u987a\u65f6\u9488\u884c\u8d70\uff0c\u627e\u5230\u7684\u7b2c\u4e00\u53f0\u670d\u52a1\u5668\u5c31\u662f\u5176\u5e94\u8be5\u6620\u5c04\u5230\u7684\u670d\u52a1\u5668\u3002<\/p>

 \"\"<\/p>

\u3000\u3000\u3000\u4e0e\u54c8\u5e0c\u53d6\u4f59\u5206\u533a\u76f8\u6bd4\uff0c\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u5c06\u589e\u51cf\u8282\u70b9\u7684\u5f71\u54cd\u9650\u5236\u5728\u76f8\u90bb\u8282\u70b9\u3002\u5982\u679c\u5728node1\u548cnode2\u4e4b\u95f4\u589e\u52a0node5\uff0c\u5219\u53ea\u6709node2\u4e2d\u7684\u4e00\u90e8\u5206\u6570\u636e\u4f1a\u8fc1\u79fb\u5230node5\uff1b\u5982\u679c\u53bb\u6389node2\uff0c\u5219\u539fnode2\u4e2d\u7684\u6570\u636e\u53ea\u4f1a\u8fc1\u79fb\u5230node4\u4e2d\uff0c\u53ea\u6709node4\u4f1a\u53d7\u5f71\u54cd\u3002
\u3000\u3000\u3000\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u7684\u4e3b\u8981\u95ee\u9898\u5728\u4e8e\uff0c\u5f53\u8282\u70b9\u6570\u91cf\u8f83\u5c11\u65f6\uff0c\u589e\u52a0\u6216\u5220\u51cf\u8282\u70b9\uff0c\u5bf9\u5355\u4e2a\u8282\u70b9\u7684\u5f71\u54cd\u53ef\u80fd\u5f88\u5927\uff0c\u9020\u6210\u6570\u636e\u7684\u4e25\u91cd\u4e0d\u5e73\u8861\u3002\u8fd8\u662f\u4ee5\u4e0a\u56fe\u4e3a\u4f8b\uff0c\u5982\u679c\u53bb\u6389node2\uff0cnode4\u4e2d\u7684\u6570\u636e\u7531\u603b\u6570\u636e\u76841\/4\u5de6\u53f3\u53d8\u4e3a1\/2\u5de6\u53f3\uff0c\u4e0e\u5176\u4ed6\u8282\u70b9\u76f8\u6bd4\u8d1f\u8f7d\u8fc7\u9ad8\u3002
\u3000\u3000\uff083\uff09\u5e26\u865a\u62df\u8282\u70b9\u7684\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a
\u3000\u3000\u3000\u3000\u8be5\u65b9\u6848\u5728\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u7684\u57fa\u7840\u4e0a\uff0c\u5f15\u5165\u4e86\u865a\u62df\u8282\u70b9\u7684\u6982\u5ff5\u3002Redis\u96c6\u7fa4\u4f7f\u7528\u7684\u4fbf\u662f\u8be5\u65b9\u6848\uff0c\u5176\u4e2d\u7684\u865a\u62df\u8282\u70b9\u79f0\u4e3a\u69fd\uff08slot\uff09\u3002\u69fd\u662f\u4ecb\u4e8e\u6570\u636e\u548c\u5b9e\u9645\u8282\u70b9\u4e4b\u95f4\u7684\u865a\u62df\u6982\u5ff5\uff1b\u6bcf\u4e2a\u5b9e\u9645\u8282\u70b9\u5305\u542b\u4e00\u5b9a\u6570\u91cf\u7684\u69fd\uff0c\u6bcf\u4e2a\u69fd\u5305\u542b\u54c8\u5e0c\u503c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u7684\u6570\u636e\u3002\u5f15\u5165\u69fd\u4ee5\u540e\uff0c<\/p>

\u3000\u3000\u3000\u6570\u636e\u7684\u6620\u5c04\u5173\u7cfb\u7531\u6570\u636ehash->\u5b9e\u9645\u8282\u70b9\uff0c\u53d8\u6210\u4e86\u6570\u636ehash->\u69fd->\u5b9e\u9645\u8282\u70b9\u3002<\/p>

\u3000\u3000\u3000\u3000\u5728\u4f7f\u7528\u4e86\u69fd\u7684\u4e00\u81f4\u6027\u54c8\u5e0c\u5206\u533a\u4e2d\uff0c\u69fd\u662f\u6570\u636e\u7ba1\u7406\u548c\u8fc1\u79fb\u7684\u57fa\u672c\u5355\u4f4d\u3002\u69fd\u89e3\u8026\u4e86\u6570\u636e\u548c\u5b9e\u9645\u8282\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u589e\u52a0\u6216\u5220\u9664\u8282\u70b9\u5bf9\u7cfb\u7edf\u7684\u5f71\u54cd\u5f88\u5c0f\u3002\u4ecd\u4ee5\u4e0a\u56fe\u4e3a\u4f8b\uff0c\u7cfb\u7edf\u4e2d\u67094\u4e2a\u5b9e\u9645\u8282\u70b9\uff0c\u5047\u8bbe\u4e3a\u5176\u5206\u914d16\u4e2a\u69fd(0-15)\uff1b \u69fd0-3\u4f4d\u4e8enode1\uff0c4-7\u4f4d\u4e8enode2\uff0c<\/p>

\u3000\u3000   \u4ee5\u6b64\u7c7b\u63a8\u3002\u5982\u679c\u6b64\u65f6\u5220\u9664node2\uff0c\u53ea\u9700\u8981\u5c06\u69fd4-7\u91cd\u65b0\u5206\u914d\u5373\u53ef\uff0c\u4f8b\u5982\u69fd4-5\u5206\u914d\u7ed9node1\uff0c\u69fd6\u5206\u914d\u7ed9node3\uff0c\u69fd7\u5206\u914d\u7ed9node4\uff1b\u53ef\u4ee5\u770b\u51fa\u5220\u9664node2\u540e\uff0c\u6570\u636e\u5728\u5176\u4ed6\u8282\u70b9\u7684\u5206\u5e03\u4ecd\u7136\u8f83\u4e3a\u5747\u8861\u3002\u69fd\u7684\u6570\u91cf\u4e00\u822c\u8fdc\u5c0f\u4e8e2^32\uff0c\u8fdc\u5927\u4e8e\u5b9e\u9645\u8282\u70b9\u7684\u6570\u91cf\uff1b<\/em><\/p>

\u3000\u3000  \u5728Redis\u96c6\u7fa4\u4e2d\uff0c\u69fd\u7684\u6570\u91cf\u4e3a16384<\/em><\/p>

\u3000\u3000\u4e0b\u9762\u8fd9\u5f20\u56fe\u5f88\u597d\u7684\u603b\u7ed3\u4e86Redis\u96c6\u7fa4\u5c06\u6570\u636e\u6620\u5c04\u5230\u5b9e\u9645\u8282\u70b9\u7684\u8fc7\u7a0b\uff1a<\/p>

        \"\"<\/p>

\u3000\u3000\uff081\uff09Redis\u5bf9\u6570\u636e\u7684\u7279\u5f81\u503c\uff08\u4e00\u822c\u662fkey\uff09\u8ba1\u7b97\u54c8\u5e0c\u503c\uff0c\u4f7f\u7528\u7684\u7b97\u6cd5\u662fCRC16\u3002 Crc16\uff08key\uff09 = hash
\u3000\u3000\uff082\uff09\u6839\u636e\u54c8\u5e0c\u503c\uff0c\u8ba1\u7b97\u6570\u636e\u5c5e\u4e8e\u54ea\u4e2a\u69fd\u3002 Hash % 16384
\u3000\u3000\uff083\uff09\u6839\u636e\u69fd\u4e0e\u8282\u70b9\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u8ba1\u7b97\u6570\u636e\u5c5e\u4e8e\u54ea\u4e2a\u8282\u70b9\u3002<\/p>

 <\/p>

Redis\u96c6\u7fa4\u642d\u5efa\uff1a<\/span><\/strong><\/p>

\u4e00\u3001\u4e3b\/\u4ece\uff08master\/slave\uff09(\u7f3a\u70b9\uff1a \u6570\u636e\u5197\u4f59\uff0c\u6d6a\u8d39\u5185\u5b58 \uff08ping - pong\uff09<\/span><\/p>

\u3000\u30001.\u4e3b\u8282\u70b9\u8bfb\u5199\uff0c\u4ece\u8282\u70b9\u53ea\u80fd\u8bfb\uff0c\u4e0d\u80fd\u5199
\u3000\u30002.\u5f53\u4e3b\u8282\u70b9\u8bfb\u5199\u6570\u636e\u53d8\u5316\u65f6\uff0c\u4f1a\u76f4\u63a5\u540c\u6b65\u5230\u4ece\u8282\u70b9
\u3000\u30003.\u4e00\u4e2amaster\u53ef\u4ee5\u62e5\u6709\u591a\u4e2aslave\uff0c\u4f46\u662f\u4e00\u4e2aslave\u53ea\u80fd\u5bf9\u5e94\u4e00\u4e2amaster<\/p>

\u4e3b\u4ece\u590d\u5236\u5de5\u4f5c\u673a\u5236:<\/strong>
\u3000\u3000\u5f53slave\u542f\u52a8\u540e\uff0c\u4e3b\u52a8\u5411master\u53d1\u9001SYNC\u547d\u4ee4\u3002master\u63a5\u6536\u5230SYNC\u547d\u4ee4\u540e\u5728\u540e\u53f0\u4fdd\u5b58\u5feb\u7167\uff08RDB\u6301\u4e45\u5316\uff09\u548c\u7f13\u5b58\u4fdd\u5b58\u5feb\u7167\u8fd9\u6bb5\u65f6\u95f4\u7684\u547d\u4ee4\uff0c\u7136\u540e\u5c06\u4fdd\u5b58\u7684\u5feb\u7167\u6587\u4ef6\u548c\u7f13\u5b58\u7684\u547d\u4ee4\u53d1\u9001\u7ed9slave\u3002slave\u63a5\u6536\u5230\u5feb\u7167\u6587\u4ef6\u548c\u547d\u4ee4\u540e\u52a0\u8f7d\u5feb\u7167\u6587\u4ef6\u548c\u7f13\u5b58\u7684\u6267\u884c\u547d\u4ee4\u3002\u590d\u5236\u521d\u59cb\u5316\u540e\uff0cmaster\u6bcf\u6b21\u63a5\u6536\u5230\u7684\u5199\u547d\u4ee4\u90fd\u4f1a\u540c\u6b65\u53d1\u9001\u7ed9slave\uff0c\u4fdd\u8bc1\u4e3b\u4ece\u6570\u636e\u4e00\u81f4\u6027\u3002<\/p>

\u4e3b\u4ece\u914d\u7f6e\uff1a<\/strong>
\u3000\u3000redis\u9ed8\u8ba4\u662f\u4e3b\u6570\u636e\uff0c\u6240\u4ee5master\u65e0\u9700\u914d\u7f6e\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4fee\u6539slave\u7684\u914d\u7f6e\u5373\u53ef\u3002
\u3000\u3000a.\u8bbe\u7f6e\u9700\u8981\u8fde\u63a5\u7684master\u7684ip\u7aef\u53e3:
\u3000\u3000\u3000\u3000slaveof 192.168.0.107 6379
\u3000\u3000b.\u5982\u679cmaster\u8bbe\u7f6e\u4e86\u5bc6\u7801\u3002\u9700\u8981\u914d\u7f6e\uff1a
\u3000\u3000\u3000\u3000masterauth
\u3000\u3000c.\u8fde\u63a5\u6210\u529f\u8fdb\u5165\u547d\u4ee4\u884c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u884c\u67e5\u770b\u8fde\u63a5\u8be5\u6570\u636e\u5e93\u7684\u5176\u4ed6\u5e93\u4fe1\u606f:
\u3000\u3000\u3000\u3000info replication<\/p>

 <\/p>

\u4e8c\u3001\u54e8\u5175\u6a21\u5f0f\uff08sentinel\uff09<\/p>

\u3000\u3000\u54e8\u5175\u7684\u547d\u4ee4\uff0c\u54e8\u5175\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u8fdb\u7a0b\uff0c\u4f5c\u4e3a\u8fdb\u7a0b\uff0c\u5b83\u4f1a\u72ec\u7acb\u8fd0\u884c\u3002\u5176\u539f\u7406\u662f\u54e8\u5175\u901a\u8fc7\u53d1\u9001\u547d\u4ee4\uff0c\u7b49\u5f85Redis\u670d\u52a1\u5668\u54cd\u5e94\uff0c\u4ece\u800c\u76d1\u63a7\u8fd0\u884c\u7684\u591a\u4e2aRedis\u5b9e\u4f8b\u3002\uff08ping - pong\uff09<\/p>

\u3000\u3000\"\"<\/p>

\u3000\u3000<\/p>

\u8fd9\u91cc\u7684\u54e8\u5175\u6709\u4e24\u4e2a\u4f5c\u7528:<\/strong>
\u3000\u3000? \u901a\u8fc7\u53d1\u9001\u547d\u4ee4\uff0c\u8ba9Redis\u670d\u52a1\u5668\u8fd4\u56de\u76d1\u63a7\u5176\u8fd0\u884c\u72b6\u6001\uff0c\u5305\u62ec\u4e3b\u670d\u52a1\u5668\u548c\u4ece\u670d\u52a1\u5668\u3002
\u3000\u3000? \u5f53\u54e8\u5175\u76d1\u6d4b\u5230master\u5b95\u673a\uff0c\u4f1a\u81ea\u52a8\u5c06slave\u5207\u6362\u6210master\uff0c\u7136\u540e\u901a\u8fc7\u53d1\u5e03\u8ba2\u9605\u6a21\u5f0f\u901a\u77e5\u5176\u4ed6\u7684\u4ece\u670d\u52a1\u5668\uff0c\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u8ba9\u5b83\u4eec\u5207\u6362\u4e3b\u673a\u3002
\u7136\u800c\u4e00\u4e2a\u54e8\u5175\u8fdb\u7a0b\u5bf9Redis\u670d\u52a1\u5668\u8fdb\u884c\u76d1\u63a7\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u95ee\u9898\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u54e8\u5175\u8fdb\u884c\u76d1\u63a7\u3002\u5404\u4e2a\u54e8\u5175\u4e4b\u95f4\u8fd8\u4f1a\u8fdb\u884c\u76d1\u63a7\uff0c\u8fd9\u6837\u5c31\u5f62\u6210\u4e86\u591a\u54e8\u5175\u6a21\u5f0f\u3002
\u6545\u969c\u5207\u6362\uff08failover\uff09\u7684\u8fc7\u7a0b:<\/strong>
\u3000\u3000\u5047\u8bbe\u4e3b\u670d\u52a1\u5668\u5b95\u673a\uff0c\u54e8\u51751\u5148\u68c0\u6d4b\u5230\u8fd9\u4e2a\u7ed3\u679c\uff0c\u7cfb\u7edf\u5e76\u4e0d\u4f1a\u9a6c\u4e0a\u8fdb\u884cfailover\u8fc7\u7a0b\uff0c\u4ec5\u4ec5\u662f\u54e8\u51751\u4e3b\u89c2\u7684\u8ba4\u4e3a\u4e3b\u670d\u52a1\u5668\u4e0d\u53ef\u7528\uff0c\u8fd9\u4e2a\u73b0\u8c61\u6210\u4e3a\u4e3b\u89c2\u4e0b\u7ebf\u3002\u5f53\u540e\u9762\u7684\u54e8\u5175\u4e5f\u68c0\u6d4b\u5230\u4e3b\u670d\u52a1\u5668\u4e0d\u53ef\u7528\uff0c\u5e76\u4e14\u6570\u91cf\u8fbe\u5230\u4e00\u5b9a\u503c\u65f6\uff0c\u90a3\u4e48\u54e8\u5175\u4e4b\u95f4\u5c31\u4f1a\u8fdb\u884c\u4e00\u6b21\u6295\u7968\uff0c\u6295\u7968\u7684\u7ed3\u679c\u7531\u4e00\u4e2a\u54e8\u5175\u53d1\u8d77\uff0c\u8fdb\u884cfailover\u64cd\u4f5c\u3002\u5207\u6362\u6210\u529f\u540e\uff0c\u5c31\u4f1a\u901a\u8fc7\u53d1\u5e03\u8ba2\u9605\u6a21\u5f0f\uff0c\u8ba9\u5404\u4e2a\u54e8\u5175\u628a\u81ea\u5df1\u76d1\u63a7\u7684\u4ece\u670d\u52a1\u5668\u5b9e\u73b0\u5207\u6362\u4e3b\u673a\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a\u5ba2\u89c2\u4e0b\u7ebf\u3002\u8fd9\u6837\u5bf9\u4e8e\u5ba2\u6237\u7aef\u800c\u8a00\uff0c\u4e00\u5207\u90fd\u662f\u900f\u660e\u7684<\/p>

\u914d\u7f6e\uff1a<\/strong><\/p>

\u3000\u3000\u914d\u7f6eRedis\u7684\u4e3b\u4ece\u670d\u52a1\u5668\uff0c\u4fee\u6539redis.conf\u6587\u4ef6\u5982\u4e0b
\u3000\u3000# \u4f7f\u5f97Redis\u670d\u52a1\u5668\u53ef\u4ee5\u8de8\u7f51\u7edc\u8bbf\u95ee
\u3000\u3000bind 0.0.0.0
\u3000\u3000# \u8bbe\u7f6e\u5bc6\u7801
\u3000\u3000requirepass "123456"
\u3000\u3000# \u6307\u5b9a\u4e3b\u670d\u52a1\u5668\uff0c\u6ce8\u610f\uff1a\u6709\u5173slaveof\u7684\u914d\u7f6e\u53ea\u662f\u914d\u7f6e\u4ece\u670d\u52a1\u5668\uff0c\u4e3b\u670d\u52a1\u5668\u4e0d\u9700\u8981\u914d\u7f6e
\u3000\u3000slaveof 192.168.11.128 6379
\u3000\u3000# \u4e3b\u670d\u52a1\u5668\u5bc6\u7801\uff0c\u6ce8\u610f\uff1a\u6709\u5173slaveof\u7684\u914d\u7f6e\u53ea\u662f\u914d\u7f6e\u4ece\u670d\u52a1\u5668\uff0c\u4e3b\u670d\u52a1\u5668\u4e0d\u9700\u8981\u914d\u7f6e
\u3000\u3000masterauth 123456

\u3000\u3000\u914d\u7f6e\u54e8\u5175\uff0c\u5728Redis\u5b89\u88c5\u76ee\u5f55\u4e0b\u6709\u4e00\u4e2asentinel.conf\u6587\u4ef6\uff0ccopy\u4e00\u4efd\u8fdb\u884c\u4fee\u6539
\u3000\u3000# \u7981\u6b62\u4fdd\u62a4\u6a21\u5f0f
\u3000\u3000protected-mode no
\u3000\u3000#\u914d\u7f6e\u76d1\u542c\u7684\u4e3b\u670d\u52a1\u5668\uff0c\u8fd9\u91ccsentinel monitor\u4ee3\u8868\u76d1\u63a7\uff0cmymaster\u4ee3\u8868\u670d\u52a1\u5668\u7684\u540d\u79f0\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c192.168.11.128\u4ee3\u8868\u76d1\u63a7\u7684\u4e3b\u670d\u52a1\u5668\uff0c6379\u4ee3\u8868\u7aef\u53e3\uff0c2\u4ee3\u8868\u53ea\u6709\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u7684\u54e8\u5175\u8ba4\u4e3a\u4e3b\u670d\u52a1\u5668\u4e0d\u53ef\u7528\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u8fdb\u884cfailover\u64cd\u4f5c\u3002
\u3000\u3000sentinel monitor mymaster 192.168.11.128 6379 2
\u3000\u3000# sentinel author-pass\u5b9a\u4e49\u670d\u52a1\u7684\u5bc6\u7801\uff0cmym","orderid":"0","title":"redis\u96c6\u7fa4\u8bbe\u8ba1\u65b9\u6848\u53ca\u539f\u7406(\u4e00)","smalltitle":"","mid":"0","fname":"\u6570\u636e\u5e93\u7f16\u7a0b","special_id":"0","bak_id":"0","info":"0","hits":"433","pages":"4","comments":"0","posttime":"2023-07-26 08:18:15","list":"1690330695","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"redis<\/A> \u8ba1\u65b9\u6848<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"119.59.235.169","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"redis\u96c6\u7fa4\u8bbe\u8ba1\u65b9\u6848\u53ca\u539f\u7406","lastview":"1715032370","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}