pssh进行并行批量操作
来源:互联网 发布:淘宝卖高仿不死的方法 编辑:程序博客网 时间:2024/05/01 23:33
pssh是一个python编写可以在多台服务器上批量执行命令的工具
前提必须每台服务器添加管理服务器的的密钥认证访问
安装
sudo apt-get install pssh
创建需要管理的服务器的用户和IP文件
root@ubuntu:/home/hu# cat lvs.txt root@10.10.100.51root@10.10.100.53
pssh 多主机并行运行命令
hu@ubuntu:~$ pssh -h lvs.txt -i 'pwd'[1] 21:03:51 [SUCCESS] root@10.10.100.51/root[2] 21:03:51 [SUCCESS] root@10.10.100.53/root
或者
hu@ubuntu:~$ pssh -H root@10.10.100.51 -i 'pwd'[1] 21:04:26 [SUCCESS] root@10.10.100.51/root
pscp 把文件并行地复制到多个主机上
hu@ubuntu:~$ touch /tmp/a1hu@ubuntu:~$ pscp -h lvs.txt /tmp/a1 /tmp/[1] 21:06:44 [SUCCESS] root@10.10.100.51[2] 21:06:44 [SUCCESS] root@10.10.100.53hu@ubuntu:~$ pssh -h lvs.txt -i 'ls /tmp/a1'[1] 21:07:21 [SUCCESS] root@10.10.100.51/tmp/a1[2] 21:07:21 [SUCCESS] root@10.10.100.53/tmp/a1
pslurp 将文件从远程主机复制到本地,和pscp方向相反
hu@ubuntu:~$ pslurp -h lvs.txt -L /tmp/ -l root /tmp/a1 a2[1] 21:10:46 [SUCCESS] 10.10.100.51[2] 21:10:46 [SUCCESS] 10.10.100.53
标示将目标服务器的/tmp/a1文件复制到本地的/tmp/目录下,并更名为a2
hu@ubuntu:~$ ll /tmp/10.10.100.*/tmp/10.10.100.51:总用量 24drwxrwxr-x 2 hu hu 4096 2月 13 21:10 ./drwxrwxrwt 12 root root 20480 2月 13 21:10 ../-rw-r--r-- 1 hu hu 0 2月 13 21:10 a2/tmp/10.10.100.53:总用量 24drwxrwxr-x 2 hu hu 4096 2月 13 21:10 ./drwxrwxrwt 12 root root 20480 2月 13 21:10 ../-rw-r--r-- 1 hu hu 0 2月 13 21:10 a2
pnuke 并行在远程主机杀进程
hu@ubuntu:~$ pnuke -h lvs.txt nginx[1] 21:12:22 [SUCCESS] root@10.10.100.51[2] 21:12:22 [SUCCESS] root@10.10.100.53
杀死目标服务器的nginx进程,只要ps进程中出现相关词语
0 0
- pssh进行并行批量操作
- 使用pssh进行并行批量操作
- 使用pssh进行并行批量操作
- 使用pssh进行并行批量操作
- 使用pssh进行并行批量操作
- PSSH,PDSH,MUSSH并行批量操作
- 使用PSSH批量SSH操作Linux服务器
- 使用PSSH批量SSH操作Linux服务器
- 使用PSSH批量操作Linux服务器
- 并行脚本执行pssh
- pssh 服务器批量管理
- 使用pssh批量管理服务器
- 服务器批量执行工具 PSSH
- 使用pssh批量管理服务器
- Linux下批量管理工具pssh
- 并行SSH运维工具pssh
- 通过shell脚本批量部署ssh私钥认证以及批量操作工具pssh的简单使用
- pssh
- 针对不同分辨率设置的布局没有效果的解决办法
- SASS ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/sass
- 重载和重写的区别
- 关键词static
- 【深度学习】初次接触
- pssh进行并行批量操作
- iOS开发-用ZipArchive添加和解压zip包
- 关于工作
- Android Wear 进阶 - 4 发送和同步数据 <Sending and Syncing Data>
- php 执行操作符输出服务器执行命令乱码转换 iconv
- html5 css3 颜色表示和透明度设置
- 15. 3Sum
- Android 手机屏幕录制
- 从头认识Spring-2.3 注解装配-@autowired(3)-通过构造器方法注入