我想要设置具有 6 个节点(node1、node2、node3、node4、node5、node6)的 redis 集群,其中有 3 个主节点和 3 个从节点。每个节点都有这个配置文件
redis.conf
port 6379
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 10000
appendonly yes
创建集群时出现错误。创建命令:
redis-trib.rb create --replicas 1 node1:6379 node2:6379 node3:6379 node4:6379 node5:6379 node6:6379
错误:
>>> Creating cluster
Connecting to node node1:6379: OK
Connecting to node node2:6379: OK
Connecting to node node3:6379: OK
Connecting to node node4:6379: OK
Connecting to node node5:6379: OK
Connecting to node node6:6379: OK
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
node6:6379
node5:6379
node4:6379
Adding replica node3:6379 to node6:6379
Adding replica node2:6379 to node5:6379
Adding replica node1:6379 to node4:6379
S: 1f13819038ba983bb8355f54cb8cec19d2b29e01 node1:6379
replicates 534745088c8b403b81d7e48a22d2e317fb420a38
S: 711461862393664b46d73db6561631f40de29561 node2:6379
replicates f503fe6fd52c73e446267795111ae6ea95495829
S: 204fa4e23b08e2c6ad80b0aca271fc380bc6885d node3:6379
replicates fe6a8e88afdb2796c09fcc873b37ba90c2ba6d79
M: 534745088c8b403b81d7e48a22d2e317fb420a38 node4:6379
slots:10923-16383 (5461 slots) master
M: f503fe6fd52c73e446267795111ae6ea95495829 node5:6379
slots:5461-10922 (5462 slots) master
M: fe6a8e88afdb2796c09fcc873b37ba90c2ba6d79 node6:6379
slots:0-5460,6918 (5462 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
/var/lib/gems/1.8/gems/redis-3.2.2/lib/redis/client.rb:114:in `call': ERR Slot 16011 is already busy (Redis::CommandError)
from /var/lib/gems/1.8/gems/redis-3.2.2/lib/redis.rb:2646:in `method_missing'
from /var/lib/gems/1.8/gems/redis-3.2.2/lib/redis.rb:57:in `synchronize'
from /usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from /var/lib/gems/1.8/gems/redis-3.2.2/lib/redis.rb:57:in `synchronize'
from /var/lib/gems/1.8/gems/redis-3.2.2/lib/redis.rb:2645:in `method_missing'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:205:in `flush_node_config'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:667:in `flush_nodes_config'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:666:in `each'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:666:in `flush_nodes_config'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:1007:in `create_cluster_cmd'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:1388:in `send'
from /home/hadoop/projects/ramin/redis-3.0.5/src/redis-trib.rb:1388
我也做了这些,但也得到了同样的错误信息
最佳答案
@thepirat000 怎么说(在所有节点中执行 FLUSHALL 然后 CLUSTER RESET SOFT)我还将主机名更改为 IP 地址
关于redis - ERR Slot xxx 已经忙 (Redis::CommandError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34230131/
有没有一种简单的方法可以判断ruby脚本是否已经在运行,然后适本地处理它?例如:我有一个名为really_long_script.rb的脚本。我让它每5分钟运行一次。当它运行时,我想看看之前运行的是否还在运行,然后停止第二个脚本的执行。有什么想法吗? 最佳答案 ps是一种非常糟糕的方法,并且可能会出现竞争条件。传统的Unix/Linux方法是将PID写入文件(通常在/var/run中)并在启动时检查该文件是否存在。例如pid文件位于/var/run/myscript.pid然后你会在运行程序之前检查它是否存在。有一些技巧可以避免
我有一台生产机器和一台开发机器,都运行ubuntu8.10并且都运行最新的phusionpassenger。当我在osx上的本地开发机器上使用ruby1.9.1时,我想知道外面的人是否已经在使用带有ruby1.9.1甚至1.9.2的phusionpassenger?如果是这样,请告诉我们您的设置!此外,有没有办法在apache上使用phusionpassenger同时运行ruby1.8.7(ree)和1.9.1?感谢您的指点,我在任何地方都找不到任何提示... 最佳答案 是的,从某些2.2.x版本开始就正式支持它,我不记
我有以下正则表达式regexp=%r{((returned|undelivered)\smail|mail\sdelivery(\sfailed)?)}x但是当我在上面运行rubocop时,它会提示我需要“在正则表达式周围使用//”。我怎样才能绕过它? 最佳答案 您可以通过将.rubocop.yml文件添加到项目文件夹的根目录并设置适当的配置来禁用(和启用)任何rubocopcop。要查看您可以做什么,请查看rubocop包中的全局default.yml。它有完整的评论。对于这个特殊问题,创建一个.rubocop.yml和...要完
我今天遇到了同样的问题,有一个建议:在您的命令前添加bundleexec可能会解决此问题。前置bundleexec没有帮助(我已经这样做了)。springstop和springrestart没有帮助。我需要做的:bundleupdatespring这对我有用。在之前的gemlock文件中使用spring版本是否有更好的解决方案? 最佳答案 我删除gemfile.lock并运行bundle通常会清除一切。否则只需从Gemfile中删除gem"spring"并运行bundle 关于ruby-
这个问题在这里已经有了答案:YouhavealreadyactivatedX,butyourGemfilerequiresY(11个答案)关闭8年前。我正在尝试运行一个简单的rake任务。当我这样做时,出现以下错误:无法为[]激活rake(=0.9.2.2,运行时),已经为[]激活了rake-10.0.2我运行gemlist命令,它列出了具有10.0.3、0.9.2.2和0.8.7的rake。因此,我输入gemuninstallrake-v10.0.3。根据提示,卸载成功-但当我执行gem列表时版本10.0.3仍然存在-当我尝试运行任何rake任务时,我仍然遇到完全相同的问题。有什么建
我想对一个gem进行猴子修补,目标代码在一个模块中。不幸的是,在我预先准备我的补丁时,该模块已经包含在各种类中,新代码无效。例子:moduleFeaturedefactionputs"Feature"endendmodulePatchdefactionputs"Patch"endendclassBase1includeFeatureendFeature.prependPatchclassBase2includeFeatureendBase1.new.action#Returns"Feature",Iwantittobe"Patch"instead.Base2.new.action#Re
我知道||=运算符,但我认为它不会对我有帮助...尝试创建一个数组来计算对象数组中“类型”的数量。array.eachdo|c|newarray[c.type]=newarray[c.type]?newarray[c.type]+1?0end有没有更优雅的方式来做到这一点? 最佳答案 types=Hash.new(-1)#Itfeelslikethisshouldbe0,buttobe#equivalenttoyourexampleitneedstobe-1array.eachdo|c|types[c.type]+=1end
这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Rake“alreadyinitializedconstantWFKV_”warning当我使用任何ruby、rake或rails相关命令时,我在终端中收到此错误。命令正在执行并且工作正常,但在此之前我收到了他的错误。有什么建议么?谢谢指教!.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53:warning:alreadyinitializedconstantWFKV_
如何使用已有值的键在Hash对象中追加一个值。例如如果我有>>my_hash=Hash.new>>my_hash[:my_key]="Value1"#thenappendavalue,letssay"Value2"tomyhash,usingthatsamekey"my_key"#sothatitcanbe>>my_hash[:my_key]=>["Value1","Value2"]我知道编写自己的方法很容易,但我只是想知道是否有内置方法。 最佳答案 我不知道我是否没有理解您的观点,但您是否考虑过以下问题:1.9.3(main):0
在Ruby脚本中加载PryREPL我得到了这个奇怪的错误:before_sessionhookfailed:Pry::CommandError:Cannotlocatethismethod:load.~/.rvm/gems/ruby-2.0.0-p195/gems/pry-0.9.12.2/lib/pry/method.rb:498:in`pry_doc_info'(see_pry_.hooks.errorstodebug)知道问题出在哪里吗?注意事项:1.除了那个神秘的消息之外,代码似乎执行得很好,并且2.我找不到“_pry_.hooks.errors”文件