{"id":109763,"date":"2023-08-08T04:10:14","date_gmt":"2023-08-07T20:10:14","guid":{"rendered":"http:\/\/www.idc.net\/help\/109763\/"},"modified":"2023-08-08T04:10:14","modified_gmt":"2023-08-07T20:10:14","slug":"redis%e9%bb%98%e8%ae%a4%e6%97%a5%e5%bf%97%e7%ba%a7%e5%88%ab%e8%ae%be%e7%bd%ae%e5%88%86%e6%9e%90%ef%bc%88redis%e7%9a%84%e9%bb%98%e8%ae%a4%e6%97%a5%e5%bf%97%e7%ba%a7%e5%88%ab%ef%bc%89","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/109763\/","title":{"rendered":"Redis\u9ed8\u8ba4\u65e5\u5fd7\u7ea7\u522b\u8bbe\u7f6e\u5206\u6790\uff08redis\u7684\u9ed8\u8ba4\u65e5\u5fd7\u7ea7\u522b\uff09"},"content":{"rendered":"<p>Redis\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u9ad8\u6027\u80fd\u952e\u503c\u5bf9\u5b58\u50a8\u6570\u636e\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u5185\u5b58\u8bfb\u5199\u6027\u80fd\u548c\u7a33\u5b9a\u7684\u6301\u4e45\u5316\u5b58\u50a8\u529f\u80fd\u3002\u5728\u4f7f\u7528Redis\u8fc7\u7a0b\u4e2d\uff0c\u914d\u7f6eRedis\u65e5\u5fd7\u7684\u7ea7\u522b\u662f\u4ef6\u975e\u5e38\u91cd\u8981\u7684\u4e8b\u60c5\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u76d1\u63a7\u548c\u4f18\u5316Redis\u7684\u8fd0\u884c\u72b6\u6001\u3002<\/p>\n<\/p>\n<p>\u9ed8\u8ba4\u65e5\u5fd7\u7ea7\u522b\u5206\u6790<\/p>\n<\/p>\n<p>Redis\u4e2d\u9ed8\u8ba4\u7684\u65e5\u5fd7\u7ea7\u522b\u662fnotice\uff0c\u8fd9\u4e2a\u65e5\u5fd7\u7ea7\u522b\u76f8\u5f53\u4e8eLinux\u7cfb\u7edf\u65e5\u5fd7\u7684info\u7ea7\u522b\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5b83\u4f1a\u8f93\u51faRedis\u8fd0\u884c\u7684\u57fa\u672c\u4fe1\u606f\u548c\u9519\u8bef\u4fe1\u606f\u3002\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u8bbe\u7f6eRedis\u7684\u65e5\u5fd7\u7ea7\u522b\u4e3awarning\u6216error\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u8fc7\u591a\u5197\u4f59\u4fe1\u606f\u7684\u8f93\u51fa\uff0c\u964d\u4f4e\u65e5\u5fd7\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/p>\n<\/p>\n<p>\u9664\u4e86\u57fa\u672c\u4fe1\u606f\u548c\u9519\u8bef\u4fe1\u606f\u5916\uff0cRedis\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u7684\u65e5\u5fd7\u7ea7\u522b\uff0c\u5982debug\u3001verbose\u548ccritical\u3002\u8fd9\u4e9b\u65e5\u5fd7\u7ea7\u522b\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u4eba\u5458\u66f4\u6df1\u5165\u5730\u4e86\u89e3Redis\u7684\u5185\u90e8\u7ed3\u6784\u548c\u8fd0\u884c\u72b6\u6001\uff0c\u4ece\u800c\u66f4\u597d\u5730\u8fdb\u884c\u6027\u80fd\u4f18\u5316\u548c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p>Redis\u65e5\u5fd7\u8f93\u51fa\u683c\u5f0f<\/p>\n<\/p>\n<p>\u9664\u4e86\u65e5\u5fd7\u7ea7\u522b\u7684\u8bbe\u7f6e\uff0cRedis\u8fd8\u63d0\u4f9b\u4e86\u591a\u79cd\u65e5\u5fd7\u8f93\u51fa\u683c\u5f0f\uff0c\u6bcf\u79cd\u65e5\u5fd7\u8f93\u51fa\u683c\u5f0f\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52a3\u4e4b\u5904\uff0c\u5f00\u53d1\u4eba\u5458\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u9700\u6c42\u6765\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p>\u5728Redis\u4e2d\uff0c\u65e5\u5fd7\u8f93\u51fa\u683c\u5f0f\u5305\u62ec\u6807\u51c6\u683c\u5f0f\u3001\u7b80\u5355\u683c\u5f0f\u3001\u539f\u59cb\u683c\u5f0f\u548cJSON\u683c\u5f0f\u3002\u5176\u4e2d\uff0c\u6807\u51c6\u683c\u5f0f\u662fRedis\u7684\u9ed8\u8ba4\u8f93\u51fa\u683c\u5f0f\uff0c\u5b83\u7684\u8f93\u51fa\u5185\u5bb9\u5305\u542b\u4e86\u65e5\u671f\u3001\u65f6\u95f4\u3001\u65e5\u5fd7\u7ea7\u522b\u3001\u8fdb\u7a0bID\u548c\u65e5\u5fd7\u6d88\u606f\u7b49\u4fe1\u606f\u3002\u7b80\u5355\u683c\u5f0f\u53ea\u8f93\u51fa\u65e5\u5fd7\u6d88\u606f\uff0c\u539f\u59cb\u683c\u5f0f\u53ea\u8f93\u51fa\u539f\u59cb\u65e5\u5fd7\u6d88\u606f\uff0cJSON\u683c\u5f0f\u5c06\u65e5\u5fd7\u6d88\u606f\u4ee5JSON\u683c\u5f0f\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p>\u4ee3\u7801\u5b9e\u73b0<\/p>\n<\/p>\n<p>\u5728Redis\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539redis.conf\u6587\u4ef6\u4e2d\u7684\u65e5\u5fd7\u914d\u7f6e\u53c2\u6570\u6765\u8bbe\u7f6e\u65e5\u5fd7\u7ea7\u522b\u548c\u8f93\u51fa\u683c\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<pre># Log level<br># Can be one of:<br># debug (a lot of information, useful for development\/testing)<br># verbose (many rarely useful info, but not a mess like the debug level)<br># notice (normal operational messages - nothing special, not an error)<br># warning (more serious operational messages, warning about possible problems)<br>loglevel warning<br># Log file path<br>logfile \/var\/log\/redis\/redis.log<br># Log format<br>logformat standard<br><\/pre>\n<\/p>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u5c06\u65e5\u5fd7\u7ea7\u522b\u8bbe\u7f6e\u4e3awarning\uff0c\u8f93\u51fa\u8def\u5f84\u4e3a\/var\/log\/redis\/redis.log\uff0c\u8f93\u51fa\u683c\u5f0f\u4e3a\u6807\u51c6\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5728Redis\u4e2d\u5f00\u542f\u4e86AOF\u6301\u4e45\u5316\u529f\u80fd\uff0c\u5219\u8fd8\u9700\u8981\u8bbe\u7f6eAOF\u65e5\u5fd7\u7684\u7ea7\u522b\u548c\u8f93\u51fa\u683c\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u914d\u7f6e\uff1a<\/p>\n<\/p>\n<pre># AOF log level<br># Can be one of:<br># debug (a lot of information, useful for development\/testing)<br># verbose (many rarely useful info, but not a mess like the debug level)<br># notice (normal operational messages - nothing special, not an error)<br># warning (more serious operational messages, warning about possible problems)<br>aof-log-level warning<br># AOF log file path<br>aof-logfile \/var\/log\/redis\/redis-aof.log<br># AOF log format<br>aof-log-format standard<br><\/pre>\n<\/p>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u5c06AOF\u65e5\u5fd7\u7ea7\u522b\u8bbe\u7f6e\u4e3awarning\uff0c\u8f93\u51fa\u8def\u5f84\u4e3a\/var\/log\/redis\/redis-aof.log\uff0c\u8f93\u51fa\u683c\u5f0f\u4e3a\u6807\u51c6\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p>\u603b\u7ed3<\/p>\n<\/p>\n<p>\u5728\u4f7f\u7528Redis\u65f6\uff0c\u914d\u7f6e\u65e5\u5fd7\u7ea7\u522b\u548c\u8f93\u51fa\u683c\u5f0f\u662f\u4ef6\u975e\u5e38\u91cd\u8981\u7684\u4e8b\u60c5\uff0c\u901a\u8fc7\u8bbe\u7f6e\u9002\u5408\u81ea\u5df1\u7684\u65e5\u5fd7\u7ea7\u522b\u548c\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u76d1\u63a7\u548c\u4f18\u5316Redis\u7684\u8fd0\u884c\u72b6\u6001\u3002\u9664\u4e86redis.conf\u6587\u4ef6\u4e2d\u7684\u914d\u7f6e\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u5ba2\u6237\u7aef\u7684\u65e5\u5fd7\u914d\u7f6e\u53c2\u6570\u6765\u5b9e\u65f6\u5730\u63a7\u5236\u65e5\u5fd7\u7684\u8f93\u51fa\uff0c\u4ece\u800c\u66f4\u7075\u6d3b\u5730\u8fdb\u884cRedis\u7684\u8c03\u8bd5\u548c\u4f18\u5316\u3002<\/p>\n<p><a href=\"http:https:\/\/idc.net\/\">\u9999\u6e2f\u670d\u52a1\u5668<\/a>\u9996\u9009\u540e\u6d6a\u4e91\uff0c2H2G\u9996\u670810\u5143\u5f00\u901a\u3002<br \/>\u540e\u6d6a\u4e91\uff08www.IDC.Net\uff09\u63d0\u4f9b\u7b80\u5355\u597d\u7528\uff0c\u4ef7\u683c\u539a\u9053\u7684\u9999\u6e2f\/\u7f8e\u56fd\u4e91\u670d\u52a1\u5668\u548c\u72ec\u7acb\u670d\u52a1\u5668\u3002IDC+ISP+ICP\u8d44\u8d28\u3002ARIN\u548cAPNIC\u4f1a\u5458\u3002\u6210\u719f\u6280\u672f\u56e2\u961f15\u5e74\u884c\u4e1a\u7ecf\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redis\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u9ad8\u6027\u80fd\u952e\u503c\u5bf9\u5b58\u50a8\u6570\u636e\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u5185\u5b58\u8bfb\u5199\u6027\u80fd\u548c\u7a33\u5b9a\u7684\u6301\u4e45\u5316\u5b58\u50a8\u529f\u80fd\u3002\u5728\u4f7f\u7528Redi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7038],"tags":[],"class_list":["post-109763","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/109763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=109763"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/109763\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=109763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=109763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=109763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}