{"id":6276,"date":"2024-11-14T14:02:56","date_gmt":"2024-11-14T06:02:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6276\/"},"modified":"2024-11-14T14:02:56","modified_gmt":"2024-11-14T06:02:56","slug":"redis%e9%9b%86%e7%be%a4%e6%80%8e%e6%a0%b7%e9%87%8d%e5%90%af","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6276\/","title":{"rendered":"redis\u96c6\u7fa4\u600e\u6837\u91cd\u542f"},"content":{"rendered":"<blockquote><p>\n  \u8981\u91cd\u542f redis \u96c6\u7fa4\uff0c\u53ef\u4ee5\u91c7\u7528\u6eda\u52a8\u91cd\u542f\u7684\u65b9\u5f0f\uff1a\u5173\u95ed\u6240\u6709\u4ece\u8282\u70b9\u5173\u95ed\u4e3b\u8282\u70b9\u91cd\u65b0\u542f\u52a8\u4e3b\u8282\u70b9\u9010\u4e2a\u542f\u52a8\u4ece\u8282\u70b9\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/25\/2024062503494034185.jpg\" class=\"aligncenter\" title=\"redis\u96c6\u7fa4\u600e\u6837\u91cd\u542f\u63d2\u56fe\" alt=\"redis\u96c6\u7fa4\u600e\u6837\u91cd\u542f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u91cd\u542f Redis \u96c6\u7fa4<\/strong><\/p>\n<p><strong>\u91cd\u542f\u4e2a\u522b Redis \u5b9e\u4f8b<\/strong><\/p>\n<p>\u5982\u679c\u53ea\u9700\u8981\u91cd\u542f\u5355\u4e2a Redis \u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>redis-cli -h &lt;\u5b9e\u4f8b IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u5b9e\u4f8b\uff1a<\/p>\n<pre>redis-server \/path\/to\/redis.conf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u91cd\u542f\u6574\u4e2a Redis \u96c6\u7fa4<\/strong><\/p>\n<p>\u8981\u91cd\u542f\u6574\u4e2a Redis \u96c6\u7fa4\uff0c\u6700\u597d\u91c7\u7528\u6eda\u52a8\u91cd\u542f\u7684\u65b9\u6cd5\uff0c\u4ee5\u907f\u514d\u96c6\u7fa4\u4e2d\u65ad\uff1a<\/p>\n<ol>\n<li> <strong>\u5173\u95ed\u4ece\u8282\u70b9\uff1a<\/strong>\u9010\u4e2a\u5173\u95ed\u6240\u6709\u4ece\u8282\u70b9\uff1a<\/li>\n<\/ol>\n<pre>redis-cli -h &lt;\u8282\u70b9 IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li> <strong>\u91cd\u542f\u4e3b\u8282\u70b9\uff1a<\/strong>\u5173\u95ed\u4e3b\u8282\u70b9\uff1a<\/li>\n<\/ol>\n<pre>redis-cli -h &lt;\u4e3b\u8282\u70b9 IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u4e3b\u8282\u70b9\uff1a<\/p>\n<pre>redis-server \/path\/to\/redis.conf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li> <strong>\u542f\u52a8\u4ece\u8282\u70b9\uff1a<\/strong>\u9010\u4e2a\u542f\u52a8\u4ece\u8282\u70b9\uff1a<\/li>\n<\/ol>\n<pre>redis-server \/path\/to\/redis.conf --slaveof &lt;\u4e3b\u8282\u70b9 IP&gt; &lt;\u4e3b\u8282\u70b9\u7aef\u53e3&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li> <strong>\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\uff1a<\/strong>\u4f7f\u7528 -cli cluster info \u547d\u4ee4\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001\uff0c\u786e\u4fdd\u6240\u6709\u8282\u70b9\u90fd\u5df2\u91cd\u65b0\u542f\u52a8\u4e14\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u96c6\u7fa4\u600e\u6837\u91cd\u542f\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>\u8981\u91cd\u542f redis \u96c6\u7fa4\uff0c\u53ef\u4ee5\u91c7\u7528\u6eda\u52a8\u91cd\u542f\u7684\u65b9\u5f0f\uff1a\u5173\u95ed\u6240\u6709\u4ece\u8282\u70b9\u5173\u95ed\u4e3b\u8282\u70b9\u91cd\u65b0\u542f\u52a8\u4e3b\u8282\u70b9\u9010\u4e2a\u542f\u52a8\u4ece\u8282\u70b9\u68c0\u67e5\u96c6\u7fa4\u72b6\u6001 \u5982\u4f55\u91cd\u542f Redis \u96c6\u7fa4 \u91cd\u542f\u4e2a\u522b Redis \u5b9e\u4f8b \u5982\u679c\u53ea\u9700\u8981\u91cd\u542f\u5355\u4e2a Redis \u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a redis-cli -h &lt;\u5b9e\u4f8b IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown \u767b\u5f55\u540e\u590d\u5236 \u7136\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u5b9e\u4f8b\uff1a redis-server \/path\/to\/redis.conf \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u91cd\u542f\u6574\u4e2a Redis \u96c6\u7fa4 \u8981\u91cd\u542f\u6574\u4e2a Redis \u96c6\u7fa4\uff0c\u6700\u597d\u91c7\u7528\u6eda\u52a8\u91cd\u542f\u7684\u65b9\u6cd5\uff0c\u4ee5\u907f\u514d\u96c6\u7fa4\u4e2d\u65ad\uff1a \u5173\u95ed\u4ece\u8282\u70b9\uff1a\u9010\u4e2a\u5173\u95ed\u6240\u6709\u4ece\u8282\u70b9\uff1a redis-cli -h &lt;\u8282\u70b9 IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown \u767b\u5f55\u540e\u590d\u5236 \u91cd\u542f\u4e3b\u8282\u70b9\uff1a\u5173\u95ed\u4e3b\u8282\u70b9\uff1a redis-cli -h &lt;\u4e3b\u8282\u70b9 IP&gt; -p &lt;\u7aef\u53e3&gt; shutdown \u767b\u5f55\u540e\u590d\u5236 \u7136\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u4e3b\u8282\u70b9\uff1a redis-server \/path\/to\/redis.conf \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u542f\u52a8\u4ece\u8282\u70b9\uff1a\u9010\u4e2a\u542f\u52a8\u4ece\u8282\u70b9\uff1a [&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-6276","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6276","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=6276"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6276\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}