{"id":129601,"date":"2024-10-26T22:52:21","date_gmt":"2024-10-26T14:52:21","guid":{"rendered":"https:\/\/server.hk\/cnblog\/129601\/"},"modified":"2024-10-26T22:52:22","modified_gmt":"2024-10-26T14:52:22","slug":"redis%e7%aa%81%e7%99%bc%e6%95%85%e9%9a%9c%ef%bc%8c%e8%ac%b9%e6%85%8e%e8%99%95%e7%90%86%ef%bc%88redis%e7%aa%81%e7%84%b6%e7%84%a1%e6%b3%95%e4%bd%bf%e7%94%a8%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/129601\/","title":{"rendered":"Redis\u7a81\u767c\u6545\u969c\uff0c\u8b39\u614e\u8655\u7406\uff08redis\u7a81\u7136\u7121\u6cd5\u4f7f\u7528\uff09"},"content":{"rendered":"<h1 id=\"redis%e7%aa%81%e7%99%bc%e6%95%85%e9%9a%9c%ef%bc%8c%e8%ac%b9%e6%85%8e%e8%99%95%e7%90%86%ef%bc%88redis%e7%aa%81%e7%84%b6%e7%84%a1%e6%b3%95%e4%bd%bf%e7%94%a8%ef%bc%89-yNyXapyFCe\">Redis\u7a81\u767c\u6545\u969c\uff0c\u8b39\u614e\u8655\u7406\uff08redis\u7a81\u7136\u7121\u6cd5\u4f7f\u7528\uff09<\/h1>\n<p>Redis\u662f\u4e00\u500b\u9ad8\u6548\u80fd\u7684\u9375\u503c\u6578\u64da\u5eab\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u7de9\u5b58\u3001\u6d88\u606f\u968a\u5217\u548c\u6578\u64da\u6301\u4e45\u5316\u7b49\u5834\u666f\u3002\u7136\u800c\uff0c\u7576Redis\u7a81\u7136\u7121\u6cd5\u4f7f\u7528\u6642\uff0c\u53ef\u80fd\u6703\u5c0d\u61c9\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u7528\u6027\u9020\u6210\u56b4\u91cd\u5f71\u97ff\u3002\u672c\u6587\u5c07\u63a2\u8a0eRedis\u7a81\u767c\u6545\u969c\u7684\u5e38\u898b\u539f\u56e0\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\uff0c\u5e6b\u52a9\u7528\u6236\u5728\u9047\u5230\u554f\u984c\u6642\u80fd\u5920\u8fc5\u901f\u61c9\u5c0d\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e7%9a%84redis%e6%95%85%e9%9a%9c%e5%8e%9f%e5%9b%a0-yNyXapyFCe\">\u5e38\u898b\u7684Redis\u6545\u969c\u539f\u56e0<\/h2>\n<ul>\n<li><strong>\u5167\u5b58\u4e0d\u8db3\uff1a<\/strong>Redis\u662f\u57fa\u65bc\u5167\u5b58\u7684\u6578\u64da\u5eab\uff0c\u7576\u53ef\u7528\u5167\u5b58\u4e0d\u8db3\u6642\uff0cRedis\u53ef\u80fd\u6703\u505c\u6b62\u670d\u52d9\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u6578\u64da\u91cf\u8d85\u904e\u9810\u671f\u6642\u3002<\/li>\n<li><strong>\u914d\u7f6e\u932f\u8aa4\uff1a<\/strong>\u4e0d\u7576\u7684\u914d\u7f6e\u53ef\u80fd\u5c0e\u81f4Redis\u7121\u6cd5\u555f\u52d5\u6216\u904b\u884c\u4e0d\u7a69\u5b9a\u3002\u4f8b\u5982\uff0c\u932f\u8aa4\u7684\u7aef\u53e3\u8a2d\u7f6e\u6216\u5bc6\u78bc\u914d\u7f6e\u90fd\u53ef\u80fd\u9020\u6210\u9023\u63a5\u554f\u984c\u3002<\/li>\n<li><strong>\u7db2\u7d61\u554f\u984c\uff1a<\/strong>Redis\u4f9d\u8cf4\u65bc\u7db2\u7d61\u9032\u884c\u6578\u64da\u50b3\u8f38\uff0c\u7db2\u7d61\u5ef6\u9072\u6216\u4e2d\u65b7\u53ef\u80fd\u5c0e\u81f4\u5ba2\u6236\u7aef\u7121\u6cd5\u9023\u63a5\u5230Redis\u670d\u52d9\u5668\u3002<\/li>\n<li><strong>\u786c\u4ef6\u6545\u969c\uff1a<\/strong>\u786c\u4ef6\u6545\u969c\uff0c\u5982\u78c1\u789f\u640d\u58de\u6216\u5167\u5b58\u6545\u969c\uff0c\u53ef\u80fd\u5c0e\u81f4Redis\u670d\u52d9\u5668\u7121\u6cd5\u6b63\u5e38\u904b\u884c\u3002<\/li>\n<li><strong>\u7248\u672c\u4e0d\u517c\u5bb9\uff1a<\/strong>\u4f7f\u7528\u4e0d\u517c\u5bb9\u7684Redis\u5ba2\u6236\u7aef\u6216\u670d\u52d9\u5668\u7248\u672c\u53ef\u80fd\u5c0e\u81f4\u529f\u80fd\u7570\u5e38\u6216\u7121\u6cd5\u9023\u63a5\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%85%e9%9a%9c%e6%8e%92%e6%9f%a5%e6%ad%a5%e9%a9%9f-yNyXapyFCe\">\u6545\u969c\u6392\u67e5\u6b65\u9a5f<\/h2>\n<p>\u7576Redis\u7a81\u7136\u7121\u6cd5\u4f7f\u7528\u6642\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6392\u67e5\u6b65\u9a5f\uff0c\u53ef\u4ee5\u5e6b\u52a9\u7528\u6236\u5feb\u901f\u5b9a\u4f4d\u554f\u984c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5redis%e6%9c%8d%e5%8b%99%e7%8b%80%e6%85%8b-yNyXapyFCe\">1. \u6aa2\u67e5Redis\u670d\u52d9\u72c0\u614b<\/h3>\n<pre><code>systemctl status redis<\/code><\/pre>\n<p>\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u6aa2\u67e5Redis\u670d\u52d9\u7684\u904b\u884c\u72c0\u614b\u3002\u5982\u679c\u670d\u52d9\u672a\u904b\u884c\uff0c\u53ef\u4ee5\u5617\u8a66\u91cd\u65b0\u555f\u52d5\uff1a<\/p>\n<pre><code>systemctl restart redis<\/code><\/pre>\n<h3 id=\"2-%e6%9f%a5%e7%9c%8b%e6%97%a5%e8%aa%8c%e6%96%87%e4%bb%b6-yNyXapyFCe\">2. \u67e5\u770b\u65e5\u8a8c\u6587\u4ef6<\/h3>\n<p>Redis\u7684\u65e5\u8a8c\u6587\u4ef6\u901a\u5e38\u4f4d\u65bc\/var\/log\/redis\/redis-server.log\u3002\u6aa2\u67e5\u65e5\u8a8c\u6587\u4ef6\u4e2d\u7684\u932f\u8aa4\u4fe1\u606f\uff0c\u53ef\u4ee5\u5e6b\u52a9\u8b58\u5225\u554f\u984c\u7684\u6839\u6e90\u3002<\/p>\n<h3 id=\"3-%e6%aa%a2%e6%9f%a5%e5%85%a7%e5%ad%98%e4%bd%bf%e7%94%a8%e6%83%85%e6%b3%81-yNyXapyFCe\">3. \u6aa2\u67e5\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1<\/h3>\n<pre><code>free -m<\/code><\/pre>\n<p>\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u6aa2\u67e5\u7cfb\u7d71\u7684\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1\u3002\u5982\u679c\u5167\u5b58\u4f7f\u7528\u7387\u904e\u9ad8\uff0c\u8003\u616e\u64f4\u5c55\u5167\u5b58\u6216\u512a\u5316\u6578\u64da\u5b58\u5132\u7b56\u7565\u3002<\/p>\n<h3 id=\"4-%e6%b8%ac%e8%a9%a6%e7%b6%b2%e7%b5%a1%e9%80%a3%e6%8e%a5-yNyXapyFCe\">4. \u6e2c\u8a66\u7db2\u7d61\u9023\u63a5<\/h3>\n<pre><code>ping <\/code><\/pre>\n<p>\u4f7f\u7528ping\u547d\u4ee4\u6aa2\u67e5\u5ba2\u6236\u7aef\u8207Redis\u670d\u52d9\u5668\u4e4b\u9593\u7684\u7db2\u7d61\u9023\u63a5\u662f\u5426\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88-yNyXapyFCe\">\u89e3\u6c7a\u65b9\u6848<\/h2>\n<p>\u6839\u64da\u6392\u67e5\u7d50\u679c\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u7684\u89e3\u6c7a\u65b9\u6848\uff1a<\/p>\n<ul>\n<li><strong>\u64f4\u5c55\u5167\u5b58\uff1a<\/strong>\u5982\u679c\u5167\u5b58\u4e0d\u8db3\uff0c\u8003\u616e\u5347\u7d1a\u670d\u52d9\u5668\u7684\u5167\u5b58\u914d\u7f6e\uff0c\u6216\u4f7f\u7528Redis\u7684\u6301\u4e45\u5316\u529f\u80fd\u4f86\u6e1b\u5c11\u5167\u5b58\u4f7f\u7528\u3002<\/li>\n<li><strong>\u4fee\u6b63\u914d\u7f6e\uff1a<\/strong>\u6aa2\u67e5\u4e26\u4fee\u6b63Redis\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u78ba\u4fdd\u6240\u6709\u8a2d\u7f6e\u6b63\u78ba\u7121\u8aa4\u3002<\/li>\n<li><strong>\u512a\u5316\u7db2\u7d61\uff1a<\/strong>\u5982\u679c\u7db2\u7d61\u554f\u984c\u983b\u7e41\uff0c\u8003\u616e\u4f7f\u7528\u66f4\u7a69\u5b9a\u7684\u7db2\u7d61\u74b0\u5883\u6216\u9032\u884c\u7db2\u7d61\u8a2d\u5099\u7684\u5347\u7d1a\u3002<\/li>\n<li><strong>\u786c\u4ef6\u6aa2\u67e5\uff1a<\/strong>\u5b9a\u671f\u6aa2\u67e5\u786c\u4ef6\u72c0\u6cc1\uff0c\u53ca\u6642\u66f4\u63db\u6545\u969c\u90e8\u4ef6\u3002<\/li>\n<li><strong>\u7248\u672c\u66f4\u65b0\uff1a<\/strong>\u4fdd\u6301Redis\u53ca\u5176\u5ba2\u6236\u7aef\u7684\u7248\u672c\u66f4\u65b0\uff0c\u4ee5\u907f\u514d\u4e0d\u517c\u5bb9\u554f\u984c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-yNyXapyFCe\">\u7e3d\u7d50<\/h2>\n<p>Redis\u7684\u7a81\u767c\u6545\u969c\u53ef\u80fd\u6703\u5c0d\u696d\u52d9\u904b\u71df\u9020\u6210\u5f71\u97ff\uff0c\u56e0\u6b64\u53ca\u6642\u6392\u67e5\u548c\u89e3\u6c7a\u554f\u984c\u81f3\u95dc\u91cd\u8981\u3002\u901a\u904e\u4e86\u89e3\u5e38\u898b\u6545\u969c\u539f\u56e0\u548c\u6392\u67e5\u6b65\u9a5f\uff0c\u7528\u6236\u53ef\u4ee5\u66f4\u6709\u6548\u5730\u61c9\u5c0dRedis\u7684\u7a81\u767c\u6545\u969c\u3002\u82e5\u9700\u9032\u4e00\u6b65\u7684\u6280\u8853\u652f\u6301\u6216\u5c0b\u627e\u5408\u9069\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u60a8\u53ef\u4ee5\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u61c9\u7528\u63d0\u4f9b\u7a69\u5b9a\u7684\u904b\u884c\u74b0\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redis\u7a81\u767c\u6545\u969c\u6642\uff0c\u9700\u8b39\u614e\u8655\u7406\u3002\u4e86\u89e3\u5e38\u898b\u554f\u984c\u53ca\u89e3\u6c7a\u65b9\u6848\uff0c\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u8207\u7cfb\u7d71\u7a69\u5b9a\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-129601","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/129601","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=129601"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/129601\/revisions"}],"predecessor-version":[{"id":129602,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/129601\/revisions\/129602"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=129601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=129601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=129601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}