How do you run a custom task against multiple servers using capistrano?
I'm playing around with a cluster to run some load tests. How can I run a command on all of them? This works fine:
role :lt1, "root@184.106.65.194"
role :lt2, "root@184.106.70.52"
role :lt3, "root@184.106.69.138"
role :lt4, "root@184.106.70.42"
role :lt5, "root@184.106.70.90"
role :lt6, "root@184.106.98.158"
role :lt7, "root@184.106.70.89"
role :lt8, "root@184.106.70.58"
role :lt9, "root@184.106.64.187"
role :lt10, "root@184.106.97.57"
task :date, :roles => [:lt1] do
run "date"
end
But the minute I try to change :roles
to [:lt1, :lt2]
, it just hangs forever.
I've also tried almost the exact same thing with servers that have named addresses (example.something.com
), and it works fine.
What's the right way to do this, and how can I avoid it hanging?
When I only do one:
* executing `date'
* executing "date"
servers: ["184.106.65.194"]
[root@184.106.65.194] executing command
** [out :: root@184.106.65.194] Wed Jan 26 19:56:16 UTC 2011
command finished
When I开发者_如何学运维 do two
* executing `date'
* executing "date"
servers: ["184.106.65.194", "184.106.70.52"]
Updating to capistrano v2.5.19 seems to have fixed it.
精彩评论