{"id":5847,"date":"2024-11-14T10:39:00","date_gmt":"2024-11-14T02:39:00","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5847\/"},"modified":"2024-11-14T10:39:00","modified_gmt":"2024-11-14T02:39:00","slug":"redis%e5%93%a8%e5%85%b5%e6%a8%a1%e5%bc%8f%e6%80%8e%e4%b9%88%e5%85%b3%e9%97%ad","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5847\/","title":{"rendered":"redis\u54e8\u5175\u6a21\u5f0f\u600e\u4e48\u5173\u95ed"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5173\u95ed redis \u54e8\u5175\u6a21\u5f0f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5c06 sentinel \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 down-after-milliseconds \u8bbe\u7f6e\u4e3a 0\u3002\u5220\u9664 sentinel \u914d\u7f6e\u6587\u4ef6\u3002\u5220\u9664 sentinel \u6570\u636e\u76ee\u5f55\u3002\u91cd\u542f redis \u670d\u52a1\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/03\/2024060320421672953.jpg\" class=\"aligncenter\" title=\"redis\u54e8\u5175\u6a21\u5f0f\u600e\u4e48\u5173\u95ed\u63d2\u56fe\" alt=\"redis\u54e8\u5175\u6a21\u5f0f\u600e\u4e48\u5173\u95ed\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5173\u95ed Redis \u54e8\u5175\u6a21\u5f0f<\/strong><\/p>\n<p>\u8981\u5173\u95ed Redis \u54e8\u5175\u6a21\u5f0f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u505c\u6b62\u54e8\u5175\u8fdb\u7a0b<\/strong><\/p>\n<p>\u5728 Sentinel \u914d\u7f6e\u6587\u4ef6\u4e2d\uff08\u901a\u5e38\u4f4d\u4e8e \/etc\/\/sentinel.conf\uff09\u7684\u6bcf\u4e2a\u54e8\u5175\u7a0b\u5e8f\u9879\u4e2d\uff0c\u5c06 <strong>down-after-milliseconds<\/strong> \u8bbe\u7f6e\u4e3a 0\uff1a<\/p>\n<pre>sentinel monitor mymaster 127.0.0.1 6379 2\nsentinel down-after-milliseconds mymaster 0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u7acb\u5373\u5173\u95ed\u54e8\u5175\u8fdb\u7a0b\u3002<\/p>\n<p><strong>2. \u5220\u9664 Sentinel \u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5220\u9664 Sentinel \u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e \/etc\/redis\/sentinel.conf\uff1a<\/p>\n<pre>sudo rm \/etc\/redis\/sentinel.conf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u5220\u9664 Sentinel \u6570\u636e\u76ee\u5f55<\/strong><\/p>\n<p>Sentinel \u5c06\u5176\u6570\u636e\u5b58\u50a8\u5728\u6570\u636e\u76ee\u5f55\u4e2d\uff0c\u901a\u5e38\u4f4d\u4e8e \/var\/lib\/redis\/sentinel\uff1a<\/p>\n<pre>sudo rm -rf \/var\/lib\/redis\/sentinel<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u91cd\u542f Redis \u670d\u52a1<\/strong><\/p>\n<p>\u6700\u540e\uff0c\u91cd\u542f Redis \u670d\u52a1\u4ee5\u5e94\u7528\u66f4\u6539\uff1a<\/p>\n<pre>sudo service redis-server restart<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6267\u884c\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0cRedis \u54e8\u5175\u6a21\u5f0f\u5c06\u88ab\u7981\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u54e8\u5175\u6a21\u5f0f\u600e\u4e48\u5173\u95ed\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\u5173\u95ed redis \u54e8\u5175\u6a21\u5f0f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u5c06 sentinel \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 down-after-milliseconds \u8bbe\u7f6e\u4e3a 0\u3002\u5220\u9664 sentinel \u914d\u7f6e\u6587\u4ef6\u3002\u5220\u9664 sentinel \u6570\u636e\u76ee\u5f55\u3002\u91cd\u542f redis \u670d\u52a1\u3002 \u5982\u4f55\u5173\u95ed Redis \u54e8\u5175\u6a21\u5f0f \u8981\u5173\u95ed Redis \u54e8\u5175\u6a21\u5f0f\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u505c\u6b62\u54e8\u5175\u8fdb\u7a0b \u5728 Sentinel \u914d\u7f6e\u6587\u4ef6\u4e2d\uff08\u901a\u5e38\u4f4d\u4e8e \/etc\/\/sentinel.conf\uff09\u7684\u6bcf\u4e2a\u54e8\u5175\u7a0b\u5e8f\u9879\u4e2d\uff0c\u5c06 down-after-milliseconds \u8bbe\u7f6e\u4e3a 0\uff1a sentinel monitor mymaster 127.0.0.1 6379 2 sentinel down-after-milliseconds mymaster 0 \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u7acb\u5373\u5173\u95ed\u54e8\u5175\u8fdb\u7a0b\u3002 2. \u5220\u9664 Sentinel \u914d\u7f6e\u6587\u4ef6 \u63a5\u4e0b\u6765\uff0c\u5220\u9664 Sentinel \u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e \/etc\/redis\/sentinel.conf\uff1a sudo rm \/etc\/redis\/sentinel.conf \u767b\u5f55\u540e\u590d\u5236 3. \u5220\u9664 [&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-5847","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5847","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=5847"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5847\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}