{"id":10020579,"date":"2024-12-31T17:19:53","date_gmt":"2024-12-31T09:19:53","guid":{"rendered":"https:\/\/itmax.cn\/?p=10020579"},"modified":"2024-12-31T17:19:53","modified_gmt":"2024-12-31T09:19:53","slug":"redis-%e7%88%86%e9%ab%98%e5%8d%b1%e6%bc%8f%e6%b4%9e%ef%bc%8c%e8%af%b7%e9%80%9f%e5%ba%a6%e4%bf%ae%e5%a4%8d%e3%80%82%e3%80%82","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10020579","title":{"rendered":"Redis \u7206\u9ad8\u5371\u6f0f\u6d1e\uff0c\u8bf7\u901f\u5ea6\u4fee\u590d\u3002\u3002"},"content":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662fR\u54e5\u3002<\/p>\n<p>\u4eca\u5929\u4e00\u65e9\u6536\u5230\u4e86\u817e\u8baf\u4e91\u7ed9\u6211\u7684\u3010<strong>\u4e3b\u673a\u5b89\u5168<\/strong>\u3011\u6f0f\u6d1e\u901a\u77e5\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"298\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdfSMy\" alt=\"\" title=\"\"><\/p>\n<p>\u597d\u5bb6\u4f19\uff0c\u5927\u540d\u9f0e\u9f0e\u7684 Redis \u7206\u9ad8\u5371\u6f0f\u6d1e\u4e86\uff0cR\u54e5\u7684\u9898\u5e93\u300c<a href=\"https:\/\/link.segmentfault.com\/?enc=Yxpm6kjJmmwHkTGopyaqFg%3D%3D.wdL7q5sf0Bfddo1gwbk6BdeksPbqN33znvhezZfXrSE%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Java\u9762\u8bd5\u5e93<\/a>\u300d\u4e5f\u7528\u5230\u4e86 Redis \u6765\u7f13\u5b58\u9762\u8bd5\u9898\u5185\u5bb9\uff0c\u6240\u4ee5\u8fd9\u4e00\u4e0b\u5b50\u5c31\u5f15\u8d77\u4e86\u6211\u7684\u8b66\u60d5\uff0c\u8d76\u7d27\u770b\u770b\u4ec0\u4e48\u9b3c\u3002<\/p>\n<h2>\u6f0f\u6d1e\u63cf\u8ff0<\/h2>\n<p>\u4e0b\u9762\u662f\u6f0f\u6d1e\u63cf\u8ff0\u548c\u4fee\u590d\u8bf4\u660e\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=aV1hS0Ve4dv4gI%2FHrQCylA%3D%3D.ge6XTt0Vq7xELtHNNB96qzAFV47yrem%2FwIBHUPugt0IwXBm2EHmpXtrteEYxBXAYdvNxiTId%2BkRab4J%2BSRTkaiIe4fYtDn5hsbaULN2qQHQ%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/github.com\/redis\/redis\/security\/advisories\/GHSA-whxg-wx83-85p5<\/a><\/p><\/blockquote>\n<p><img decoding=\"async\" width=\"723\" height=\"343\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdfSMB\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u8fd9\u6b21\u7684\u6f0f\u6d1e\u662f\u56e0\u4e3a Lua \u5e93\u5f15\u8d77\u7684\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u4f7f\u7528\u7279\u5236\u7684 Lua \u811a\u672c\u6765\u89e6\u53d1\u5806\u6808\u7f13\u51b2\u533a\u6ea2\u51fa\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u300c<strong>\u8fdc\u7a0b\u4ee3\u7801\u6267\u884c<\/strong>\u300d\u6f0f\u6d1e\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u6240\u6709\u5e26\u6709 Lua \u811a\u672c\u7684 Redis \u7248\u672c\uff08<strong>\/&gt;= 2.8.18<\/strong>\uff09\u90fd\u5b58\u5728\u8be5\u6f0f\u6d1e\uff0c\u8d76\u7d27\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u67e5\u770b\u4e0b\u4f60\u7684 Redis \u7248\u672c\u53f7\uff1a<\/p>\n<blockquote><p>$ redis-cli &#8211;version<br \/>redis-cli 7.2.5<\/p><\/blockquote>\n<p>\u6211\u4f7f\u7528\u7684\u662f Redis 7.2.5\uff0c\u4e5f\u662f\u53d7\u5f71\u54cd\u7684\u7248\u672c\u3002<\/p>\n<blockquote>\n<p><strong>Lua \u626b\u76f2\uff1a<\/strong><\/p>\n<p>Lua \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u811a\u672c\u8bed\u8a00\uff0cRedis \u4e2d\u5185\u7f6e\u4e86 Lua \u529f\u80fd\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c Lua \u811a\u672c\u3002\u56e0\u4e3a Redis \u7684\u57fa\u672c\u64cd\u4f5c\u90fd\u662f\u5355\u4e2a\u547d\u4ee4\uff0c\u4f46\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u591a\u4e2a\u64cd\u4f5c\u7ec4\u5408\u6210\u4e8b\u52a1\u6216\u6267\u884c\u590d\u6742\u7684\u903b\u8f91\uff0c\u8fd9\u65f6\u5019 Lua \u811a\u672c\u5c31\u6d3e\u4e0a\u7528\u573a\u4e86\uff0c\u4f7f\u7528 Lua \u811a\u672c\u53ef\u4ee5\u5927\u5927\u51cf\u5c11\u7f51\u7edc\u5f00\u9501\u3002<\/p>\n<p>\u8bf4\u5230 Lua \u5c31\u4e0d\u5f97\u4e0d\u63d0 OpenResty\uff0c\u5b83\u662f\u4e00\u4e2a\u57fa\u4e8e Nginx \u7684\u9ad8\u6027\u80fd Web \u7ec4\u4ef6\uff0c\u5176\u652f\u6301\u7528 Lua \u7f16\u5199\u590d\u6742\u903b\u8f91\uff0c\u5e76\u63d0\u4e86\u8bb8\u591a\u7cbe\u5fc3\u7f16\u5199\u7684 Lua \u6a21\u5757\uff0c\u8fd9\u5c31\u662f\u5b83\u6700\u5927\u7684\u4eae\u70b9\u3002<\/p>\n<\/blockquote>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<h3>\u5347\u7ea7\u6700\u65b0\u5b89\u5168\u7248\u672c<\/h3>\n<p>Redis \u5b98\u65b9\u53d1\u5e03\u4e86 3 \u4e2a\u6f0f\u6d1e\u8865\u4e01\u53ca\u4fee\u590d\u7248\u672c\uff1a<strong>6.2.16, 7.2.6, 7.4.1<\/strong>\uff0c\u8bf7\u8bc4\u4f30\u4e1a\u52a1\u662f\u5426\u53d7\u5f71\u54cd\u540e\uff0c\u518d\u914c\u60c5\u5347\u7ea7\u81f3\u5b89\u5168\u7248\u672c\uff0c\u5982\u679c\u662f 5.x \u53ca\u4ee5\u4e0b\u7684\u7248\u672c\u5c31\u4e0d\u53d7\u652f\u6301\u4e86\u3002<\/p>\n<blockquote><p>\u7248\u672c\u5347\u7ea7\u524d\uff0c\u5efa\u8bae\u5927\u5bb6\u505a\u597d\u6570\u636e\u5907\u4efd\u64cd\u4f5c\uff0c<strong>\u4e91\u670d\u52a1\u5347\u7ea7\u7248\u672c\u524d\u6700\u597d\u5148\u5236\u4f5c\u955c\u50cf\/\u5feb\u7167<\/strong>\uff0c\u907f\u514d\u5347\u7ea7\u4e0d\u5f53\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u60c5\u51b5\u3002<\/p><\/blockquote>\n<h3>\u4e34\u65f6\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>1\u3001\u5f00\u653e\u6307\u5b9a IP \u5730\u5740<\/h4>\n<p>\u5982\u679c\u4f7f\u7528\u7684\u662f\u4e91\u670d\u52a1\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e91\u4e0a\u7684\u5b89\u5168\u7ec4\u5bf9 Redis \u7aef\u53e3\uff08\u9ed8\u8ba4\uff1a<strong>6379<\/strong>\uff09\u8bbe\u7f6e\u53ea\u5bf9\u6307\u5b9a\u7684 IP \u5730\u5740\u5f00\u653e\uff0c\u5982\u793a\u4f8b\u6240\u793a\uff1a<\/p>\n<p><img decoding=\"async\" width=\"723\" height=\"328\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdfSMC\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<blockquote><p>\u6ce8\u610f\uff0c\u6765\u6e90\u8fd9\u4e00\u9879\u4e0d\u8981\u518d\u52fe\u9009\u5168\u90e8 IP \u5730\u5740\u3002<\/p><\/blockquote>\n<h4>2\u3001\u8bbe\u7f6e\u5bc6\u7801\u8bbf\u95ee<\/h4>\n<p>\u5f3a\u5236\u5bf9 Redis \u5b9e\u4f8b\u7684\u6240\u6709\u8bbf\u95ee\u4f7f\u7528\u51ed\u636e\uff0c\u8fd9\u4e2a\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e Redis \u7684 <code>requirepass<\/code> \u53c2\u6570\u6765\u8bbe\u7f6e\u8bbf\u95ee\u5bc6\u7801\uff0c\u4fee\u6539 Redis.conf \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>requirepass XXX<\/code><\/pre>\n<p>\u914d\u7f6e\u5bc6\u7801\u540e\uff0c\u5c31\u4f1a\u5f3a\u5236\u6240\u6709\u8bbf\u95ee Redis \u7684\u5ba2\u6237\u7aef\u4f7f\u7528\u5bc6\u7801\uff0c\u76f8\u4fe1\u73b0\u5728\u6ca1\u4eba\u8fd8\u5728\u4f7f\u7528 Redis \u88f8\u5954\u5427\uff1f<\/p>\n<h4>3\u3001\u8bbe\u7f6e\u7528\u6237\u6743\u9650<\/h4>\n<p>\u8bbe\u7f6e\u7528\u6237\u6743\u9650\uff0c\u4ec5\u5141\u8bb8\u53d7\u4fe1\u4efb\u7684\u8eab\u4efd\u8fd0\u884c Lua \u811a\u672c\u6216\u4efb\u4f55\u5176\u4ed6\u6f5c\u5728\u5371\u9669\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u5728 Redis \u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7 <strong>ACL\uff08\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff09<\/strong> \u529f\u80fd\u8bbe\u7f6e\u7528\u6237\u6743\u9650\uff0c\u4ece\u800c\u9650\u5236\u7279\u5b9a\u7528\u6237\u53ea\u80fd\u8fd0\u884c\u53d7\u4fe1\u4efb\u7684\u547d\u4ee4\uff0c\u5982\uff1a<strong>\u7981\u6b62\u8fd0\u884c Lua \u811a\u672c\u6216\u5176\u4ed6\u6f5c\u5728\u5371\u9669\u7684\u547d\u4ee4<\/strong>\u3002<\/p>\n<blockquote><p>\u6ce8\u610f\uff0cACL \u529f\u80fd\u5728 Redis <strong>6.0+<\/strong> \u7248\u672c\u4e2d\u624d\u652f\u6301\uff0c\u5982\u679c\u7248\u672c\u8f83\u4f4e\uff0c\u8bf7\u5148\u5347\u7ea7 Redis\u3002<\/p><\/blockquote>\n<hr>\n<p>\u6700\u540e\uff0c\u8d76\u7d27\u68c0\u67e5 Redis \u7248\u672c\u5e76\u4fee\u590d\u5427\uff0c\u786e\u4fdd\u7cfb\u7edf\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<blockquote><p><strong>\u7248\u6743\u58f0\u660e\uff1a<\/strong> \u672c\u6587\u7cfb\u516c\u4f17\u53f7 &#8220;Java\u6280\u672f\u6808&#8221; \u539f\u521b\uff0c\u8f6c\u8f7d\u3001\u5f15\u7528\u672c\u6587\u5185\u5bb9\u8bf7\u6ce8\u660e\u51fa\u5904\uff0c\u6284\u88ad\u3001\u6d17\u7a3f\u4e00\u5f8b\u6295\u8bc9\u4fb5\u6743\uff0c\u540e\u679c\u81ea\u8d1f\uff0c\u5e76\u4fdd\u7559\u8ffd\u7a76\u5176\u6cd5\u5f8b\u8d23\u4efb\u7684\u6743\u5229\u3002<\/p><\/blockquote>\n<p><strong>\u66f4\u591a\u6587\u7ae0\u63a8\u8350\uff1a<\/strong><\/p>\n<p>1.<a href=\"https:\/\/link.segmentfault.com\/?enc=zsEQBRx8ZjyqBs009MAbGQ%3D%3D.35tP0rqsZV3bHJChYkAAhtXCTVd5XDGimWkrGhBpP4Rd0cf%2BHcWy84GJ5HoA7%2Bkb\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Spring Boot 3.x \u6559\u7a0b\uff0c\u592a\u5168\u4e86\uff01<\/a><\/p>\n<p>2.<a href=\"https:\/\/link.segmentfault.com\/?enc=xaK9qAOFJodqMYdZy8EmBA%3D%3D.41%2BJsVfv%2BZz10plenG2EVl3rXJsf8S0wgLZvs06DU0o%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">2,000+ \u9053 Java\u9762\u8bd5\u9898\u53ca\u7b54\u6848\u6574\u7406(2024\u6700\u65b0\u7248)<\/a><\/p>\n<p>3.<a href=\"https:\/\/link.segmentfault.com\/?enc=z8ltEalkmsX0taoSN7lkNA%3D%3D.gU5nGHSdh%2FV%2BZldsX%2BcyaXr1ndGCOaJvubPbQcwf4BrEdVjjUxCueIMfnoBDU3JFlBnSLUWznUwn%2Fd%2B3NqYltg%3D%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">\u514d\u8d39\u83b7\u53d6 IDEA \u6fc0\u6d3b\u7801\u7684 7 \u79cd\u65b9\u5f0f\uff082024\u6700\u65b0\u7248\uff09<\/a><\/p>\n<p>\u89c9\u5f97\u4e0d\u9519\uff0c\u522b\u5fd8\u4e86\u968f\u624b\u70b9\u8d5e+\u8f6c\u53d1\u54e6\uff01<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000045692169\">https:\/\/segmentfault.com\/a\/1190000045692169<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662fR\u54e5\u3002 \u4eca\u5929\u4e00\u65e9\u6536\u5230\u4e86\u817e\u8baf\u4e91\u7ed9\u6211\u7684\u3010\u4e3b\u673a\u5b89\u5168\u3011\u6f0f\u6d1e\u901a\u77e5\uff1a \u597d\u5bb6\u4f19\uff0c\u5927\u540d\u9f0e\u9f0e\u7684 Redis \u7206\u9ad8\u5371\u6f0f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10020579","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10020579"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020579\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10020579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10020579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10020579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}