{"id":2667,"date":"2018-04-14T17:56:59","date_gmt":"2018-04-14T09:56:59","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2667"},"modified":"2018-04-14T17:56:59","modified_gmt":"2018-04-14T09:56:59","slug":"redis-%e9%9d%a2%e8%af%95%e9%a2%98%ef%bc%9aredis-%e5%b8%b8%e8%a7%81%e7%9a%84%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98%e9%83%bd%e6%9c%89%e5%93%aa%e4%ba%9b%ef%bc%9f%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2667","title":{"rendered":"Redis \u9762\u8bd5\u9898\uff1aRedis \u5e38\u89c1\u7684\u6027\u80fd\u95ee\u9898\u90fd\u6709\u54ea\u4e9b\uff1f\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p>\n\t\u9762\u8bd5\u662f\u6bcf\u4e00\u4e2a\u7a0b\u5e8f\u5458\u90fd\u79bb\u4e0d\u5f00\u7684\u8bdd\u9898\uff0c\u9762\u8bd5\u7684\u597d\u574f\u76f4\u63a5\u51b3\u5b9a\u4f60\u7684\u5de5\u4f5c\uff0c\u4f60\u7684\u5de5\u8d44\u3002\u56e0\u6b64\u6211\u4eec\u65f6\u65f6\u523b\u523b\u9700\u8981\u5b66\u4e60\uff0c\u9700\u8981\u624e\u5b9e\u7684\u529f\u5e95\u3002\n<\/p>\n<p>\n\t\u4eca\u5929\u7ed9\u5927\u5bb6\u63a8\u8350\u4e00\u4e2a Redis \u9762\u8bd5\u9898\uff0c\u5f88\u591a\u4eba\u90fd\u88ab\u95ee\u8fc7\u3002\u7fa4\u91cc\u8001\u662f\u6709\u4eba\u63d0\u8d77\u3002\n<\/p>\n<p>\n\tRedis \u5e38\u89c1\u7684\u6027\u80fd\u95ee\u9898\u90fd\u6709\u54ea\u4e9b\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\n<\/p>\n<ul>\n<li>\n\t\tMaster\u5199\u5185\u5b58\u5feb\u7167\uff0csave\u547d\u4ee4\u8c03\u5ea6rdbSave\u51fd\u6570\uff0c\u4f1a\u963b\u585e\u4e3b\u7ebf\u7a0b\u7684\u5de5\u4f5c\uff0c\u5f53\u5feb\u7167\u6bd4\u8f83\u5927\u65f6\u5bf9\u6027\u80fd\u5f71\u54cd\u662f\u975e\u5e38\u5927\u7684\uff0c\u4f1a\u95f4\u65ad\u6027\u6682\u505c\u670d\u52a1\uff0c\u6240\u4ee5Master\u6700\u597d\u4e0d\u8981\u5199\u5185\u5b58\u5feb\u7167\u3002\n\t<\/li>\n<li>\n\t\tMaster AOF\u6301\u4e45\u5316\uff0c\u5982\u679c\u4e0d\u91cd\u5199AOF\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6301\u4e45\u5316\u65b9\u5f0f\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u662f\u6700\u5c0f\u7684\uff0c\u4f46\u662fAOF\u6587\u4ef6\u4f1a\u4e0d\u65ad\u589e\u5927\uff0cAOF\u6587\u4ef6\u8fc7\u5927\u4f1a\u5f71\u54cdMaster\u91cd\u542f\u7684\u6062\u590d\u901f\u5ea6\u3002Master\u6700\u597d\u4e0d\u8981\u505a\u4efb\u4f55\u6301\u4e45\u5316\u5de5\u4f5c\uff0c\u5305\u62ec\u5185\u5b58\u5feb\u7167\u548cAOF\u65e5\u5fd7\u6587\u4ef6\uff0c\u7279\u522b\u662f\u4e0d\u8981\u542f\u7528\u5185\u5b58\u5feb\u7167\u505a\u6301\u4e45\u5316,\u5982\u679c\u6570\u636e\u6bd4\u8f83\u5173\u952e\uff0c\u67d0\u4e2aSlave\u5f00\u542fAOF\u5907\u4efd\u6570\u636e\uff0c\u7b56\u7565\u4e3a\u6bcf\u79d2\u540c\u6b65\u4e00\u6b21\u3002\n\t<\/li>\n<li>\n\t\tMaster\u8c03\u7528BGREWRITEAOF\u91cd\u5199AOF\u6587\u4ef6\uff0cAOF\u5728\u91cd\u5199\u7684\u65f6\u5019\u4f1a\u5360\u5927\u91cf\u7684CPU\u548c\u5185\u5b58\u8d44\u6e90\uff0c\u5bfc\u81f4\u670d\u52a1load\u8fc7\u9ad8\uff0c\u51fa\u73b0\u77ed\u6682\u670d\u52a1\u6682\u505c\u73b0\u8c61\u3002\n\t<\/li>\n<li>\n\t\tRedis\u4e3b\u4ece\u590d\u5236\u7684\u6027\u80fd\u95ee\u9898\uff0c\u4e3a\u4e86\u4e3b\u4ece\u590d\u5236\u7684\u901f\u5ea6\u548c\u8fde\u63a5\u7684\u7a33\u5b9a\u6027\uff0cSlave\u548cMaster\u6700\u597d\u5728\u540c\u4e00\u4e2a\u5c40\u57df\u7f51\u5185\n\t<\/li>\n<\/ul>\n<p>\n\tMySQL\u91cc\u67092000w\u6570\u636e\uff0credis\u4e2d\u53ea\u5b5820w\u7684\u6570\u636e\uff0c\u5982\u4f55\u4fdd\u8bc1redis\u4e2d\u7684\u6570\u636e\u90fd\u662f\u70ed\u70b9\u6570\u636e\uff1f\n<\/p>\n<p>\n\tredis \u5185\u5b58\u6570\u636e\u96c6\u5927\u5c0f\u4e0a\u5347\u5230\u4e00\u5b9a\u5927\u5c0f\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u65bd\u884c\u6570\u636e\u6dd8\u6c70\u7b56\u7565\u3002redis \u63d0\u4f9b 6\u79cd\u6570\u636e\u6dd8\u6c70\u7b56\u7565\uff1a\n<\/p>\n<ul>\n<li>\n\t\tvoltile-lru\uff1a\u4ece\u5df2\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\u7684\u6570\u636e\u96c6\uff08server.db[i].expires\uff09\u4e2d\u6311\u9009\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u7684\u6570\u636e\u6dd8\u6c70\n\t<\/li>\n<li>\n\t\tvolatile-ttl\uff1a\u4ece\u5df2\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\u7684\u6570\u636e\u96c6\uff08server.db[i].expires\uff09\u4e2d\u6311\u9009\u5c06\u8981\u8fc7\u671f\u7684\u6570\u636e\u6dd8\u6c70\n\t<\/li>\n<li>\n\t\tvolatile-random\uff1a\u4ece\u5df2\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\u7684\u6570\u636e\u96c6\uff08server.db[i].expires\uff09\u4e2d\u4efb\u610f\u9009\u62e9\u6570\u636e\u6dd8\u6c70\n\t<\/li>\n<li>\n\t\tallkeys-lru\uff1a\u4ece\u6570\u636e\u96c6\uff08server.db[i].dict\uff09\u4e2d\u6311\u9009\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u7684\u6570\u636e\u6dd8\u6c70\n\t<\/li>\n<li>\n\t\tallkeys-random\uff1a\u4ece\u6570\u636e\u96c6\uff08server.db[i].dict\uff09\u4e2d\u4efb\u610f\u9009\u62e9\u6570\u636e\u6dd8\u6c70\n\t<\/li>\n<li>\n\t\tno-enviction\uff08\u9a71\u9010\uff09\uff1a\u7981\u6b62\u9a71\u9010\u6570\u636e\n\t<\/li>\n<\/ul>\n<p>\n\t\u5176\u5b9e\u8fd8\u6709\u5f88\u591a Redis \u9762\u8bd5\u9898\u4e86\uff0c\u6211\u4eec\u4ee5\u540e\u6162\u6162\u603b\u7ed3\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2667\">Redis \u9762\u8bd5\u9898\uff1aRedis \u5e38\u89c1\u7684\u6027\u80fd\u95ee\u9898\u90fd\u6709\u54ea\u4e9b\uff1f\u5982\u4f55\u89e3\u51b3\uff1f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u9762\u8bd5\u662f\u6bcf\u4e00\u4e2a\u7a0b\u5e8f\u5458\u90fd\u79bb\u4e0d\u5f00\u7684\u8bdd\u9898\uff0c\u9762\u8bd5\u7684\u597d\u574f\u76f4\u63a5\u51b3\u5b9a\u4f60\u7684\u5de5\u4f5c\uff0c\u4f60\u7684\u5de5\u8d44\u3002\u56e0\u6b64\u6211\u4eec\u65f6\u65f6\u523b\u523b\u9700\u8981\u5b66\u4e60\uff0c\u9700\u8981\u624e\u5b9e\u7684\u529f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[69,669,681,579],"class_list":["post-2667","post","type-post","status-publish","format-standard","hentry","category-java","tag-java","tag-redis","tag-681","tag-579"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2667"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2667\/revisions"}],"predecessor-version":[{"id":2668,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2667\/revisions\/2668"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}