{"id":33643,"date":"2022-11-27T19:22:37","date_gmt":"2023-11-20T05:45:47","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/"},"modified":"2024-01-15T07:55:19","modified_gmt":"2024-01-14T23:55:19","slug":"%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/","title":{"rendered":"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4"},"content":{"rendered":"<p>Redis 3.0.0 RC2\u5df2\u53d1\u5e03\u3002<br \/>\n\u4e0b\u9762\u662f\u6709\u5173Redis 3.0.0\u4e2d\u65b0\u6dfb\u52a0\u7684Redis\u96c6\u7fa4\u7684\u7b80\u5355\u5efa\u7acb\u65b9\u5f0f\u7684\u5907\u5fd8\u5f55\u3002<br \/>\n\u4f7f\u7528CentOS\uff0c\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u516d\u4e2aRedis\u96c6\u7fa4\u3002<br \/>\n\uff08\u51e0\u4e4e\u5c31\u662f\u5c06\u6559\u7a0bhttp:\/\/redis.io\/topics\/cluster-tutorial\u7ffb\u8bd1\u6210\u4e86\u65e5\u6587\u3002\uff09<\/p>\n<h2>1. \u51c6\u5907\u76ee\u5f55<\/h2>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">mkdir<\/span> ~\/cluster-test\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">cd<\/span> ~\/cluster-test\r\n<span class=\"gp\">$<\/span> <span class=\"nb\">mkdir <\/span>700<span class=\"o\">{<\/span>0,1,2,3,4,5<span class=\"o\">}<\/span>\r\n<\/code><\/pre>\n<h2>2. \u51c6\u5907\u6700\u5c0f\u6784\u6210\u7684\u8bbe\u7f6e\u6587\u4ef6\u3002<\/h2>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">cd <\/span>7000\r\n<span class=\"gp\">$<\/span> emacs redis.conf\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>port 7000\r\ncluster-enabled yes\r\ncluster-config-file nodes.conf\r\ncluster-node-timeout 5000\r\nappendonly yes \r\n<\/code><\/pre>\n<p>\u8bf7\u6309\u7167\u4ee5\u4e0b\u65b9\u5f0f\u8fdb\u884c\u64cd\u4f5c\uff0c\u5c06\u4e0a\u8ff0\u4efb\u52a1\u91cd\u590d\u6267\u884c\uff0c\u4ec5\u4fee\u6539\u7aef\u53e3\u8bbe\u7f6e\u503c\u4e3a7001\u301c7005\u3002<br \/>\n\u203b\u65e0\u9700\u66f4\u6539\u7fa4\u96c6\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<h2>3. \u6bcf\u4e2a\u670d\u52a1\u5668\u7684\u542f\u52a8<\/h2>\n<p>\u6211\u5c06\u542f\u52a8\u516d\u53f0\u670d\u52a1\u5668\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> redis-server 7000\/redis.conf\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> redis-server 7001\/redis.conf\r\n<\/code><\/pre>\n<p>\u8bf7\u7528\u4e2d\u6587\u539f\u751f\u65b9\u5f0f\u6539\u8ff0\u4ee5\u4e0b\u5185\u5bb9\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a<br \/>\n\uff1a<br \/>\n\uff1a<\/p>\n<p>\u6253\u5f00\u591a\u4e2a\u7ec8\u7aef\u3002\u56e0\u4e3a\u6211\u4f7f\u7528emacs\uff0c\u6240\u4ee5\u8fdb\u884c\u4e86\u5c4f\u5e55\u5206\u5272\u3002<br \/>\n\u5728\u9996\u6b21\u542f\u52a8\u65f6\uff0c<br \/>\n\u663e\u793a&#8221;No cluster configuration found, I&#8217;m d9b3d1d86b5f5c928f882df6caddc0dbf6031347&#8243;\uff0c\u5e76\u521b\u5efa\u4e86\u96c6\u7fa4\u914d\u7f6e\u6587\u4ef6(nodes.conf)\u3002<br \/>\n\u8fd9\u4e2ad9b3d1d86b5f5c928f882df6caddc0dbf6031347\u5c06\u4f5c\u4e3a\u6807\u8bc6\u5404\u4e2a\u670d\u52a1\u5668\u7684\u540d\u79f0\u3002<br \/>\n\u6b64\u65f6\uff0c\u67096\u53f0\u670d\u52a1\u5668\u5404\u81ea\u5904\u4e8e\u542f\u52a8\u72b6\u6001\u3002<\/p>\n<h2>4. \u805a\u7c7b<\/h2>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> <span class=\"nb\">cd<\/span> ~\/redis\/src\/\r\n<span class=\"gp\">$<\/span> redis-trib.rb create 127.0.0.1:7000 127.0.0.1:7001  127.0.0.1:7002 127.0.0.1:7003 127.0.01:7004 127.0.0.1:7005\r\n<span class=\"go\">:\r\nCan I set the above configuration? (type 'yes' to accept): yes\r\n:\r\n<\/span><\/code><\/pre>\n<p>\u805a\u7c7b\u5df2\u5b8c\u6210\u3002<\/p>\n<h3>\u8bf7\u6ce8\u610f\u7b2c\u4e00\u70b9<\/h3>\n<p>\u5728\u6307\u5b9a\u670d\u52a1\u5668\u65f6\uff0c\u8bf7\u4f7f\u7528IP\u5730\u5740\u8fdb\u884c\u6307\u5b9a\uff0c\u5982\u4e0b\u6240\u793a\uff1a<br \/>\nredis-trib.rb create 127.0.0.1:7000 127.0.0.1:7001 \u2026<br \/>\n\u2192 \u65e0\u6cd5\u6210\u529f<\/p>\n<h3>\u6ce8\u610f\u4e8b\u98792<\/h3>\n<p>\u5f53\u5728\u6267\u884credis-trib.rb\u65f6\uff0c<br \/>\n\u51fa\u73b0\u7c7b\u4f3c\u4e8ekernel_require.rb:55:inrequire&#8217; from .\/redis-trib.rb:25\u7684\u9519\u8bef\u65f6\uff0c<br \/>\n\u8bf7\u786e\u8ba4\uff1a<br \/>\n1. \u60a8\u7684Ruby\u7248\u672c\u662f\u5426\u8f83\u65b0\uff08\u59821.9\u62162.0\uff09\u3002<br \/>\n2. \u60a8\u662f\u5426\u5b89\u88c5\u4e86redis\u7684gem\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u8bf7\u8fd0\u884cgem install redis\u6765\u5b89\u88c5\u3002<\/p>\n<h3>\u786e\u8ba4\u64cd\u4f5c<\/h3>\n<pre class=\"post-pre\"><code><span class=\"gp\">$<\/span> redis-cli <span class=\"nt\">-c<\/span> <span class=\"nt\">-p<\/span> 7000\r\n<span class=\"gp\">127.0.0.1:7000&gt;<\/span> <span class=\"nb\">set <\/span>foo bar\r\n<span class=\"gp\">-&gt;<\/span> Redirected to slot <span class=\"o\">[<\/span>12182] located at 127.0.0.1:7004\r\n<span class=\"go\">OK\r\n<\/span><span class=\"gp\">127.0.0.1:7004&gt;<\/span> get foo\r\n<span class=\"go\">\"bar\"\r\n<\/span><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Redis 3.0.0 RC2\u5df2\u53d1\u5e03\u3002 \u4e0b\u9762\u662f\u6709\u5173Redis 3.0.0\u4e2d\u65b0\u6dfb\u52a0\u7684Redis\u96c6\u7fa4\u7684\u7b80\u5355\u5efa\u7acb\u65b9\u5f0f [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33643","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u521b\u5efaredis\u96c6\u7fa4\u7684\u6b65\u9aa4\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4\" \/>\n<meta property=\"og:description\" content=\"Redis 3.0.0 RC2\u5df2\u53d1\u5e03\u3002 \u4e0b\u9762\u662f\u6709\u5173Redis 3.0.0\u4e2d\u65b0\u6dfb\u52a0\u7684Redis\u96c6\u7fa4\u7684\u7b80\u5355\u5efa\u7acb\u65b9\u5f0f [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u521b\u5efaredis\u96c6\u7fa4\u7684\u6b65\u9aa4\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-20T05:45:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-14T23:55:19+00:00\" \/>\n<meta name=\"author\" content=\"\u6587, \u7fd4\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6587, \u7fd4\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/\",\"name\":\"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-11-20T05:45:47+00:00\",\"dateModified\":\"2024-01-14T23:55:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c\",\"name\":\"\u6587, \u7fd4\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g\",\"caption\":\"\u6587, \u7fd4\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u521b\u5efaredis\u96c6\u7fa4\u7684\u6b65\u9aa4\/","og_locale":"zh_CN","og_type":"article","og_title":"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4","og_description":"Redis 3.0.0 RC2\u5df2\u53d1\u5e03\u3002 \u4e0b\u9762\u662f\u6709\u5173Redis 3.0.0\u4e2d\u65b0\u6dfb\u52a0\u7684Redis\u96c6\u7fa4\u7684\u7b80\u5355\u5efa\u7acb\u65b9\u5f0f [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u521b\u5efaredis\u96c6\u7fa4\u7684\u6b65\u9aa4\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-11-20T05:45:47+00:00","article_modified_time":"2024-01-14T23:55:19+00:00","author":"\u6587, \u7fd4","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6587, \u7fd4","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/","name":"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-11-20T05:45:47+00:00","dateModified":"2024-01-14T23:55:19+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u521b\u5efaRedis\u96c6\u7fa4\u7684\u6b65\u9aa4"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/64d5cc7727fffbff2f9a2a8da1de3e5c","name":"\u6587, \u7fd4","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/920c3d673e0bccacc98e5e6b7149bb3c22edd8d39cb753e5d7d7e471498118a1?s=96&d=mm&r=g","caption":"\u6587, \u7fd4"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/wenxiang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%88%9b%e5%bb%baredis%e9%9b%86%e7%be%a4%e7%9a%84%e6%ad%a5%e9%aa%a4\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33643"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33643\/revisions"}],"predecessor-version":[{"id":57553,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33643\/revisions\/57553"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}