{"id":113738,"date":"2026-10-07T10:41:11","date_gmt":"2026-10-07T02:41:11","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113738.html"},"modified":"2026-10-07T10:41:11","modified_gmt":"2026-10-07T02:41:11","slug":"redis-%e5%85%a5%e9%97%a8%ef%bc%88%e4%b8%80%ef%bc%89%ef%bc%9aredis-%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e5%90%8e%e7%ab%af%e9%83%bd%e7%a6%bb%e4%b8%8d%e5%bc%80%e5%ae%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113738.html","title":{"rendered":"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83"},"content":{"rendered":"<p>  \u4e2a\u4eba\u4e3b\u9875&#xff1a;<br \/>\n &gt; \u6211\u4e0d\u4f1a\u8d77\u540d\u5b57322 &lt; &#xff08;\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8385\u4e34&#x1f60a;&#xff09; <\/p>\n<p>  \u5176\u4ed6\u680f\u76ee&#xff1a;<br \/>\n &gt; \u6280\u672f\u6808\u5b66\u4e60\u7b14\u8bb0 &lt; <\/p>\n<p>  \u5176\u4ed6\u680f\u76ee&#xff1a;<br \/>\n &gt; \u529b\u6263Hot100\u9898\u76ee\u89e3\u6790 &lt; <\/p>\n<p>  \u5176\u4ed6\u680f\u76ee&#xff1a;<br \/>\n &gt; Go\u9879\u76ee\u5b66\u4e60\u7b14\u8bb0 &lt; <\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>Redis \u5165\u95e8&#xff08;\u4e00&#xff09;&#xff1a;Redis \u662f\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83<\/li>\n<li>\n<ul>\n<li>\u4e00\u3001Redis \u5230\u5e95\u662f\u4ec0\u4e48<\/li>\n<li>\n<ul>\n<li>1.1 \u4e00\u53e5\u8bdd\u5b9a\u4f4d<\/li>\n<li>1.2 \u5b83\u4e0d\u662f MySQL \u7684\u66ff\u4ee3\u54c1<\/li>\n<li>1.3 Redis \u4e3a\u4ec0\u4e48\u5feb<\/li>\n<li>1.4 \u56db\u4e2a\u6700\u5178\u578b\u7684\u4f7f\u7528\u573a\u666f<\/li>\n<\/ul>\n<\/li>\n<li>\u4e8c\u3001\u628a Redis \u88c5\u4e0a<\/li>\n<li>\n<ul>\n<li>2.1 Linux \u6e90\u7801\u7f16\u8bd1\u5b89\u88c5<\/li>\n<li>2.2 \u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5<\/li>\n<li>2.3 Docker \u4e00\u6761\u547d\u4ee4\u8d77\u4e00\u4e2a<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u542f\u52a8\u3001\u5173\u95ed\u4e0e\u914d\u7f6e<\/li>\n<li>\n<ul>\n<li>3.1 \u4e24\u79cd\u542f\u52a8\u65b9\u5f0f<\/li>\n<li>3.2 \u4e09\u79cd\u5173\u95ed\u65b9\u5f0f<\/li>\n<li>3.3 redis.conf \u91cc\u65b0\u624b\u6700\u8be5\u5148\u770b\u7684\u4e94\u4e2a\u53c2\u6570<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u7b2c\u4e00\u6b21\u7528 redis-cli \u8fde\u4e0a\u5e76\u9a8c\u8bc1<\/li>\n<li>\n<ul>\n<li>4.1 \u8fde\u63a5<\/li>\n<li>4.2 \u4f9d\u6b21\u9a8c\u8bc1\u8fd9\u51e0\u6761<\/li>\n<li>4.3 \u4e0d\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\u76f4\u63a5\u7528<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u5e38\u89c1\u542f\u52a8\u62a5\u9519\u4e0e\u6392\u67e5<\/li>\n<li>\u5c0f\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Redis \u5165\u95e8&#xff08;\u4e00&#xff09;&#xff1a;Redis \u662f\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83<\/h2>\n<p>\u8fd9\u7bc7\u53ea\u5e72\u4e00\u4ef6\u4e8b&#xff1a;\u628a Redis \u7684\u5b9a\u4f4d\u8bb2\u6e05\u695a&#xff0c;\u518d\u5e26\u4f60\u4ece\u96f6\u628a\u5b83\u88c5\u8d77\u6765\u3001\u542f\u52a8\u3001\u8fde\u4e0a\u3001\u8dd1\u901a\u51e0\u6761\u547d\u4ee4\u3002\u9002\u5408\u521a\u5f00\u59cb\u5b66\u540e\u7aef\u3001\u8fd8\u6ca1\u6709\u771f\u6b63\u7528\u8fc7\u7f13\u5b58\u7684\u540c\u5b66&#xff0c;\u4e5f\u9002\u5408\u73af\u5883\u8352\u5e9f\u5f88\u4e45\u3001\u60f3\u91cd\u65b0\u628a Redis \u8dd1\u8d77\u6765\u7684\u5f00\u53d1\u8005\u3002\u770b\u5b8c\u4e4b\u540e&#xff0c;\u4f60\u5e94\u8be5\u80fd\u72ec\u7acb\u5b8c\u6210\u4e00\u6b21\u5b89\u88c5\u4e0e\u9a8c\u8bc1&#xff0c;\u5e76\u4e14\u77e5\u9053\u914d\u7f6e\u6587\u4ef6\u91cc\u54ea\u51e0\u4e2a\u53c2\u6570\u5148\u522b\u4e71\u6539\u3002<\/p>\n<h3>\u4e00\u3001Redis \u5230\u5e95\u662f\u4ec0\u4e48<\/h3>\n<h4>1.1 \u4e00\u53e5\u8bdd\u5b9a\u4f4d<\/h4>\n<p>Redis \u7684\u5168\u79f0\u662f Remote Dictionary Server&#xff0c;\u76f4\u8bd1\u8fc7\u6765\u5c31\u662f&#034;\u8fdc\u7a0b\u5b57\u5178\u670d\u52a1&#034;\u3002\u5b83\u7684\u6838\u5fc3\u7279\u5f81\u53ea\u6709\u4e24\u6761&#xff1a;\u6570\u636e\u653e\u5728\u5185\u5b58\u91cc&#xff0c;\u7ec4\u7ec7\u65b9\u5f0f\u662f key-value&#xff0c;\u7136\u540e\u901a\u8fc7\u7f51\u7edc\u628a\u8bfb\u5199\u80fd\u529b\u5f00\u653e\u7ed9\u522b\u7684\u8fdb\u7a0b\u3002<\/p>\n<p>\u8fd9\u53e5\u8bdd\u91cc&#034;\u8fdc\u7a0b&#034;\u4e24\u4e2a\u5b57\u5f88\u5173\u952e\u3002\u5982\u679c\u53ea\u662f\u5355\u4e2a\u7a0b\u5e8f\u81ea\u5df1\u7528&#xff0c;\u90a3\u7528\u8bed\u8a00\u5185\u7f6e\u7684 Map \u5c31\u591f\u4e86&#xff0c;\u6ca1\u5fc5\u8981\u518d\u5f15\u5165\u4e00\u4e2a\u4e2d\u95f4\u4ef6\u3002\u771f\u6b63\u7684\u4ef7\u503c\u51fa\u73b0\u5728\u591a\u53f0\u673a\u5668\u3001\u591a\u4e2a\u670d\u52a1\u9700\u8981\u5171\u4eab\u540c\u4e00\u4efd\u72b6\u6001\u7684\u65f6\u5019\u2014\u2014\u8fd9\u65f6\u5019\u67d0\u4e2a\u8fdb\u7a0b\u7684\u5185\u5b58\u53d8\u91cf\u6ca1\u6cd5\u7ed9\u522b\u7684\u8fdb\u7a0b\u770b&#xff0c;\u800c Redis \u53ef\u4ee5\u3002<\/p>\n<p>\u6240\u4ee5\u66f4\u51c6\u786e\u7684\u8bf4\u6cd5\u662f&#xff1a;Redis \u662f\u4e00\u4e2a\u57fa\u4e8e\u7f51\u7edc\u7684\u5185\u5b58\u6570\u636e\u5b58\u50a8\u670d\u52a1&#xff0c;\u5b83\u540c\u65f6\u5177\u5907&#034;\u7f13\u5b58&#034;\u548c&#034;\u6570\u636e\u5e93&#034;\u4e24\u79cd\u89d2\u8272\u3002<\/p>\n<h4>1.2 \u5b83\u4e0d\u662f MySQL \u7684\u66ff\u4ee3\u54c1<\/h4>\n<p>\u4e24\u8005\u7684\u5dee\u5f02\u4ece\u5b58\u50a8\u4ecb\u8d28\u5c31\u5f00\u59cb\u4e86&#xff1a;<\/p>\n<table>\n<tr>\u7ef4\u5ea6MySQLRedis<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u636e\u843d\u5728\u54ea<\/td>\n<td>\u78c1\u76d8\u4e3a\u4e3b<\/td>\n<td>\u5185\u5b58\u4e3a\u4e3b<\/td>\n<\/tr>\n<tr>\n<td>\u7ec4\u7ec7\u65b9\u5f0f<\/td>\n<td>\u8868 \/ \u884c \/ \u5217<\/td>\n<td>key-value<\/td>\n<\/tr>\n<tr>\n<td>\u5b9a\u4f4d<\/td>\n<td>\u5168\u91cf\u3001\u53ef\u9760\u5730\u4fdd\u5b58\u6570\u636e<\/td>\n<td>\u5feb\u901f\u8bfb\u53d6\u70ed\u70b9\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>\u5bb9\u91cf<\/td>\n<td>\u5927&#xff0c;\u53ef\u4ee5\u5206\u5e93\u5206\u8868<\/td>\n<td>\u53d7\u5185\u5b58\u9650\u5236&#xff0c;\u5355\u673a\u901a\u5e38\u51e0\u5341 GB<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>MySQL \u9762\u5bf9\u7684\u95ee\u9898\u4e0d\u662f&#034;\u4e0d\u53ef\u9760&#034;&#xff0c;\u800c\u662f&#034;\u6bcf\u6b21\u67e5\u8be2\u90fd\u8981\u78b0\u78c1\u76d8&#xff0c;\u6162&#034;\u3002\u4e92\u8054\u7f51\u4e1a\u52a1\u91cc\u8bfb\u64cd\u4f5c\u5f80\u5f80\u8fdc\u591a\u4e8e\u5199\u64cd\u4f5c&#xff0c;\u5982\u679c\u6bcf\u6b21\u90fd\u6253\u5230 MySQL&#xff0c;\u6570\u636e\u5e93\u5f88\u5feb\u5c31\u4f1a\u6210\u4e3a\u74f6\u9888\u3002\u4e1a\u754c\u7684\u7ecf\u5178\u505a\u6cd5\u662f\u4e8c\u516b\u539f\u5219&#xff1a;\u628a\u8bbf\u95ee\u6700\u9891\u7e41\u7684\u90a3 20% \u6570\u636e\u653e\u8fdb Redis&#xff0c;\u8ba9\u5b83\u627f\u63a5 80% \u7684\u8bfb\u8bf7\u6c42&#xff0c;\u5269\u4e0b\u7684\u5168\u91cf\u6570\u636e\u4ecd\u7136\u8001\u8001\u5b9e\u5b9e\u5b58\u5728 MySQL \u91cc\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u65b0\u624b\u6700\u5bb9\u6613\u5ffd\u7565\u7684\u70b9&#xff1a;\u4e00\u65e6\u5f15\u5165 Redis \u7f13\u5b58&#xff0c;\u5c31\u51ed\u7a7a\u591a\u51fa\u4e86&#034;\u4e24\u8fb9\u6570\u636e\u53ef\u80fd\u4e0d\u4e00\u81f4&#034;\u7684\u95ee\u9898\u3002\u6240\u4ee5\u7f13\u5b58\u7684\u5b9a\u4f4d\u662f\u52a0\u901f&#xff0c;\u4e0d\u662f\u6743\u5a01\u6570\u636e\u6e90\u3002Redis \u6302\u4e86\u3001\u6570\u636e\u88ab\u6e05\u4e86&#xff0c;\u4e1a\u52a1\u5e94\u8be5\u8fd8\u80fd\u4ece MySQL \u91cd\u65b0\u52a0\u8f7d\u56de\u6765&#xff0c;\u800c\u4e0d\u662f\u76f4\u63a5\u5d29\u6389\u3002<\/p>\n<h4>1.3 Redis \u4e3a\u4ec0\u4e48\u5feb<\/h4>\n<p>\u9762\u8bd5\u5e38\u95ee&#xff0c;\u4f46\u7b54\u6848\u4e0d\u8be5\u53ea\u80cc&#034;\u56e0\u4e3a\u5b83\u5728\u5185\u5b58\u91cc&#034;\u3002\u4e3b\u8981\u6709\u56db\u70b9&#xff1a;<\/p>\n<li>\u5185\u5b58\u64cd\u4f5c\u3002\u8bfb\u5199\u5185\u5b58\u548c\u8bfb\u5199\u78c1\u76d8\u5dee\u7740\u597d\u51e0\u4e2a\u6570\u91cf\u7ea7&#xff0c;\u8fd9\u662f\u6700\u6839\u672c\u7684\u539f\u56e0\u3002<\/li>\n<li>\u6570\u636e\u7ed3\u6784\u7b80\u5355\u9ad8\u6548\u3002Redis \u5e95\u5c42\u81ea\u5df1\u5b9e\u73b0\u4e86\u52a8\u6001\u5b57\u7b26\u4e32\u3001\u8df3\u8868\u3001\u538b\u7f29\u5217\u8868\u7b49\u7ed3\u6784&#xff0c;\u5927\u90e8\u5206\u547d\u4ee4\u7684\u590d\u6742\u5ea6\u662f O(1) \u6216 O(log N)&#xff0c;\u4e0d\u5b58\u5728 SQL \u89e3\u6790\u3001\u6267\u884c\u8ba1\u5212\u3001\u591a\u8868\u5173\u8054\u8fd9\u4e00\u6574\u5957\u5f00\u9500\u3002<\/li>\n<li>\u7f51\u7edc\u6a21\u578b\u7528\u4e86 IO \u591a\u8def\u590d\u7528\u3002\u5355\u4e2a\u7ebf\u7a0b\u914d\u5408 epoll \u4e4b\u7c7b\u7684\u673a\u5236&#xff0c;\u5c31\u80fd\u540c\u65f6\u76ef\u4f4f\u6210\u5343\u4e0a\u4e07\u4e2a\u8fde\u63a5&#xff0c;\u907f\u514d\u4e86\u4e3a\u6bcf\u6761\u8fde\u63a5\u5f00\u4e00\u4e2a\u7ebf\u7a0b\u3002<\/li>\n<li>\u6838\u5fc3\u547d\u4ee4\u8d70\u5355\u7ebf\u7a0b\u3002\u4e0d\u9700\u8981\u52a0\u9501&#xff0c;\u4e5f\u5c31\u6ca1\u6709\u7ebf\u7a0b\u5207\u6362\u548c\u9501\u7ade\u4e89\u7684\u5f00\u9500\u3002<\/li>\n<p>\u987a\u4fbf\u6f84\u6e05\u4e00\u4e2a\u5e38\u89c1\u8bef\u89e3&#xff1a;Redis 6.0 \u4e4b\u540e\u786e\u5b9e\u5f15\u5165\u4e86\u591a\u7ebf\u7a0b&#xff0c;\u4f46\u591a\u7ebf\u7a0b\u53ea\u7528\u5728\u4e86\u7f51\u7edc\u6536\u53d1\u8fd9\u7c7b IO \u5904\u7406\u4e0a&#xff0c;\u547d\u4ee4\u7684\u6267\u884c\u4f9d\u65e7\u662f\u5355\u7ebf\u7a0b\u3002\u6240\u4ee5&#034;Redis \u662f\u5355\u7ebf\u7a0b&#034;\u8fd9\u4e2a\u8bf4\u6cd5\u5728\u4eca\u5929\u4f9d\u7136\u57fa\u672c\u6210\u7acb\u3002<\/p>\n<h4>1.4 \u56db\u4e2a\u6700\u5178\u578b\u7684\u4f7f\u7528\u573a\u666f<\/h4>\n<ul>\n<li>\u7f13\u5b58&#xff1a;\u6700\u5e38\u89c1\u7684\u7528\u6cd5\u3002\u70ed\u70b9\u5546\u54c1\u8be6\u60c5\u3001\u9996\u9875\u914d\u7f6e\u3001\u7528\u6237\u57fa\u7840\u4fe1\u606f&#xff0c;\u5148\u67e5 Redis&#xff0c;\u6ca1\u6709\u518d\u56de\u67e5 MySQL \u5e76\u5199\u56de\u7f13\u5b58\u3002<\/li>\n<li>\u5206\u5e03\u5f0f\u9501&#xff1a;\u591a\u53f0\u673a\u5668\u8981\u4e89\u62a2\u540c\u4e00\u4e2a\u8d44\u6e90&#xff08;\u6bd4\u5982\u5b9a\u65f6\u4efb\u52a1\u53ea\u5141\u8bb8\u4e00\u4e2a\u8282\u70b9\u6267\u884c&#xff09;&#xff0c;\u9760 Redis \u7684 SET NX \u52a0\u4e0a\u8fc7\u671f\u65f6\u95f4\u6765\u505a\u4e92\u65a5\u3002<\/li>\n<li>\u8ba1\u6570\u5668&#xff1a;\u6587\u7ae0\u9605\u8bfb\u91cf\u3001\u63a5\u53e3\u8c03\u7528\u6b21\u6570\u3001\u70b9\u8d5e\u6570\u3002Redis \u7684\u539f\u5b50\u81ea\u589e\u547d\u4ee4\u5929\u7136\u9002\u5408&#xff0c;\u800c\u4e14\u4e0d\u7528\u62c5\u5fc3\u5e76\u53d1\u8986\u76d6\u3002<\/li>\n<li>\u6392\u884c\u699c&#xff1a;\u6e38\u620f\u79ef\u5206\u699c\u3001\u70ed\u641c\u699c\u3002Redis \u81ea\u5e26\u6309\u5206\u6570\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u63d2\u5165\u548c\u53d6 Top N \u90fd\u5f88\u8f7b\u677e\u3002<\/li>\n<\/ul>\n<p>\u4f1a\u8bdd\u5171\u4eab&#xff08;\u628a session \u4ece\u5355\u673a\u632a\u5230 Redis&#xff09;\u3001\u7b80\u5355\u7684\u6d88\u606f\u961f\u5217\u4e5f\u5728\u4f7f\u7528\u8303\u56f4\u4e4b\u5185&#xff0c;\u4f46\u4e1a\u5185\u6709\u66f4\u4e13\u4e1a\u7684\u9009\u62e9&#xff0c;\u4e0d\u5fc5\u5f3a\u6c42\u3002<\/p>\n<h3>\u4e8c\u3001\u628a Redis \u88c5\u4e0a<\/h3>\n<p>\u4e0b\u9762\u4e09\u6761\u8def\u4efb\u9009\u5176\u4e00\u5373\u53ef\u3002\u751f\u4ea7\u73af\u5883\u7684\u6b63\u786e\u9009\u62e9\u662f Linux&#xff0c;Windows \u4e0a\u7528\u5b98\u65b9\u79fb\u690d\u7248\u6216\u8005\u5e72\u8106\u4e0a Docker \/ WSL\u3002<\/p>\n<h4>2.1 Linux \u6e90\u7801\u7f16\u8bd1\u5b89\u88c5<\/h4>\n<p>\u60f3\u7528\u6700\u65b0\u7248\u672c\u3001\u6216\u8005\u9700\u8981\u81ea\u5df1\u8c03\u7f16\u8bd1\u53c2\u6570\u65f6\u9009\u5b83&#xff1a;<\/p>\n<p><span class=\"token comment\"># 1. \u88c5\u7f16\u8bd1\u4f9d\u8d56&#xff08;\u4ee5 CentOS \u4e3a\u4f8b&#xff0c;Ubuntu \u6362\u6210 build-essential&#xff09;<\/span><br \/>\nyum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> gcc <span class=\"token function\">make<\/span> <span class=\"token function\">wget<\/span><\/p>\n<p><span class=\"token comment\"># 2. \u4e0b\u8f7d\u5e76\u89e3\u538b\u6e90\u7801\u5305<\/span><br \/>\n<span class=\"token builtin class-name\">cd<\/span> \/usr\/local\/src<br \/>\n<span class=\"token function\">wget<\/span> https:\/\/download.redis.io\/releases\/redis-7.2.4.tar.gz<br \/>\n<span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> redis-7.2.4.tar.gz<\/p>\n<p><span class=\"token comment\"># 3. \u7f16\u8bd1&#xff0c;\u5e76\u628a\u53ef\u6267\u884c\u6587\u4ef6\u88c5\u5230 \/usr\/local\/bin<\/span><br \/>\n<span class=\"token builtin class-name\">cd<\/span> redis-7.2.4<br \/>\n<span class=\"token function\">make<\/span><br \/>\n<span class=\"token function\">make<\/span> <span class=\"token function\">install<\/span><\/p>\n<p><span class=\"token comment\"># 4. \u51c6\u5907\u914d\u7f6e\u6587\u4ef6\u548c\u76ee\u5f55<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/redis \/var\/lib\/redis<br \/>\n<span class=\"token function\">cp<\/span> redis.conf \/etc\/redis\/redis.conf<\/p>\n<p>make \u8fd9\u4e00\u6b65\u5982\u679c\u62a5\u9519\u8bf4\u627e\u4e0d\u5230 jemalloc&#xff0c;\u53ef\u4ee5\u6539\u7528 make MALLOC&#061;libc\u3002\u7f16\u8bd1\u5b8c\u6210\u540e redis-server\u3001redis-cli \u90fd\u5728 \/usr\/local\/bin \u4e0b&#xff0c;\u4efb\u4f55\u76ee\u5f55\u90fd\u80fd\u76f4\u63a5\u8c03\u7528\u3002<\/p>\n<h4>2.2 \u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5<\/h4>\n<p>\u56fe\u7701\u4e8b\u5c31\u7528\u7cfb\u7edf\u4ed3\u5e93\u7684\u7248\u672c&#xff0c;\u7f3a\u70b9\u662f\u7248\u672c\u901a\u5e38\u504f\u65e7&#xff1a;<\/p>\n<p><span class=\"token comment\"># Ubuntu \/ Debian<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> redis-server<\/p>\n<p><span class=\"token comment\"># CentOS \/ RHEL&#xff0c;\u9700\u8981\u5148\u88c5 EPEL \u6e90<\/span><br \/>\n<span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> epel-release<br \/>\n<span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> redis<\/p>\n<p>\u7528\u5305\u7ba1\u7406\u5668\u88c5\u5b8c\u4f1a\u81ea\u52a8\u6ce8\u518c systemd \u670d\u52a1&#xff0c;\u914d\u7f6e\u6587\u4ef6\u5728 \/etc\/redis\/redis.conf&#xff08;CentOS \u662f \/etc\/redis.conf&#xff09;\u3002<\/p>\n<h4>2.3 Docker \u4e00\u6761\u547d\u4ee4\u8d77\u4e00\u4e2a<\/h4>\n<p>\u672c\u5730\u5f00\u53d1\u3001\u4e34\u65f6\u9a8c\u8bc1\u573a\u666f&#xff0c;\u8fd9\u662f\u6700\u7701\u5fc3\u7684\u65b9\u5f0f&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;name<\/span> redis-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">6379<\/span>:6379 <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-v<\/span> redis-data:\/data <span class=\"token punctuation\">\\\\<\/span><br \/>\n  redis:7.2 <span class=\"token punctuation\">\\\\<\/span><br \/>\n  redis-server <span class=\"token parameter variable\">&#8211;appendonly<\/span> <span class=\"token function\">yes<\/span> <span class=\"token parameter variable\">&#8211;requirepass<\/span> <span class=\"token number\">123456<\/span><\/p>\n<p>\u51e0\u4e2a\u53c2\u6570\u503c\u5f97\u8bf4\u660e&#xff1a;-p \u628a\u5bb9\u5668\u7aef\u53e3\u6620\u5c04\u5230\u5bbf\u4e3b\u673a&#xff1b;-v \u6302\u4e00\u4e2a\u6570\u636e\u5377&#xff0c;\u5426\u5219\u5bb9\u5668\u5220\u4e86\u6570\u636e\u4e5f\u4e00\u8d77\u6ca1\u4e86&#xff1b;\u547d\u4ee4\u672b\u5c3e\u7684 &#8211;appendonly yes \u6253\u5f00 AOF \u6301\u4e45\u5316&#xff0c;&#8211;requirepass \u76f4\u63a5\u8bbe\u5bc6\u7801\u3002\u6ce8\u610f\u8fd9\u91cc\u7684\u5bc6\u7801\u5199\u5728\u542f\u52a8\u547d\u4ee4\u91cc&#xff0c;\u53ea\u9002\u5408\u5f00\u53d1\u73af\u5883&#xff0c;\u751f\u4ea7\u4e0a\u5e94\u8be5\u8d70\u914d\u7f6e\u6587\u4ef6\u6216\u5bc6\u94a5\u7ba1\u7406\u3002<\/p>\n<h3>\u4e09\u3001\u542f\u52a8\u3001\u5173\u95ed\u4e0e\u914d\u7f6e<\/h3>\n<h4>3.1 \u4e24\u79cd\u542f\u52a8\u65b9\u5f0f<\/h4>\n<p>\u524d\u53f0\u542f\u52a8&#xff08;\u8c03\u8bd5\u7528&#xff0c;\u5173\u6389\u7ec8\u7aef\u8fdb\u7a0b\u5c31\u7ed3\u675f&#xff09;&#xff1a;<\/p>\n<p>redis-server \/etc\/redis\/redis.conf<\/p>\n<p>\u6210\u529f\u540e\u4f1a\u770b\u5230\u4e00\u6bb5 ASCII \u56fe\u6848\u3001\u7248\u672c\u53f7\u3001\u76d1\u542c\u7aef\u53e3 6379&#xff0c;\u4ee5\u53ca Ready to accept connections\u3002<\/p>\n<p>systemd \u6258\u7ba1&#xff08;\u63a8\u8350\u7684\u957f\u671f\u8fd0\u884c\u65b9\u5f0f&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start redis-server<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> redis-server   <span class=\"token comment\"># \u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status redis-server<\/p>\n<h4>3.2 \u4e09\u79cd\u5173\u95ed\u65b9\u5f0f<\/h4>\n<p><span class=\"token comment\"># \u65b9\u5f0f\u4e00&#xff1a;\u5ba2\u6237\u7aef\u547d\u4ee4&#xff0c;\u4f1a\u89e6\u53d1\u4e00\u6b21\u4fdd\u5b58&#xff0c;\u6700\u4f18\u96c5<\/span><br \/>\nredis-cli <span class=\"token function\">shutdown<\/span><\/p>\n<p><span class=\"token comment\"># \u65b9\u5f0f\u4e8c&#xff1a;systemd<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl stop redis-server<\/p>\n<p><span class=\"token comment\"># \u65b9\u5f0f\u4e09&#xff1a;\u66b4\u529b\u6740\u8fdb\u7a0b&#xff0c;\u4e0d\u63a8\u8350&#xff0c;\u53ef\u80fd\u4e22\u6570\u636e<\/span><br \/>\n<span class=\"token function\">kill<\/span> <span class=\"token parameter variable\">-9<\/span> PID<\/p>\n<h4>3.3 redis.conf \u91cc\u65b0\u624b\u6700\u8be5\u5148\u770b\u7684\u4e94\u4e2a\u53c2\u6570<\/h4>\n<p># \u53ea\u76d1\u542c\u672c\u673a\u56de\u73af\u5730\u5740&#xff0c;\u6700\u5b89\u5168\u7684\u9ed8\u8ba4\u503c<br \/>\nbind 127.0.0.1 -::1<\/p>\n<p># \u76d1\u542c\u7aef\u53e3&#xff0c;\u4e5f\u662f redis-cli \u9ed8\u8ba4\u8fde\u63a5\u7684\u7aef\u53e3<br \/>\nport 6379<\/p>\n<p># \u662f\u5426\u4ee5\u540e\u53f0\u5b88\u62a4\u8fdb\u7a0b\u65b9\u5f0f\u8fd0\u884c<br \/>\ndaemonize no<\/p>\n<p># \u8bbf\u95ee\u5bc6\u7801&#xff0c;\u6ce8\u91ca\u6389\u8868\u793a\u4e0d\u9700\u8981\u5bc6\u7801<br \/>\nrequirepass yourStrongPassword<\/p>\n<p># \u4fdd\u62a4\u6a21\u5f0f&#xff0c;\u6ca1\u6709\u5bc6\u7801\u4e14\u5bf9\u5916\u66b4\u9732\u65f6\u7684\u4e00\u9053\u515c\u5e95\u9632\u7ebf<br \/>\nprotected-mode yes<\/p>\n<p>\u9010\u4e2a\u8bf4\u6e05\u695a&#xff1a;<\/p>\n<ul>\n<li>bind&#xff1a;\u9ed8\u8ba4\u53ea\u7ed1\u672c\u673a\u3002\u8981\u8ba9\u522b\u7684\u673a\u5668\u8fde\u8fc7\u6765&#xff0c;\u5fc5\u987b\u6539\u6210 bind 0.0.0.0&#xff0c;\u4f46\u8fd9\u7b49\u4e8e\u628a\u670d\u52a1\u66b4\u9732\u5230\u7f51\u7edc\u4e0a&#xff0c;\u52a1\u5fc5\u540c\u65f6\u8bbe\u7f6e requirepass\u3002\u66f4\u7a33\u59a5\u7684\u505a\u6cd5\u662f\u7ed1\u5185\u7f51\u7f51\u5361 IP\u3002<\/li>\n<li>port&#xff1a;\u6539\u6210\u975e 6379 \u53ef\u4ee5\u51cf\u5c11\u88ab\u626b\u63cf\u7684\u6982\u7387&#xff0c;\u6539\u5b8c\u5ba2\u6237\u7aef\u8981\u52a0 -p\u3002<\/li>\n<li>daemonize&#xff1a;\u81ea\u5df1\u624b\u52a8\u8dd1 redis-server \u65f6\u8bbe\u6210 yes \u53ef\u4ee5\u8ba9\u5b83\u8f6c\u5165\u540e\u53f0\u3002\u4f46\u7528 systemd \u6258\u7ba1\u65f6\u5e94\u8be5\u4fdd\u6301 no&#xff0c;\u56e0\u4e3a systemd \u672c\u8eab\u5c31\u5728\u7ba1\u540e\u53f0\u8fdb\u7a0b&#xff0c;daemonize yes \u4f1a\u8ba9\u5b83 fork \u51fa\u53bb&#xff0c;systemd \u8ffd\u8e2a\u4e0d\u5230\u4e3b\u8fdb\u7a0b&#xff0c;\u51fa\u73b0&#034;\u670d\u52a1\u663e\u793a\u542f\u52a8\u6210\u529f\u4f46\u5b9e\u9645\u5df2\u9000\u51fa&#034;\u7684\u8be1\u5f02\u73b0\u8c61\u3002<\/li>\n<li>requirepass&#xff1a;\u8bbe\u4e86\u4e4b\u540e\u6240\u6709\u5ba2\u6237\u7aef\u90fd\u5fc5\u987b\u5148\u8ba4\u8bc1\u3002\u914d\u7f6e\u91cc\u5982\u679c\u8fd8\u5199\u4e86 masterauth&#xff0c;\u4e3b\u4ece\u4e4b\u95f4\u4e5f\u8981\u4e00\u81f4\u3002<\/li>\n<li>protected-mode&#xff1a;\u8fd9\u662f Redis 3.2 \u5f15\u5165\u7684\u515c\u5e95\u673a\u5236\u3002\u5f53\u65e2\u6ca1\u6709\u8bbe\u5bc6\u7801\u3001\u53c8\u76d1\u542c\u4e86\u975e\u56de\u73af\u5730\u5740\u65f6&#xff0c;\u5b83\u4f1a\u62d2\u7edd\u5916\u90e8\u8fde\u63a5\u5e76\u8fd4\u56de\u4e00\u6bb5 DENIED \u63d0\u793a\u3002\u5b83\u662f&#034;\u9632\u5446&#034;\u800c\u4e0d\u662f&#034;\u9632\u62a4&#034;&#xff0c;\u6b63\u786e\u505a\u6cd5\u662f\u914d\u597d\u5bc6\u7801\u548c bind&#xff0c;\u800c\u4e0d\u662f\u7b80\u5355\u5730\u628a protected-mode no \u4e00\u5173\u4e86\u4e8b\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u7b2c\u4e00\u6b21\u7528 redis-cli \u8fde\u4e0a\u5e76\u9a8c\u8bc1<\/h3>\n<p>redis-cli \u6709\u4e24\u4e2a\u4f7f\u7528\u5f62\u6001&#xff1a;\u4ea4\u4e92\u5f0f&#xff08;\u8fdb\u53bb\u4e4b\u540e\u4e00\u76f4\u6572\u547d\u4ee4&#xff09;\u548c\u4e00\u6b21\u6027\u6267\u884c&#xff08;\u628a\u547d\u4ee4\u5f53\u53c2\u6570\u4f20\u8fdb\u53bb&#xff0c;\u7ed3\u679c\u6253\u5370\u5230\u6807\u51c6\u8f93\u51fa&#xff09;\u3002\u4e0b\u9762\u4e3b\u8981\u7528\u4ea4\u4e92\u5f0f\u3002<\/p>\n<h4>4.1 \u8fde\u63a5<\/h4>\n<p><span class=\"token comment\"># \u672c\u673a\u9ed8\u8ba4\u7aef\u53e3&#xff0c;\u76f4\u63a5\u8fdb<\/span><br \/>\nredis-cli<\/p>\n<p><span class=\"token comment\"># \u6307\u5b9a\u4e3b\u673a\u7aef\u53e3\u5bc6\u7801&#xff0c;\u5e76\u76f4\u63a5\u8fdb 0 \u53f7\u5e93<\/span><br \/>\nredis-cli <span class=\"token parameter variable\">-h<\/span> <span class=\"token number\">127.0<\/span>.0.1 <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">6379<\/span> <span class=\"token parameter variable\">-a<\/span> <span class=\"token number\">123456<\/span><\/p>\n<p>\u8fdb\u5165\u540e\u4f1a\u770b\u5230\u63d0\u793a\u7b26 127.0.0.1:6379&gt;&#xff0c;\u4ee3\u8868\u5df2\u8fde\u4e0a&#xff0c;\u5e76\u4e14\u9ed8\u8ba4\u5904\u4e8e 0 \u53f7\u5e93\u3002\u6ce8\u610f -a \u4f1a\u628a\u5bc6\u7801\u66b4\u9732\u5728 shell \u5386\u53f2\u548c ps \u8f93\u51fa\u91cc&#xff0c;Redis \u4e5f\u4f1a\u6253\u5370\u4e00\u884c\u544a\u8b66&#xff0c;\u751f\u4ea7\u73af\u5883\u5efa\u8bae\u6539\u7528 REDISCLI_AUTH \u73af\u5883\u53d8\u91cf\u3002<\/p>\n<h4>4.2 \u4f9d\u6b21\u9a8c\u8bc1\u8fd9\u51e0\u6761<\/h4>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> <span class=\"token function\">ping<\/span><br \/>\nPONG<\/p>\n<p>\u7528\u9014&#xff1a;\u6700\u7b80\u5355\u7684\u5b58\u6d3b\u63a2\u6d4b\u3002\u8fd4\u56de PONG \u8bf4\u660e\u8fde\u63a5\u901a\u4e86\u3002\u5982\u679c\u542f\u7528\u4e86\u5bc6\u7801\u800c\u6ca1\u8ba4\u8bc1&#xff0c;\u8fd9\u91cc\u4f1a\u8fd4\u56de (error) NOAUTH Authentication required.&#xff0c;\u5148\u6267\u884c auth 123456 \u5373\u53ef\u3002\u5199\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u65f6\u53ef\u4ee5\u7528 ping \u7684\u8fd4\u56de\u503c\u5224\u65ad\u3002<\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> <span class=\"token builtin class-name\">set<\/span> user:1:name <span class=\"token string\">&#034;tom&#034;<\/span><br \/>\nOK<br \/>\n<span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> get user:1:name<br \/>\n<span class=\"token string\">&#034;tom&#034;<\/span><br \/>\n<span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> get user:2:name<br \/>\n<span class=\"token punctuation\">(<\/span>nil<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u7528\u9014&#xff1a;\u5199\u5165\u548c\u8bfb\u53d6\u4e00\u4e2a key\u3002\u8fd4\u56de OK \u8868\u793a\u5199\u6210\u529f&#xff1b;\u53d6\u5230\u4e0d\u5b58\u5728 key \u65f6\u8fd4\u56de (nil) \u800c\u4e0d\u662f\u62a5\u9519&#xff0c;\u5199\u4ee3\u7801\u65f6\u4e0d\u8981\u628a nil \u5f53\u6210\u5f02\u5e38\u3002\u6ce8\u610f key \u540d\u662f\u533a\u5206\u5927\u5c0f\u5199\u7684&#xff0c;User:1 \u548c user:1 \u662f\u4e24\u4e2a\u4e0d\u540c\u7684 key&#xff1b;\u547d\u4ee4\u540d\u672c\u8eab\u5219\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u3002<\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> keys user:*<br \/>\n<span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token string\">&#034;user:1:name&#034;<\/span><\/p>\n<p>\u7528\u9014&#xff1a;\u6309\u901a\u914d\u7b26\u67e5\u770b\u5f53\u524d\u5e93\u91cc\u6709\u54ea\u4e9b key&#xff0c;\u6392\u67e5\u6570\u636e\u6709\u6ca1\u6709\u5199\u8fdb\u53bb\u65f6\u5f88\u65b9\u4fbf\u3002\u4f46\u8fd9\u6761\u547d\u4ee4\u8981\u614e\u7528&#xff1a;\u5b83\u662f\u5168\u91cf\u626b\u63cf&#xff0c;key \u6570\u91cf\u4e00\u591a\u5c31\u4f1a\u963b\u585e\u6574\u4e2a\u5b9e\u4f8b&#xff0c;\u751f\u4ea7\u73af\u5883\u4e25\u7981\u6267\u884c keys *\u3002\u9700\u8981\u904d\u5386\u65f6\u6539\u7528 scan \u6e38\u6807\u5206\u6279\u53d6\u3002<\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> dbsize<br \/>\n<span class=\"token punctuation\">(<\/span>integer<span class=\"token punctuation\">)<\/span> <span class=\"token number\">1<\/span><\/p>\n<p>\u7528\u9014&#xff1a;\u8fd4\u56de\u5f53\u524d\u5e93\u91cc key \u7684\u603b\u6570\u3002\u8fd4\u56de\u7c7b\u578b\u5e26 (integer) \u524d\u7f00&#xff0c;\u8bf4\u660e Redis \u7684\u56de\u590d\u662f\u5206\u7c7b\u578b\u7684&#xff08;\u5b57\u7b26\u4e32\u3001\u6574\u6570\u3001\u6570\u7ec4\u3001\u9519\u8bef\u3001nil&#xff09;\u3002\u5982\u679c\u5e0c\u671b\u8f93\u51fa\u66f4\u9002\u5408\u5582\u7ed9\u811a\u672c&#xff0c;\u53ef\u4ee5\u52a0 &#8211;raw&#xff1a;<\/p>\n<p>redis-cli <span class=\"token parameter variable\">&#8211;raw<\/span> dbsize<br \/>\n<span class=\"token number\">1<\/span><\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> <span class=\"token keyword\">select<\/span> <span class=\"token number\">1<\/span><br \/>\nOK<br \/>\n<span class=\"token number\">127.0<\/span>.0.1:6379<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> dbsize<br \/>\n<span class=\"token punctuation\">(<\/span>integer<span class=\"token punctuation\">)<\/span> <span class=\"token number\">0<\/span><br \/>\n<span class=\"token number\">127.0<\/span>.0.1:6379<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token keyword\">select<\/span> <span class=\"token number\">0<\/span><br \/>\nOK<br \/>\n<span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span><\/p>\n<p>\u7528\u9014&#xff1a;\u5207\u6362\u6570\u636e\u5e93\u3002Redis \u9ed8\u8ba4\u6709 16 \u4e2a\u5e93&#xff08;\u7f16\u53f7 0~15&#xff09;&#xff0c;\u5207\u6362\u6210\u529f\u540e\u63d0\u793a\u7b26\u4f1a\u591a\u51fa [1] \u8fd9\u6837\u7684\u6807\u8bb0&#xff0c;\u4e00\u773c\u5c31\u80fd\u770b\u51fa\u5f53\u524d\u5728\u54ea\u4e2a\u5e93\u3002\u8fd9\u91cc\u7684\u5e93\u53ea\u662f\u547d\u540d\u7a7a\u95f4\u9694\u79bb&#xff0c;\u4e0d\u662f\u5206\u7247&#xff0c;\u591a\u4e2a\u5e93\u5171\u7528\u540c\u4e00\u4e2a\u5355\u7ebf\u7a0b&#xff0c;\u522b\u628a\u5b83\u5f53\u6210\u9694\u79bb\u6545\u969c\u7684\u624b\u6bb5\u3002\u53e6\u5916 select \u53ea\u5f71\u54cd\u5f53\u524d\u8fd9\u4e2a\u8fde\u63a5\u3002<\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> info server<br \/>\n<span class=\"token comment\"># Server<\/span><br \/>\nredis_version:7.2.4<br \/>\nredis_mode:standalone<br \/>\nos:Linux <span class=\"token number\">5.15<\/span>.0-91-generic x86_64<br \/>\ntcp_port:6379<br \/>\nuptime_in_seconds:132<\/p>\n<p>\u7528\u9014&#xff1a;\u67e5\u770b\u8fd0\u884c\u72b6\u6001\u3002\u4e0d\u5e26\u53c2\u6570\u4f1a\u8f93\u51fa\u5168\u90e8\u4fe1\u606f&#xff0c;\u4fe1\u606f\u91cf\u5f88\u5927&#xff1b;\u5efa\u8bae\u6309\u6bb5\u67e5\u770b&#xff0c;\u6bd4\u5982 info server \u770b\u7248\u672c\u548c\u8fd0\u884c\u6a21\u5f0f\u3001info memory \u770b\u5185\u5b58\u5360\u7528\u3001info clients \u770b\u5f53\u524d\u8fde\u63a5\u6570\u3001info stats \u770b\u547d\u4e2d\u7387\u3002\u6392\u67e5&#034;\u5185\u5b58\u600e\u4e48\u6da8\u8fd9\u4e48\u5feb&#034;\u65f6&#xff0c;used_memory_human \u548c mem_fragmentation_ratio \u662f\u6700\u5148\u8be5\u770b\u7684\u4e24\u9879\u3002<\/p>\n<p><span class=\"token number\">127.0<\/span>.0.1:637<span class=\"token operator\"><span class=\"token file-descriptor important\">9<\/span>&gt;<\/span> <span class=\"token function\">shutdown<\/span><br \/>\nnot connected<span class=\"token operator\">&gt;<\/span><\/p>\n<p>\u7528\u9014&#xff1a;\u5173\u505c\u670d\u52a1\u7aef\u3002\u6267\u884c\u540e\u5f53\u524d\u8fde\u63a5\u4f1a\u88ab\u670d\u52a1\u7aef\u65ad\u5f00&#xff0c;\u63d0\u793a\u7b26\u53d8\u6210 not connected&gt;&#xff0c;\u8fd9\u5c5e\u4e8e\u6b63\u5e38\u73b0\u8c61&#xff0c;\u4e0d\u662f\u62a5\u9519\u3002shutdown \u9ed8\u8ba4\u4f1a\u5728\u9000\u51fa\u524d\u4fdd\u5b58\u4e00\u6b21 RDB \u5feb\u7167&#xff1b;\u5982\u679c\u53ea\u662f\u60f3\u65ad\u5f00\u5ba2\u6237\u7aef\u800c\u8ba9\u670d\u52a1\u7aef\u7ee7\u7eed\u8dd1&#xff0c;\u5e94\u8be5\u6309 Ctrl&#043;C \u6216\u8005\u8f93\u5165 quit\u3002<\/p>\n<h4>4.3 \u4e0d\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\u76f4\u63a5\u7528<\/h4>\n<p>\u6392\u67e5\u95ee\u9898\u65f6\u7ecf\u5e38\u53ea\u9700\u8981\u8dd1\u4e00\u6761\u547d\u4ee4&#xff0c;\u8fd9\u65f6\u4e0d\u5fc5\u8fdb\u4ea4\u4e92\u6a21\u5f0f&#xff1a;<\/p>\n<p>redis-cli <span class=\"token function\">ping<\/span><br \/>\nredis-cli <span class=\"token parameter variable\">-a<\/span> <span class=\"token number\">123456<\/span> <span class=\"token builtin class-name\">set<\/span> weather sunny<br \/>\nredis-cli <span class=\"token parameter variable\">-a<\/span> <span class=\"token number\">123456<\/span> get weather<br \/>\nredis-cli <span class=\"token parameter variable\">-r<\/span> <span class=\"token number\">5<\/span> incr page:view     <span class=\"token comment\"># \u8fde\u8dd1 5 \u6b21<\/span><br \/>\nredis-cli <span class=\"token parameter variable\">&#8211;stat<\/span>                   <span class=\"token comment\"># \u6bcf\u79d2\u5237\u65b0\u4e00\u6b21\u8fd0\u884c\u6307\u6807<\/span><\/p>\n<p>-r \u6307\u5b9a\u6267\u884c\u6b21\u6570&#xff0c;\u914d\u5408 -i \u8fd8\u80fd\u6307\u5b9a\u95f4\u9694\u79d2\u6570&#xff0c;\u6bd4\u5982 -r -1 -i 1 info memory \u53ef\u4ee5\u4e00\u76f4\u5faa\u73af\u8f93\u51fa\u5185\u5b58\u4fe1\u606f\u3002&#8211;stat \u4f1a\u6301\u7eed\u6253\u5370 keys\u3001\u5185\u5b58\u3001\u8fde\u63a5\u6570\u3001\u8bf7\u6c42\u6570\u7b49\u589e\u91cf\u6307\u6807&#xff0c;\u6bd4\u53cd\u590d\u6572 info \u76f4\u89c2\u5f97\u591a\u3002<\/p>\n<h3>\u4e94\u3001\u5e38\u89c1\u542f\u52a8\u62a5\u9519\u4e0e\u6392\u67e5<\/h3>\n<p>1&#xff09;DENIED Redis is running in protected mode&#8230;<\/p>\n<p>\u8fde\u63a5\u88ab\u62d2&#xff0c;\u4e14\u63d0\u793a\u91cc\u5e26 protected-mode\u3002\u539f\u56e0\u662f\u6ca1\u8bbe\u5bc6\u7801\u53c8\u5bf9\u5916\u76d1\u542c\u3002\u6b63\u786e\u89e3\u6cd5\u662f\u4e8c\u9009\u4e00&#xff1a;\u8bbe\u7f6e requirepass \u5e76\u628a bind \u6536\u7a84\u5230\u5185\u7f51\u5730\u5740&#xff0c;\u6216\u8005\u8001\u8001\u5b9e\u5b9e\u4ece\u672c\u673a\u8fde\u3002\u4e0d\u8981\u4e3a\u4e86\u56fe\u5feb\u76f4\u63a5\u5173\u6389\u4fdd\u62a4\u6a21\u5f0f\u3002<\/p>\n<p>2&#xff09;(error) NOAUTH Authentication required.<\/p>\n<p>\u670d\u52a1\u7aef\u8981\u6c42\u5bc6\u7801&#xff0c;\u800c\u5ba2\u6237\u7aef\u6ca1\u8ba4\u8bc1\u3002\u4e34\u65f6\u529e\u6cd5\u662f\u5728\u4ea4\u4e92\u6a21\u5f0f\u91cc\u6267\u884c auth \u4f60\u7684\u5bc6\u7801&#xff1b;\u957f\u671f\u529e\u6cd5\u662f\u8fde\u63a5\u65f6\u5e26 -a&#xff0c;\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf REDISCLI_AUTH\u3002\u987a\u5e26\u4e00\u63d0&#xff0c;requirepass \u6539\u5b8c\u4e4b\u540e\u5fc5\u987b\u91cd\u542f\u6216\u6267\u884c config rewrite \u624d\u5bf9\u5916\u751f\u6548&#xff0c;\u6539\u5b8c\u5fd8\u4e86\u91cd\u542f\u662f\u6700\u5e38\u89c1\u7684&#034;\u5bc6\u7801\u660e\u660e\u8bbe\u4e86\u5374\u6ca1\u751f\u6548&#034;\u3002<\/p>\n<p>3&#xff09;Could not connect to Redis at 127.0.0.1:6379: Connection refused<\/p>\n<p>\u670d\u52a1\u7aef\u6839\u672c\u6ca1\u5728\u8dd1&#xff0c;\u6216\u8005\u4e0d\u5728\u8fd9\u4e2a\u5730\u5740\u7aef\u53e3\u4e0a\u3002\u6392\u67e5\u987a\u5e8f&#xff1a;ps -ef | grep redis \u770b\u8fdb\u7a0b\u5728\u4e0d\u5728 \u2192 ss -lntp | grep 6379 \u770b\u7aef\u53e3\u6709\u6ca1\u6709\u76d1\u542c \u2192 \u68c0\u67e5 bind \u548c port \u914d\u7f6e\u662f\u5426\u548c\u4f60\u8fde\u7684\u4e00\u81f4\u3002<\/p>\n<p>4&#xff09;Could not create server TCP listening socket *:6379: bind: Address already in use<\/p>\n<p>\u7aef\u53e3\u88ab\u5360\u7528&#xff0c;\u901a\u5e38\u662f\u4e0a\u4e00\u6b21\u7684 Redis \u6ca1\u9000\u5e72\u51c0\u3002\u5148\u627e\u51fa\u5360\u7528\u8005&#xff1a;<\/p>\n<p>ss <span class=\"token parameter variable\">-lntp<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token number\">6379<\/span>     <span class=\"token comment\"># \u6216 netstat -tlnp | grep 6379<\/span><\/p>\n<p>\u786e\u8ba4\u662f\u65e7\u5b9e\u4f8b\u540e\u6b63\u5e38\u5173\u6389\u5b83&#xff0c;\u6216\u8005\u6539\u914d\u7f6e\u6587\u4ef6\u91cc\u7684 port \u6362\u4e00\u4e2a\u7aef\u53e3\u3002\u522b\u4e0a\u6765\u5c31 kill -9&#xff0c;\u5bb9\u6613\u4e22\u6570\u636e\u3002<\/p>\n<p>5&#xff09;\u542f\u52a8\u6210\u529f\u4f46\u8fde\u63a5\u8d85\u65f6<\/p>\n<p>\u8fdb\u7a0b\u6d3b\u7740\u3001\u7aef\u53e3\u4e5f\u5728\u76d1\u542c&#xff0c;\u4f46\u5ba2\u6237\u7aef\u8fde\u4e0d\u4e0a&#xff0c;\u4e00\u822c\u662f\u9632\u706b\u5899\u6216\u5b89\u5168\u7ec4\u6ca1\u653e\u884c\u3002\u4e91\u670d\u52a1\u5668\u4e0a\u8981\u540c\u65f6\u68c0\u67e5\u7cfb\u7edf\u9632\u706b\u5899\u548c\u5b89\u5168\u7ec4\u89c4\u5219\u3002\u5982\u679c bind \u53ea\u5199\u4e86 127.0.0.1&#xff0c;\u90a3\u5916\u90e8\u65e0\u8bba\u5982\u4f55\u90fd\u8fde\u4e0d\u8fdb\u6765&#xff0c;\u8fd9\u70b9\u8981\u5148\u786e\u8ba4\u3002<\/p>\n<p>6&#xff09;daemonize \u548c systemd \u6253\u67b6<\/p>\n<p>\u73b0\u8c61\u662f systemctl start \u663e\u793a\u6210\u529f&#xff0c;\u4f46 systemctl status \u7acb\u523b\u53d8\u6210 inactive\u3002\u56e0\u4e3a daemonize yes \u4f1a\u8ba9 Redis fork \u5230\u540e\u53f0&#xff0c;systemd \u8ba4\u4e3a\u4e3b\u8fdb\u7a0b\u5df2\u7ecf\u9000\u51fa\u3002\u7528 systemd \u6258\u7ba1\u65f6\u628a daemonize \u8bbe\u4e3a no&#xff0c;\u8ba9 systemd \u81ea\u5df1\u7ba1\u524d\u540e\u53f0\u3002<\/p>\n<p>7&#xff09;\u6539\u5b8c\u914d\u7f6e\u6ca1\u751f\u6548<\/p>\n<p>Redis \u8bfb\u7684\u662f\u4f60\u542f\u52a8\u65f6\u6307\u5b9a\u7684\u90a3\u4efd\u914d\u7f6e\u6587\u4ef6&#xff0c;\u8def\u5f84\u5199\u9519\u5c31\u4f1a\u7528\u5185\u7f6e\u9ed8\u8ba4\u503c\u3002\u542f\u52a8\u65f6\u7528 redis-server \/etc\/redis\/redis.conf \u663e\u5f0f\u6307\u5b9a\u8def\u5f84&#xff0c;\u542f\u52a8\u65e5\u5fd7\u7684\u7b2c\u4e8c\u884c\u4f1a\u6253\u5370\u5b9e\u9645\u52a0\u8f7d\u7684\u914d\u7f6e\u6587\u4ef6\u540d&#xff0c;\u5bf9\u4e0d\u4e0a\u5c31\u8bf4\u660e\u8def\u5f84\u9519\u4e86\u3002<\/p>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>\u8fd9\u4e00\u7bc7\u6211\u4eec\u628a Redis \u7684\u5b9a\u4f4d\u8bb2\u6e05\u4e86&#xff1a;\u5b83\u662f\u9760\u5185\u5b58\u548c\u7f51\u7edc\u63d0\u4f9b key-value \u8bfb\u5199\u80fd\u529b\u7684\u670d\u52a1&#xff0c;\u64c5\u957f\u7f13\u5b58\u3001\u5206\u5e03\u5f0f\u9501\u3001\u8ba1\u6570\u5668\u548c\u6392\u884c\u699c&#xff0c;\u548c MySQL \u7684\u5206\u5de5\u662f&#034;\u70ed\u70b9\u52a0\u901f&#034;\u4e0e&#034;\u5168\u91cf\u53ef\u9760&#034;&#xff1b;\u63a5\u7740\u8d70\u5b8c\u4e86\u6e90\u7801\u3001\u5305\u7ba1\u7406\u5668\u3001Docker \u4e09\u6761\u5b89\u88c5\u8def\u7ebf&#xff0c;\u7406\u6e05\u4e86 bind\u3001port\u3001daemonize\u3001requirepass\u3001protected-mode \u8fd9\u4e94\u4e2a\u5148\u8981\u5f04\u660e\u767d\u7684\u914d\u7f6e&#xff0c;\u6700\u540e\u7528 ping\u3001set\/get\u3001keys\u3001dbsize\u3001select\u3001info\u3001shutdown \u5b8c\u6210\u4e86\u4e00\u8f6e\u771f\u5b9e\u9a8c\u8bc1&#xff0c;\u5e76\u8986\u76d6\u4e86\u51e0\u7c7b\u5178\u578b\u62a5\u9519\u3002<\/p>\n<p>\u73b0\u5728\u4f60\u624b\u91cc\u6709\u4e86\u4e00\u4e2a\u80fd\u8fde\u4e0a\u7684 Redis&#xff0c;\u4f46\u5f80\u91cc\u5b58\u4e1c\u897f\u8fd8\u53ea\u4f1a\u7528 set \u548c get\u3002key \u5230\u5e95\u80fd\u8bbe\u8ba1\u6210\u4ec0\u4e48\u6837\u3001\u9664\u4e86\u5b57\u7b26\u4e32\u8fd8\u80fd\u5b58\u54ea\u4e9b\u7ed3\u6784\u3001\u4ec0\u4e48\u573a\u666f\u8be5\u7528\u54ea\u79cd\u7ed3\u6784&#xff0c;\u8fd9\u4e9b\u662f\u4e0b\u4e00\u6b65\u771f\u6b63\u8981\u89e3\u51b3\u7684\u95ee\u9898\u2014\u2014\u4e0b\u4e00\u7bc7\u6211\u4eec\u770b Redis \u7684\u4e94\u5927\u6570\u636e\u7c7b\u578b&#xff0c;\u4ee5\u53ca\u6bcf\u4e2a\u7c7b\u578b\u6700\u5e38\u7528\u3001\u6700\u5bb9\u6613\u8e29\u5751\u7684\u90a3\u51e0\u6761\u547d\u4ee4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; \u6211\u4e0d\u4f1a\u8d77\u540d\u5b57322  \u6280\u672f\u6808\u5b66\u4e60\u7b14\u8bb0  \u529b\u6263Hot100\u9898\u76ee\u89e3\u6790  Go\u9879\u76ee\u5b66\u4e60\u7b14\u8bb0 &lt; \u6587\u7ae0\u76ee\u5f55Redis \u5165\u95e8&#xff08;\u4e00&#xff09;&#xff1a;Redis \u662f\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83\u4e00\u3001Redis \u5230\u5e95\u662f\u4ec0\u4e481.1 \u4e00\u53e5\u8bdd\u5b9a\u4f4d1.2 \u5b83\u4e0d\u662f MySQL \u7684\u66ff<\/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":[3470,27,58,105,2879],"topic":[],"class_list":["post-113738","post","type-post","status-publish","format-standard","hentry","category-server","tag-cli","tag-docker","tag-linux","tag-redis","tag-2879"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \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\/113738.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; \u6211\u4e0d\u4f1a\u8d77\u540d\u5b57322 \u6280\u672f\u6808\u5b66\u4e60\u7b14\u8bb0 \u529b\u6263Hot100\u9898\u76ee\u89e3\u6790 Go\u9879\u76ee\u5b66\u4e60\u7b14\u8bb0 &lt; \u6587\u7ae0\u76ee\u5f55Redis \u5165\u95e8&#xff08;\u4e00&#xff09;&#xff1a;Redis \u662f\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83\u4e00\u3001Redis \u5230\u5e95\u662f\u4ec0\u4e481.1 \u4e00\u53e5\u8bdd\u5b9a\u4f4d1.2 \u5b83\u4e0d\u662f MySQL \u7684\u66ff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113738.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T02:41:11+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113738.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113738.html\",\"name\":\"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-07T02:41:11+00:00\",\"dateModified\":\"2026-10-07T02:41:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113738.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113738.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113738.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83\"}]},{\"@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 \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \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\/113738.html","og_locale":"zh_CN","og_type":"article","og_title":"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e2a\u4eba\u4e3b\u9875&#xff1a;&gt; \u6211\u4e0d\u4f1a\u8d77\u540d\u5b57322 \u6280\u672f\u6808\u5b66\u4e60\u7b14\u8bb0 \u529b\u6263Hot100\u9898\u76ee\u89e3\u6790 Go\u9879\u76ee\u5b66\u4e60\u7b14\u8bb0 &lt; \u6587\u7ae0\u76ee\u5f55Redis \u5165\u95e8&#xff08;\u4e00&#xff09;&#xff1a;Redis \u662f\u4ec0\u4e48&#xff0c;\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83\u4e00\u3001Redis \u5230\u5e95\u662f\u4ec0\u4e481.1 \u4e00\u53e5\u8bdd\u5b9a\u4f4d1.2 \u5b83\u4e0d\u662f MySQL \u7684\u66ff","og_url":"https:\/\/www.wsisp.com\/helps\/113738.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-07T02:41:11+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113738.html","url":"https:\/\/www.wsisp.com\/helps\/113738.html","name":"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-07T02:41:11+00:00","dateModified":"2026-10-07T02:41:11+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113738.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113738.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113738.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Redis \u5165\u95e8\uff08\u4e00\uff09\uff1aRedis \u662f\u4ec0\u4e48\uff0c\u4e3a\u4ec0\u4e48\u540e\u7aef\u90fd\u79bb\u4e0d\u5f00\u5b83"}]},{"@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\/113738","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=113738"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113738\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113738"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}