一、Polysh简介
Polysh 是一个交互式命令,可以在一台服务器上批量的对一批服务器进行处理,运行交互式命令。Polysh可以同时登录多个远程主机,而不需要通过relay一台一台的登录,并执行相同的指令,方便了问题的排查和定位,大大减少了我们的工作量。
Polysh is a tool to aggregate several remote shells into one. It is used to launch an interactive remote shell on many machines at once. It is written in Python and requires Python ≥ 2.4.
注: 官方解释:Polysh 是一个由几个远程脚本集合而成的工具,它被用于在许多服务器上运行一个交互式的远程脚本,由 Python 编写,最低要求为 Python 2.4 。
二、polysh安装
通过relay登录staging机器,执行如下命令安装polysh。安装目录为用户目录: /opt/hl/。
1.已安装python的安装
wget wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gz tar -zxvf polysh-0.4.tar.gz vim prod-polysh.sh
脚本内容如下:
#10.252.176.33,10.252.176.35是你要链接的机器ip python /opt/hl/polysh-0.4/polysh.py {10.252.176.33,10.252.176.35}
开放给其他用户可执行的权限
chmod 777 prod-polysh.sh
2.未安装python的安装
wget wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gz tar -zxvf polysh-0.4.tar.gz cd polysh-0.4 su python setup.py install vim prod-polysh.sh
脚本内容如下:
#10.252.176.33,10.252.176.35是你要链接的机器ip python /opt/hl/polysh-0.4/polysh.py {10.252.176.33,10.252.176.35}
开放给其他用户可执行的权限
chmod 777 prod-polysh.sh
三、Xshell配置Xagent(mac可跳过这一步)
打开文件-属性,选择SSH选项,选择”使用密码处理的Xagent(SSH代理)”。然后将Xshell重启。
四、polysh使用
4.1.使用方法一
polysh 10.252.176.33 10.252.176.35
4.2.使用方法二
./prod-polysh.sh
则会出现如下提示信息
[---hl-----]$ ./prod-polysh.sh ready (8)
ready (8) 表示 8台机器已经连接完毕,可以执行查询命令。exit或Crtl+z都可以退出。
4.3.执行命令
ready (8)>cd /opt/hl ready (8)>pwd
显示如下:
10.252.176.33: /opt/hl 10.252.176.35 : /opt/hl
五、源码
可以通过git获取polysh的源码
git clone git://repo.or.cz/polysh.git
六、其他
以冒号开头的指令不会发送到远程主机,polysh会执行以冒号开头的指令,例如:
ready (2)> :help :add Add one or many remote shells. :chdir Change the current directory of polysh (not the remote shells). :disable Disable sending commands to remote shells. :enable Enable sending commands to remote shells. :export_vars Export some environment variables on enabled remote shells. :help List control commands or show their documentations. :hide_password Do not echo the next typed line. :list List remote shells and their states. :purge Delete disabled remote shells. :quit Quit polysh. :reconnect Try to reconnect to disconnected remote shells. :rename Rename all enabled remote shells with the argument. :replicate Copy a path from one remote shell to all others :reset_prompt Change the prompt to be recognized by polysh. :send_ctrl Send a control character to remote shells. :set_debug Enable or disable debugging output for remote shells. :set_log Duplicate every console I/O into the given local file. :show_read_buffer Print the data read by remote shells. :upload Upload the specified local path to enabled remote shells.
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对的支持。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]