[work@jsy-bj-test00 bin]$ gem install redis\r\n<\/pre>\n\u518d\u6b21\u6267\u884c\u521b\u5efa\u96c6\u7fa4\u547d\u4ee4<\/p>\n
[work@jsy-bj-test00 src]$ .\/redis-trib.rb create --replicas 1 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384\r\n>>> Creating cluster\r\n>>> Performing hash slots allocation on 6 nodes...\r\n......\r\n>>> Nodes configuration updated\r\n>>> Assign a different config epoch to each node\r\n>>> Sending CLUSTER MEET messages to join the cluster\r\nWaiting for the cluster to join...\r\n>>> Performing Cluster Check (using node 127.0.0.1:6379)\r\n......\r\n[OK] All nodes agree about slots configuration.\r\n>>> Check for open slots...\r\n>>> Check slots coverage...\r\n[OK] All 16384 slots covered.\r\n\r\n<\/pre>\n\u521b\u5efa\u6210\u529f,\u67e5\u770b\u96c6\u7fa4\u72b6\u6001<\/p>\n
[work@jsy-bj-test00 ~]$ .\/redis\/bin\/redis-cli -h 127.0.0.1 -p 6379 -c\r\n127.0.0.1:6379> cluster info\r\ncluster_state:ok\r\ncluster_slots_assigned:16384\r\ncluster_slots_ok:16384\r\ncluster_slots_pfail:0\r\ncluster_slots_fail:0\r\ncluster_known_nodes:6\r\ncluster_size:3\r\ncluster_current_epoch:6\r\ncluster_my_epoch:1\r\ncluster_stats_messages_sent:627\r\ncluster_stats_messages_received:627\r\n<\/pre>\n\u67e5\u770b\u96c6\u7fa4\u8282\u70b9\u4fe1\u606f<\/p>\n
127.0.0.1:6379> cluster nodes\r\n565246bf31d8e05e464db7455521b1a9f165a9cd 127.0.0.1:6380 master - 0 1578447776230 2 connected 5461-10922\r\n1b99b2a1e4b530501476ab48422c75f30423fd19 127.0.0.1:6383 slave 565246bf31d8e05e464db7455521b1a9f165a9cd 0 1578447778233 5 connected\r\n735ad5778458059316794b9378d4b81aaff20322 127.0.0.1:6379 myself,master - 0 0 1 connected 0-5460\r\n757c2c11ecebfc607aa10a6877e348d0e2da484f 127.0.0.1:6381 master - 0 1578447777732 3 connected 10923-16383\r\nf22efc2bcfcd11cee6487ebc9c75de3b59f5e1d0 127.0.0.1:6382 slave 735ad5778458059316794b9378d4b81aaff20322 0 1578447776230 4 connected\r\nb8bba94b9647caa8600363144fd7108082e45f56 127.0.0.1:6384 slave 757c2c11ecebfc607aa10a6877e348d0e2da484f 0 1578447777232 6 connected\r\n#\u8fd9\u662f\u5f88\u91cd\u8981\u7684\u547d\u4ee4\uff0c\u6211\u4eec\u9700\u8981\u5173\u5fc3\u7684\u4fe1\u606f\u6709\uff1a\r\n#\u7b2c\u4e00\u4e2a\u53c2\u6570\uff1a\u8282\u70b9ID\r\n#\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff1aIP:PORT@TCP \u8fd9\u91cc\u4e00\u4e2a\u5751\uff0cjedis-2.9.0\u4e4b\u524d\u7684\u7248\u672c\u89e3\u6790@\u51fa\u9519\r\n#\u7b2c\u4e09\u4e2a\u53c2\u6570\uff1a\u6807\u5fd7\uff08Master\uff0cSlave\uff0cMyself\uff0cFail...\uff09\r\n#\u7b2c\u56db\u4e2a\u53c2\u6570\uff1a\u5982\u679c\u662f\u4ece\u673a\u5219\u662f\u4e3b\u673a\u7684\u8282\u70b9ID\r\n#\u6700\u540e\u4e24\u4e2a\u53c2\u6570\uff1a\u8fde\u63a5\u7684\u72b6\u6001\u548c\u69fd\u7684\u4f4d\u7f6e\u3002\r\n<\/pre>\n\u96c6\u7fa4\u7ba1\u7406\u76f8\u5173\u547d\u4ee4<\/strong><\/span><\/div>\n#\u96c6\u7fa4\u589e\u52a0\u8282\u70b9\uff0c\u5148\u590d\u5236\u4e24\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\r\n[work@jsy-bj-test00 etc]$ cp -p redis.conf redis6385.conf\r\n[work@jsy-bj-test00 etc]$ cp -p redis.conf redis6386.conf\r\n[work@jsy-bj-test00 etc]$ sed -i 's\/6379\/6385\/g' redis6385.conf\r\n[work@jsy-bj-test00 etc]$ sed -i 's\/6379\/6386\/g' redis6386.conf<\/pre>\n\u542f\u52a86385\u8282\u70b9<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-server \/home\/work\/redis\/etc\/redis6385.conf &\r\n<\/pre>\n\u5c06\u96c6\u7fa4\u7ba1\u7406\u5de5\u5177\u8f6f\u8fde\u5230redis\u7684bin\u4e0b<\/p>\n
[work@jsy-bj-test00 bin]$ ln -s \/home\/work\/soft\/redis-3.2.11\/src\/redis-trib.rb \/home\/work\/redis\/bin\/redis-trib.rb\r\n<\/pre>\n\u5c06\u65b0\u8282\u70b9\u52a0\u5165\u96c6\u7fa4master<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-trib.rb add-node 127.0.0.1:6385 127.0.0.1:6379\r\n>>> Adding node 127.0.0.1:6385 to cluster 127.0.0.1:6379\r\n>>> Performing Cluster Check (using node 127.0.0.1:6379)\r\n......\r\n[OK] All nodes agree about slots configuration.\r\n>>> Check for open slots...\r\n>>> Check slots coverage...\r\n[OK] All 16384 slots covered.\r\n>>> Send CLUSTER MEET to node 127.0.0.1:6385 to make it join the cluster.\r\n[OK] New node added correctly.\r\n<\/pre>\n\u67e5\u770b\u96c6\u7fa4\u72b6\u6001\uff0c\u672a\u5206\u914d\u69fd\u4f4d<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-cli -h 127.0.0.1 -p 6379 -c cluster nodes\r\nd00d05f601df0b69df0c2cc532b636d2c83347be 127.0.0.1:6385 master - 0 1578450280191 0 connected\r\n<\/pre>\n\u7ed96385\u8282\u70b9\u5206\u914d\u69fd\u4f4d<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-trib.rb reshard 127.0.0.1:6379\r\n>>> Performing Cluster Check (using node 127.0.0.1:6379)\r\n......\r\n[OK] All nodes agree about slots configuration.\r\n>>> Check for open slots...\r\n>>> Check slots coverage...\r\n[OK] All 16384 slots covered.\r\nHow many slots do you want to move (from 1 to 16384)? 500\r\nWhat is the receiving node ID? d00d05f601df0b69df0c2cc532b636d2c83347be\r\nPlease enter all the source node IDs.\r\nType 'all' to use all the nodes as source nodes for the hash slots.\r\nType 'done' once you entered all the source nodes IDs.\r\nSource node #1:all\r\nDo you want to proceed with the proposed reshard plan (yes\/no)? yes\r\n#\u7b2c\u4e00\u4e2a\u53c2\u6570\uff1a\u9700\u8981\u79fb\u52a8\u69fd\u7684\u4e2a\u6570\uff0c\r\n#\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff1a\u63a5\u53d7\u69fd\u7684\u8282\u70b9ID\uff0c\r\n#\u7b2c\u4e09\u4e2a\u53c2\u6570\uff1a\u8f93\u5165\"all\"\u8868\u793a\u4ece\u6240\u6709\u539f\u8282\u70b9\u4e2d\u83b7\u53d6\u69fd\uff0c\r\n#\u7b2c\u56db\u4e2a\u53c2\u6570\uff1a\u8f93\u5165\"yes\"\u5f00\u59cb\u79fb\u52a8\u69fd\u5230\u76ee\u6807\u7ed3\u70b9id\r\n#\u67e5\u770b6385\u8282\u70b9\u4fe1\u606f\uff0c\u5df2\u7ecf\u5206\u914d\u69fd\u4f4d\r\n[work@jsy-bj-test00 bin]$ .\/redis-cli -h 127.0.0.1 -p 6379 -c cluster nodes\r\nd00d05f601df0b69df0c2cc532b636d2c83347be 127.0.0.1:6385 master - 0 1578452422167 7 connected 0-165 5461-5627 10923-11088\r\n\u200b<\/pre>\n\u6dfb\u52a0\u4ece\u8282\u70b9\uff0c\u542f\u52a86386\u8282\u70b9\u5e76\u52a0\u5165\u96c6\u7fa4<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-server \/home\/work\/redis\/etc\/redis6386.conf &\r\n[work@jsy-bj-test00 bin]$ .\/redis-trib.rb add-node --slave --master-id d00d05f601df0b69df0c2cc532b636d2c83347be 127.0.0.1:6386 127.0.0.1:6385\r\n>>> Adding node 127.0.0.1:6386 to cluster 127.0.0.1:6385\r\n>>> Performing Cluster Check (using node 127.0.0.1:6385)\r\n......\r\n[OK] All nodes agree about slots configuration.\r\n>>> Check for open slots...\r\n>>> Check slots coverage...\r\n[OK] All 16384 slots covered.\r\n>>> Send CLUSTER MEET to node 127.0.0.1:6386 to make it join the cluster.\r\nWaiting for the cluster to join.\r\n>>> Configure node as replica of 127.0.0.1:6385.\r\n[OK] New node added correctly.\r\n<\/pre>\n\u67e5\u770b6386\u8282\u70b9\u72b6\u6001<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-cli -h 127.0.0.1 -p 6379 -c cluster nodes\r\n6845878cbef3fe25f19a70a8db3eb29abb1b9ea6 127.0.0.1:6386 slave d00d05f601df0b69df0c2cc532b636d2c83347be 0 1578452805439 7 connected\r\n\u200b<\/pre>\n\u5220\u9664\u8282\u70b9<\/p>\n
[work@jsy-bj-test00 bin]$ .\/redis-trib.rb del-node 127.0.0.1:6383 1b99b2a1e4b530501476ab48422c75f30423fd19\r\n>>> Removing node 1b99b2a1e4b530501476ab48422c75f30423fd19 from cluster 127.0.0.1:6383\r\n>>> Sending CLUSTER FORGET messages to the cluster...\r\n>>> SHUTDOWN the node.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u7cfb\u7edf\uff1acentos7.4 \u670d\u52a1\u5668\u91d1\u5c71\u4e91 [root@jsy-bj-test00 ~]# yum install […]<\/p>\n","protected":false},"author":1476,"featured_media":7058,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-169927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1476"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=169927"}],"version-history":[{"count":20,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169927\/revisions"}],"predecessor-version":[{"id":169971,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169927\/revisions\/169971"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/7058"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=169927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=169927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=169927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}