mirror of
https://github.com/fluencelabs/redis
synced 2025-03-26 04:11:04 +00:00
Cluster: redis-trib updated to use 16384 hash slots.
This commit is contained in:
parent
ebd666db47
commit
a26690e8b5
@ -24,7 +24,7 @@
|
|||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'redis'
|
require 'redis'
|
||||||
|
|
||||||
ClusterHashSlots = 4096
|
ClusterHashSlots = 16384
|
||||||
|
|
||||||
def xputs(s)
|
def xputs(s)
|
||||||
printf s
|
printf s
|
||||||
@ -238,10 +238,10 @@ class RedisTrib
|
|||||||
@nodes.each{|n|
|
@nodes.each{|n|
|
||||||
slots = slots.merge(n.slots)
|
slots = slots.merge(n.slots)
|
||||||
}
|
}
|
||||||
if slots.length == 4096
|
if slots.length == ClusterHashSlots
|
||||||
puts "[OK] All 4096 slots covered."
|
puts "[OK] All #{ClusterHashSlots} slots covered."
|
||||||
else
|
else
|
||||||
errors << "[ERR] Not all 4096 slots are covered by nodes."
|
errors << "[ERR] Not all #{ClusterHashSlots} slots are covered by nodes."
|
||||||
puts errors[-1]
|
puts errors[-1]
|
||||||
end
|
end
|
||||||
return errors
|
return errors
|
||||||
@ -384,8 +384,8 @@ class RedisTrib
|
|||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
numslots = 0
|
numslots = 0
|
||||||
while numslots <= 0 or numslots > 4096
|
while numslots <= 0 or numslots > ClusterHashSlots
|
||||||
print "How many slots do you want to move (from 1 to 4096)? "
|
print "How many slots do you want to move (from 1 to #{ClusterHashSlots})? "
|
||||||
numslots = STDIN.gets.to_i
|
numslots = STDIN.gets.to_i
|
||||||
end
|
end
|
||||||
target = nil
|
target = nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user