Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a26690e8
Commit
a26690e8
authored
Feb 14, 2013
by
antirez
Browse files
Cluster: redis-trib updated to use 16384 hash slots.
parent
ebd666db
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
a26690e8
...
...
@@ -24,7 +24,7 @@
require
'rubygems'
require
'redis'
ClusterHashSlots
=
4096
ClusterHashSlots
=
16384
def
xputs
(
s
)
printf
s
...
...
@@ -238,10 +238,10 @@ class RedisTrib
@nodes
.
each
{
|
n
|
slots
=
slots
.
merge
(
n
.
slots
)
}
if
slots
.
length
==
4096
puts
"[OK] All
4096
slots covered."
if
slots
.
length
==
ClusterHashSlots
puts
"[OK] All
#{
ClusterHashSlots
}
slots covered."
else
errors
<<
"[ERR] Not all
4096
slots are covered by nodes."
errors
<<
"[ERR] Not all
#{
ClusterHashSlots
}
slots are covered by nodes."
puts
errors
[
-
1
]
end
return
errors
...
...
@@ -384,8 +384,8 @@ class RedisTrib
exit
1
end
numslots
=
0
while
numslots
<=
0
or
numslots
>
4096
print
"How many slots do you want to move (from 1 to
4096
)? "
while
numslots
<=
0
or
numslots
>
ClusterHashSlots
print
"How many slots do you want to move (from 1 to
#{
ClusterHashSlots
}
)? "
numslots
=
STDIN
.
gets
.
to_i
end
target
=
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment