]>
git.saurik.com Git - redis.git/blob - src/redis-trib.rb
8456ed29f884e988ada61982a7f723799b83ef67
15 puts
"Invalid node name #{node}"
27 xputs
"Connecting to node #{self}: "
29 @r = Redis
.new(:host => @ost, :port => @port)
33 puts
"Sorry, can't connect to node #{self}"
40 if !info
["cluster_enabled"] || info
["cluster_enabled"].to_i
== 0
41 puts
"Error: Node #{self} is not configured as a cluster node."
52 def check_arity(req_args
, num_args
)
53 if ((req_args
> 0 and num_args !
= req_args
) ||
54 (req_args
< 0 and num_args
< req_args
.abs
))
55 puts
"Wrong number of arguments for specified sub command"
61 puts
"Creating cluster"
63 node
= ClusterNode
.new(n
)
72 "create-cluster" => ["create_cluster", -2]
77 puts
"Usage: redis-trib <command> <arguments ...>"
82 cmd_spec
= COMMANDS
[ARGV[0].downcase
]
84 puts
"Unknown redis-trib subcommand '#{ARGV[0]}'"
87 rt
.check_arity(cmd_spec
[1],ARGV.length
)