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
8f254287
Commit
8f254287
authored
Feb 10, 2014
by
antirez
Browse files
redis-trib: log event after we have reference to 'master'.
parent
cc97305e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
8f254287
...
...
@@ -116,6 +116,7 @@ class ClusterNode
def load_info(o={})
self.connect
nodes = @r.cluster("nodes").split("\n")
puts @r.cluster("nodes")
nodes.each{|n|
# name addr flags role ping_sent ping_recv link_status slots
split = n.split
...
...
@@ -900,8 +901,8 @@ class RedisTrib
next if n == node
if n.info[:replicate] && n.info[:replicate].downcase == id
# Reconfigure the slave to replicate with some other node
xputs
">>>
#{
n
}
as replica of
#{
master
}
"
master = get_master_with_least_replicas
xputs ">>> #{n} as replica of #{master}"
n.r.cluster("replicate",master.info[:name])
end
n.r.cluster("forget",argv[1])
...
...
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