我听说过,pssh并且clusterssh是两个流行的,但我想我会在这里打开它进行讨论,看看社区对这些工具的体验是什么?有什么问题?任何体面的黑客或用例?
use*_*321 23
我使用过 pssh,它很简单,而且效果很好。它非常适合快速查询。
如果您发现自己在管理服务器,我建议您使用更强大且稍有不同的领域(配置管理),例如 Puppet 或 CFEngine。
Its important to know what you want to do. If you want to run 'apt-get update' on lots of servers, clusterssh is reportedly an easy-to use and effective tool. See Kyle Rankin's article on clusterssh at the Linux Journal.
If your work on different servers will require logic loops, putting, getting or otherwise interacting with each host (or possibly having to interact with a host because of an error condition) a tool such as Fabric (which has just hit its 1.0 release) is invaluable. You'll probably enjoy most using Fabric if you are a pythonista.
In either case one is probably expecting to do fairly simple tasks on the remote servers affected, and dropping in specially on any problem hosts. However Fabric provides more options for dealing with variation.
通常处理得不好的一件事是处理网关主机后面的多个主机,需要先连接到网关,然后从那里进行端口转发。由于 ssh 本身很简单,因此可以将自己的.ssh/config文件设置为类似
Host gateway
Port 9000
User remoteadmin
HostName datacentre1.com
# mail
LocalForward 9100 192.168.9.11:22
# phones
LocalForward 9101 192.168.9.12:22
Host dc1mail
Port 9100
Host 127.0.0.1
User localadmin
Host dc1phones
Port 9201
Host 127.0.0.1
User localadmin
Run Code Online (Sandbox Code Playgroud)
为了做与ssh dc1mail 'cmd'&&的等价物,ssh dc1phones 'cmd'必须首先提出ssh gateway. 如果像 clustersh 和 Fabric 这样的工具允许将其作为其工具的一部分来完成,那就太好了。当然,您可以自己手动完成此操作。
| 归档时间: |
|
| 查看次数: |
31017 次 |
| 最近记录: |