提交 f29d1fb0 编写于 作者: S Salvatore Sanfilippo

assert_empty in redis-trib

上级 8c4c5090
......@@ -43,6 +43,14 @@ class ClusterNode
end
end
def assert_empty
if !(@r.cluster("info").split("\r\n").index("cluster_known_nodes:1")) ||
(@r.info['db0'])
puts "Error: Node #{self} is not empty. Either the node already knows other nodes (check with nodes-info) or contains some key in database 0."
exit 1
end
end
def r
@r
end
......@@ -63,7 +71,7 @@ class RedisTrib
node = ClusterNode.new(n)
node.connect
node.assert_cluster
# node.assert_empty
node.assert_empty
}
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册