{"id":128749,"date":"2024-10-26T16:28:20","date_gmt":"2024-10-26T08:28:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/128749\/"},"modified":"2024-10-26T16:28:20","modified_gmt":"2024-10-26T08:28:20","slug":"redis%e5%af%a6%e7%8f%be%e5%bf%ab%e9%80%9f%e8%ae%80%e5%af%ab%e6%80%a7%e8%83%bd%e4%b8%8a%e7%b7%9a%ef%bc%88redis%e7%9a%84%e8%ae%80%e5%af%ab%e4%b8%8a%e7%b7%9a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/128749\/","title":{"rendered":"Redis\u5be6\u73fe\u5feb\u901f\u8b80\u5beb\u6027\u80fd\u4e0a\u7dda\uff08redis\u7684\u8b80\u5beb\u4e0a\u7dda\uff09"},"content":{"rendered":"<h1 id=\"redis%e5%af%a6%e7%8f%be%e5%bf%ab%e9%80%9f%e8%ae%80%e5%af%ab%e6%80%a7%e8%83%bd%e4%b8%8a%e7%b7%9a%ef%bc%88redis%e7%9a%84%e8%ae%80%e5%af%ab%e4%b8%8a%e7%b7%9a%ef%bc%89-pjKJaWwizU\">Redis\u5be6\u73fe\u5feb\u901f\u8b80\u5beb\u6027\u80fd\u4e0a\u7dda\uff08redis\u7684\u8b80\u5beb\u4e0a\u7dda\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u6642\u4ee3\uff0c\u5feb\u901f\u7684\u6578\u64da\u8b80\u5beb\u6027\u80fd\u5c0d\u65bc\u61c9\u7528\u7a0b\u5e8f\u7684\u6210\u529f\u81f3\u95dc\u91cd\u8981\u3002Redis\u4f5c\u70ba\u4e00\u7a2e\u9ad8\u6548\u7684\u5167\u5b58\u6578\u64da\u5eab\uff0c\u56e0\u5176\u5353\u8d8a\u7684\u6027\u80fd\u548c\u9748\u6d3b\u7684\u6578\u64da\u7d50\u69cb\u800c\u53d7\u5230\u5ee3\u6cdb\u95dc\u6ce8\u3002\u672c\u6587\u5c07\u63a2\u8a0eRedis\u5982\u4f55\u5be6\u73fe\u5feb\u901f\u7684\u8b80\u5beb\u6027\u80fd\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u5be6\u7528\u7684\u793a\u4f8b\u548c\u6700\u4f73\u5be6\u8e10\u3002<\/p>\n<h2 id=\"redis%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-pjKJaWwizU\">Redis\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>Redis\uff08Remote Dictionary Server\uff09\u662f\u4e00\u500b\u958b\u6e90\u7684\u9375\u503c\u5b58\u5132\u7cfb\u7d71\uff0c\u652f\u6301\u591a\u7a2e\u6578\u64da\u7d50\u69cb\uff0c\u5982\u5b57\u7b26\u4e32\u3001\u54c8\u5e0c\u3001\u5217\u8868\u3001\u96c6\u5408\u548c\u6709\u5e8f\u96c6\u5408\u3002\u7531\u65bc\u5176\u5c07\u6578\u64da\u5b58\u5132\u5728\u5167\u5b58\u4e2d\uff0cRedis\u80fd\u5920\u63d0\u4f9b\u6975\u5feb\u7684\u8b80\u53d6\u548c\u5beb\u5165\u901f\u5ea6\uff0c\u901a\u5e38\u5728\u6beb\u79d2\u7d1a\u5225\u3002<\/p>\n<h2 id=\"redis%e7%9a%84%e8%ae%80%e5%af%ab%e6%80%a7%e8%83%bd%e5%84%aa%e5%8b%a2-pjKJaWwizU\">Redis\u7684\u8b80\u5beb\u6027\u80fd\u512a\u52e2<\/h2>\n<p>Redis\u7684\u9ad8\u6027\u80fd\u4e3b\u8981\u6e90\u65bc\u4ee5\u4e0b\u5e7e\u500b\u65b9\u9762\uff1a<\/p>\n<ul>\n<li><strong>\u5167\u5b58\u5b58\u5132\uff1a<\/strong>Redis\u5c07\u6578\u64da\u5b58\u5132\u5728\u5167\u5b58\u4e2d\uff0c\u9019\u4f7f\u5f97\u6578\u64da\u7684\u8b80\u53d6\u548c\u5beb\u5165\u901f\u5ea6\u9060\u5feb\u65bc\u50b3\u7d71\u7684\u78c1\u789f\u5b58\u5132\u7cfb\u7d71\u3002<\/li>\n<li><strong>\u55ae\u7dda\u7a0b\u67b6\u69cb\uff1a<\/strong>Redis\u4f7f\u7528\u55ae\u7dda\u7a0b\u6a21\u578b\u4f86\u8655\u7406\u8acb\u6c42\uff0c\u9019\u907f\u514d\u4e86\u591a\u7dda\u7a0b\u74b0\u5883\u4e2d\u7684\u4e0a\u4e0b\u6587\u5207\u63db\u958b\u92b7\uff0c\u5f9e\u800c\u63d0\u9ad8\u4e86\u6027\u80fd\u3002<\/li>\n<li><strong>\u9ad8\u6548\u7684\u6578\u64da\u7d50\u69cb\uff1a<\/strong>Redis\u652f\u6301\u591a\u7a2e\u6578\u64da\u7d50\u69cb\uff0c\u9019\u4f7f\u5f97\u958b\u767c\u8005\u53ef\u4ee5\u6839\u64da\u5177\u9ad4\u9700\u6c42\u9078\u64c7\u6700\u5408\u9069\u7684\u6578\u64da\u985e\u578b\uff0c\u5f9e\u800c\u63d0\u9ad8\u64cd\u4f5c\u6548\u7387\u3002<\/li>\n<\/ul>\n<h2 id=\"redis%e7%9a%84%e8%ae%80%e5%af%ab%e6%93%8d%e4%bd%9c-pjKJaWwizU\">Redis\u7684\u8b80\u5beb\u64cd\u4f5c<\/h2>\n<p>\u5728Redis\u4e2d\uff0c\u8b80\u5beb\u64cd\u4f5c\u975e\u5e38\u7c21\u55ae\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u8b80\u5beb\u64cd\u4f5c\u793a\u4f8b\uff1a<\/p>\n<h3 id=\"%e5%af%ab%e5%85%a5%e6%95%b8%e6%93%9a-pjKJaWwizU\">\u5beb\u5165\u6578\u64da<\/h3>\n<pre><code>SET key value<\/code><\/pre>\n<p>\u9019\u689d\u547d\u4ee4\u5c07\u4e00\u500b\u9375\uff08key\uff09\u8207\u4e00\u500b\u503c\uff08value\uff09\u95dc\u806f\u8d77\u4f86\u3002\u5982\u679c\u9375\u5df2\u7d93\u5b58\u5728\uff0c\u5247\u6703\u8986\u84cb\u539f\u6709\u7684\u503c\u3002<\/p>\n<h3 id=\"%e8%ae%80%e5%8f%96%e6%95%b8%e6%93%9a-pjKJaWwizU\">\u8b80\u53d6\u6578\u64da<\/h3>\n<pre><code>GET key<\/code><\/pre>\n<p>\u9019\u689d\u547d\u4ee4\u7528\u65bc\u7372\u53d6\u8207\u6307\u5b9a\u9375\u95dc\u806f\u7684\u503c\u3002\u5982\u679c\u9375\u4e0d\u5b58\u5728\uff0c\u5247\u8fd4\u56denil\u3002<\/p>\n<h2 id=\"%e6%8f%90%e9%ab%98redis%e6%80%a7%e8%83%bd%e7%9a%84%e6%9c%80%e4%bd%b3%e5%af%a6%e8%b8%90-pjKJaWwizU\">\u63d0\u9ad8Redis\u6027\u80fd\u7684\u6700\u4f73\u5be6\u8e10<\/h2>\n<p>\u70ba\u4e86\u9032\u4e00\u6b65\u63d0\u9ad8Redis\u7684\u6027\u80fd\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5be6\u8e10\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u7ba1\u9053\u6280\u8853\uff1a<\/strong>\u7576\u9700\u8981\u57f7\u884c\u591a\u500b\u547d\u4ee4\u6642\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ba1\u9053\u6280\u8853\u4f86\u6e1b\u5c11\u7db2\u7d61\u5ef6\u9072\u3002\u9019\u6a23\u53ef\u4ee5\u5c07\u591a\u500b\u547d\u4ee4\u6253\u5305\u767c\u9001\uff0c\u7136\u5f8c\u4e00\u6b21\u6027\u63a5\u6536\u7d50\u679c\u3002<\/li>\n<li><strong>\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u7d50\u69cb\uff1a<\/strong>\u6839\u64da\u5177\u9ad4\u7684\u61c9\u7528\u5834\u666f\u9078\u64c7\u6700\u5408\u9069\u7684\u6578\u64da\u7d50\u69cb\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u54c8\u5e0c\u4f86\u5b58\u5132\u5c0d\u8c61\uff0c\u4f7f\u7528\u5217\u8868\u4f86\u7ba1\u7406\u968a\u5217\u7b49\u3002<\/li>\n<li><strong>\u5408\u7406\u914d\u7f6e\u5167\u5b58\uff1a<\/strong>\u6839\u64da\u61c9\u7528\u9700\u6c42\u5408\u7406\u914d\u7f6eRedis\u7684\u5167\u5b58\uff0c\u907f\u514d\u56e0\u5167\u5b58\u4e0d\u8db3\u5c0e\u81f4\u7684\u6027\u80fd\u4e0b\u964d\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-pjKJaWwizU\">\u7d50\u8ad6<\/h2>\n<p>Redis\u4f5c\u70ba\u4e00\u500b\u9ad8\u6548\u7684\u5167\u5b58\u6578\u64da\u5eab\uff0c\u6191\u85c9\u5176\u5353\u8d8a\u7684\u8b80\u5beb\u6027\u80fd\u548c\u9748\u6d3b\u7684\u6578\u64da\u7d50\u69cb\uff0c\u5df2\u6210\u70ba\u8a31\u591a\u61c9\u7528\u7a0b\u5e8f\u7684\u9996\u9078\u3002\u901a\u904e\u5408\u7406\u7684\u4f7f\u7528\u548c\u914d\u7f6e\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u5145\u5206\u767c\u63eeRedis\u7684\u6f5b\u529b\uff0c\u5be6\u73fe\u5feb\u901f\u7684\u6578\u64da\u8b80\u5beb\u64cd\u4f5c\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u90e8\u7f72Redis\uff0cServer.HK\u63d0\u4f9b\u4e86\u591a\u7a2e\u9078\u64c7\uff0c\u5e6b\u52a9\u60a8\u8f15\u9b06\u4e0a\u7dda\u4e26\u512a\u5316\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22Redis\u5982\u4f55\u5be6\u73fe\u5feb\u901f\u8b80\u5beb\u6027\u80fd\u4e0a\u7dda\uff0c\u63d0\u5347\u6578\u64da\u8655\u7406\u6548\u7387\uff0c\u6eff\u8db3\u9ad8\u4e26\u767c\u9700\u6c42\uff0c\u512a\u5316\u61c9\u7528\u8868\u73fe\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-128749","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/128749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=128749"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/128749\/revisions"}],"predecessor-version":[{"id":128750,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/128749\/revisions\/128750"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=128749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=128749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=128749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}