爱奇艺花样滑冰教程:批量管理服务器工具:pssh
来源:百度文库 编辑:偶看新闻 时间:2024/05/07 01:39:06
pssh是一个可以在多台服务器上执行命令的工具,同时支持拷贝文件,是同类工具中很出色的。使用是必须在各个服务器上配置好密钥认证访问。
pssh 包安装 5 个实用程序:
parallel-ssh 在多个主机上并行地运行命令。
parallel-scp 把文件并行地复制到多个主机上。
parallel-rsync 通过 rsync 协议把文件高效地并行复制到多个主机上。
parallel-slurp 把文件并行地从多个远程主机复制到中心主机上。
parallel-nuke 并行地在多个远程主机上杀死进程。
1、安装
view plaincopy to clipboardprint?- #debain系列
- apt-get install pssh
- #redhat系列
- yum -y install pssh
#debain系列apt-get install pssh#redhat系列yum -y install pssh
2、简单使用
view plaincopy to clipboardprint?- Usage: pssh [OPTIONS] -h hosts.txt prog [arg0] ..
- -h --hosts hosts file (each line "host[:port] [user]")
- -l --user username (OPTIONAL)
- -p --par max number of parallel threads (OPTIONAL)
- -o --outdir output directory for stdout files (OPTIONAL)
- -e --errdir output directory for stderr files (OPTIONAL)
- -t --timeout timeout in seconds to do ssh to a host (OPTIONAL)
- -v --verbose turn on warning and diagnostic messages (OPTIONAL)
- -O --options SSH options (OPTIONAL)
- -P --print print output as we get it (OPTIONAL)
- -i --inline inline aggregated output for each server (OPTIONAL)
- Example: pssh -h nodes.txt -l irb2 -o /tmp/foo uptime
Usage: pssh [OPTIONS] -h hosts.txt prog [arg0] ..-h --hosts hosts file (each line "host[:port] [user]")-l --user username (OPTIONAL)-p --par max number of parallel threads (OPTIONAL)-o --outdir output directory for stdout files (OPTIONAL)-e --errdir output directory for stderr files (OPTIONAL)-t --timeout timeout in seconds to do ssh to a host (OPTIONAL)-v --verbose turn on warning and diagnostic messages (OPTIONAL)-O --options SSH options (OPTIONAL)-P --print print output as we get it (OPTIONAL)-i --inline inline aggregated output for each server (OPTIONAL)Example: pssh -h nodes.txt -l irb2 -o /tmp/foo uptime
创建主机名列表:
view plaincopy to clipboardprint?- vi nodes.txt
- 192.168.1.101
- 192.168.1.102
- 192.168.1.103
- 192.168.1.104
vi nodes.txt192.168.1.101192.168.1.102192.168.1.103192.168.1.104
在各主机执行命令:w
- parallel-ssh -h nodes.txt -l root -P w
parallel-ssh -h nodes.txt -l root -P w
复制文件到各主机
- parallel-scp -h nodes.txt -l root test.txt /tmp/test.txt-scp
rar 批量解压工具
字符批量替换工具
自动批量溢出工具
什么是批量管理?
管理腾讯的店铺有像淘宝的"淘宝代理"那样的商品批量上传的工具吗?
批量改变图片尺寸的工具
求:图片批量优化工具
PDF电子书批量修改工具?
求批量解图工具
qq空间批量上传工具
qq相册批量上传工具
求文件名批量重命名工具
kaHt2 RPC批量溢出工具使用方法~
flash转GIF的批量转换工具
求批量转换工具:Rmvb to mp3
跪求:批量处理图片的工具
谁给个批量上传工具!!!
求批量去图片水印工具
有无批量修复FLASH动画的工具
谁有批量注册邮箱的工具???????????
谁有批量注册邮箱的工具???
求批量修改网页的工具!
Qzone照片批量上传工具下载
哪里有批量灌水,刷屏用的工具?