{"id":6042,"date":"2024-11-14T11:58:35","date_gmt":"2024-11-14T03:58:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6042\/"},"modified":"2024-11-14T11:58:35","modified_gmt":"2024-11-14T03:58:35","slug":"%e5%a6%82%e4%bd%95%e9%87%8d%e5%90%afredis%e9%9b%86%e7%be%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6042\/","title":{"rendered":"\u5982\u4f55\u91cd\u542fredis\u96c6\u7fa4"},"content":{"rendered":"<blockquote><p>\n  redis \u96c6\u7fa4\u91cd\u542f\u6b65\u9aa4\u5982\u4e0b\uff1a\u5173\u95ed\u5e76\u6e05\u9664\u6570\u636e\u548c\u65e5\u5fd7\u3002\u542f\u52a8\u79cd\u5b50\u8282\u70b9\u3002\u521b\u5efa\u65b0\u96c6\u7fa4\u3002\u6dfb\u52a0\u5269\u4f59\u8282\u70b9\u3002\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/12\/2024061217241977382.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u91cd\u542fredis\u96c6\u7fa4\u63d2\u56fe\" alt=\"\u5982\u4f55\u91cd\u542fredis\u96c6\u7fa4\u63d2\u56fe\" \/><\/p>\n<h2>Redis \u96c6\u7fa4\u91cd\u542f\u65b9\u6cd5<\/h2>\n<h3>\u6b65\u9aa4 1\uff1a\u5173\u95ed\u8282\u70b9<\/h3>\n<ul>\n<li>\u4e3a\u9632\u6b62\uff0c\u8bf7\u6309\u987a\u5e8f\u5173\u95ed\u6240\u6709 Redis \u8282\u70b9\u3002<\/li>\n<li>\n<p>\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5173\u95ed\u5404\u4e2a\u8282\u70b9\uff1a<\/p>\n<ul>\n<li> -cli -h -p shutdown<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 2\uff1a\u6e05\u9664\u6570\u636e\u548c\u65e5\u5fd7<\/h3>\n<ul>\n<li>\u5220\u9664\u6574\u4e2a Redis \u6570\u636e\u76ee\u5f55\uff0c\u901a\u5e38\u4f4d\u4e8e \/var\/lib\/redis\u3002<\/li>\n<li>\u5220\u9664\u8282\u70b9\u65e5\u5fd7\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e \/var\/log\/redis\/.log\u3002<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 3\uff1a\u542f\u52a8\u5355\u4e2a\u8282\u70b9<\/h3>\n<ul>\n<li>\u542f\u52a8\u4e00\u4e2a Redis \u5b9e\u4f8b\u4f5c\u4e3a\u79cd\u5b50\u8282\u70b9\u3002<\/li>\n<li>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u79cd\u5b50\u8282\u70b9\uff1a<\/p>\n<ul>\n<li>redis-server &#8211;port <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 4\uff1a\u521b\u5efa\u65b0\u96c6\u7fa4<\/h3>\n<ul>\n<li>\u4f7f\u7528 redis-trib.rb \u5de5\u5177\u521b\u5efa\u65b0\u7684 Redis \u96c6\u7fa4\u3002<\/li>\n<li>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>redis-trib.rb create &#8211;replicas <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 5\uff1a\u6dfb\u52a0\u5176\u4f59\u8282\u70b9<\/h3>\n<ul>\n<li>\u4f9d\u6b21\u5c06\u5269\u4f59\u8282\u70b9\u6dfb\u52a0\u5230\u96c6\u7fa4\u3002<\/li>\n<li>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>redis-trib.rb add-node &#8211;cluster <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 6\uff1a\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001<\/h3>\n<ul>\n<li>\u4f7f\u7528 redis-cli \u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\u3002<\/li>\n<li>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>redis-cli -c &#8211;cluster check <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u96c6\u7fa4\u5e94\u8be5\u5904\u4e8e\u6b63\u5e38\u8fd0\u884c\u72b6\u6001\uff0c\u6240\u6709\u8282\u70b9\u90fd\u5e94\u62a5\u544a\u4e3a\u201cup\u201d\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u91cd\u542f\u96c6\u7fa4\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>redis \u96c6\u7fa4\u91cd\u542f\u6b65\u9aa4\u5982\u4e0b\uff1a\u5173\u95ed\u5e76\u6e05\u9664\u6570\u636e\u548c\u65e5\u5fd7\u3002\u542f\u52a8\u79cd\u5b50\u8282\u70b9\u3002\u521b\u5efa\u65b0\u96c6\u7fa4\u3002\u6dfb\u52a0\u5269\u4f59\u8282\u70b9\u3002\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\u3002 Redis \u96c6\u7fa4\u91cd\u542f\u65b9\u6cd5 \u6b65\u9aa4 1\uff1a\u5173\u95ed\u8282\u70b9 \u4e3a\u9632\u6b62\uff0c\u8bf7\u6309\u987a\u5e8f\u5173\u95ed\u6240\u6709 Redis \u8282\u70b9\u3002 \u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5173\u95ed\u5404\u4e2a\u8282\u70b9\uff1a -cli -h -p shutdown \u6b65\u9aa4 2\uff1a\u6e05\u9664\u6570\u636e\u548c\u65e5\u5fd7 \u5220\u9664\u6574\u4e2a Redis \u6570\u636e\u76ee\u5f55\uff0c\u901a\u5e38\u4f4d\u4e8e \/var\/lib\/redis\u3002 \u5220\u9664\u8282\u70b9\u65e5\u5fd7\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e \/var\/log\/redis\/.log\u3002 \u6b65\u9aa4 3\uff1a\u542f\u52a8\u5355\u4e2a\u8282\u70b9 \u542f\u52a8\u4e00\u4e2a Redis \u5b9e\u4f8b\u4f5c\u4e3a\u79cd\u5b50\u8282\u70b9\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u79cd\u5b50\u8282\u70b9\uff1a redis-server &#8211;port \u6b65\u9aa4 4\uff1a\u521b\u5efa\u65b0\u96c6\u7fa4 \u4f7f\u7528 redis-trib.rb \u5de5\u5177\u521b\u5efa\u65b0\u7684 Redis \u96c6\u7fa4\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a redis-trib.rb create &#8211;replicas \u6b65\u9aa4 5\uff1a\u6dfb\u52a0\u5176\u4f59\u8282\u70b9 \u4f9d\u6b21\u5c06\u5269\u4f59\u8282\u70b9\u6dfb\u52a0\u5230\u96c6\u7fa4\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a redis-trib.rb add-node &#8211;cluster \u6b65\u9aa4 6\uff1a\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001 \u4f7f\u7528 redis-cli \u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a redis-cli [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6042","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6042"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6042\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}