python實現的集羣批量命令工具,很是方便集羣管理。同時其還帶有pscp等功能python
在合適的目錄下,這裏本機爲/softlinux
輸入命令 wget https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz bash
1 [root@hadoop001 soft]# wget https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz 2 --2020-10-23 15:46:29-- https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz 3 正在解析主機 pypi.python.org (pypi.python.org)... 151.101.76.223, 2a04:4e42:12::223 4 正在鏈接 pypi.python.org (pypi.python.org)|151.101.76.223|:443... 已鏈接。 5 已發出 HTTP 請求,正在等待迴應... 301 Redirect to Primary Domain 6 位置:https://pypi.org/packages/source/p/pssh/pssh-2.3.1.tar.gz [跟隨至新的 URL] 7 --2020-10-23 15:46:30-- https://pypi.org/packages/source/p/pssh/pssh-2.3.1.tar.gz 8 正在解析主機 pypi.org (pypi.org)... 151.101.128.223, 151.101.0.223, 151.101.64.223, ... 9 正在鏈接 pypi.org (pypi.org)|151.101.128.223|:443... 已鏈接。 10 已發出 HTTP 請求,正在等待迴應... 301 Moved Permanently 11 位置:https://files.pythonhosted.org/packages/source/p/pssh/pssh-2.3.1.tar.gz [跟隨至新的 URL] 12 --2020-10-23 15:46:37-- https://files.pythonhosted.org/packages/source/p/pssh/pssh-2.3.1.tar.gz 13 正在解析主機 files.pythonhosted.org (files.pythonhosted.org)... 151.101.1.63, 151.101.65.63, 151.101.129.63, ... 14 正在鏈接 files.pythonhosted.org (files.pythonhosted.org)|151.101.1.63|:443... 已鏈接。 15 已發出 HTTP 請求,正在等待迴應... 302 Found 16 位置:https://files.pythonhosted.org/packages/60/9a/8035af3a7d3d1617ae2c7c174efa4f154e5bf9c24b36b623413b38be8e4a/pssh-2.3.1.tar.gz [跟隨至新的 URL] 17 --2020-10-23 15:46:38-- https://files.pythonhosted.org/packages/60/9a/8035af3a7d3d1617ae2c7c174efa4f154e5bf9c24b36b623413b38be8e4a/pssh-2.3.1.tar.gz 18 再次使用存在的到 files.pythonhosted.org:443 的鏈接。 19 已發出 HTTP 請求,正在等待迴應... 200 OK 20 長度:23427 (23K) [application/octet-stream] 21 正在保存至: 「pssh-2.3.1.tar.gz」 22 23 100%[======================================================================================================>] 23,427 66.2KB/s 用時 0.3s 24 25 2020-10-23 15:46:39 (66.2 KB/s) - 已保存 「pssh-2.3.1.tar.gz」 [23427/23427]) 26 27 [root@hadoop001 soft]# ll 28 總用量 165932 29 -rw-r--r--. 1 root root 169889024 9月 22 06:30 jdk-15.0.1_linux-x64_bin.rpm 30 -rw-r--r--. 1 root root 23427 2月 27 2020 pssh-2.3.1.tar.gz
新建一個目錄programapp
解壓到program目錄python2.7
1 [root@hadoop001 soft]# mkdir /program 2 [root@hadoop001 soft]# tar -xf pssh-2.3.1.tar.gz -C /program 3 [root@hadoop001 soft]# cd /program 4 [root@hadoop001 program]# ll 5 總用量 0 6 drwxrwxr-x. 6 1000 1000 149 2月 3 2012 pssh-2.3.1 7 [root@hadoop001 program]#
進入pssh目錄,輸入命令ssh
cd pssh-2.3.1 python setup.py build python setup.py install
而後再輸入 pssh --version 查看版本
1 [root@hadoop001 program]# cd pssh-2.3.1/ 2 [root@hadoop001 pssh-2.3.1]# pssh --version 3 -bash: pssh: 未找到命令 4 [root@hadoop001 pssh-2.3.1]# python setup.py build 5 running build 6 running build_py 7 creating build 8 creating build/lib 9 creating build/lib/psshlib 10 copying psshlib/psshutil.py -> build/lib/psshlib 11 copying psshlib/askpass_client.py -> build/lib/psshlib 12 copying psshlib/manager.py -> build/lib/psshlib 13 copying psshlib/version.py -> build/lib/psshlib 14 copying psshlib/__init__.py -> build/lib/psshlib 15 copying psshlib/color.py -> build/lib/psshlib 16 copying psshlib/task.py -> build/lib/psshlib 17 copying psshlib/cli.py -> build/lib/psshlib 18 copying psshlib/askpass_server.py -> build/lib/psshlib 19 running build_scripts 20 creating build/scripts-2.7 21 copying and adjusting bin/pssh -> build/scripts-2.7 22 copying and adjusting bin/pnuke -> build/scripts-2.7 23 copying and adjusting bin/prsync -> build/scripts-2.7 24 copying and adjusting bin/pslurp -> build/scripts-2.7 25 copying and adjusting bin/pscp -> build/scripts-2.7 26 copying and adjusting bin/pssh-askpass -> build/scripts-2.7 27 changing mode of build/scripts-2.7/pssh from 644 to 755 28 changing mode of build/scripts-2.7/pnuke from 644 to 755 29 changing mode of build/scripts-2.7/prsync from 644 to 755 30 changing mode of build/scripts-2.7/pslurp from 644 to 755 31 changing mode of build/scripts-2.7/pscp from 644 to 755 32 changing mode of build/scripts-2.7/pssh-askpass from 644 to 755 33 [root@hadoop001 pssh-2.3.1]# python setup.py install 34 running install 35 running build 36 running build_py 37 running build_scripts 38 running install_lib 39 creating /usr/lib/python2.7/site-packages/psshlib 40 copying build/lib/psshlib/psshutil.py -> /usr/lib/python2.7/site-packages/psshlib 41 copying build/lib/psshlib/askpass_client.py -> /usr/lib/python2.7/site-packages/psshlib 42 copying build/lib/psshlib/manager.py -> /usr/lib/python2.7/site-packages/psshlib 43 copying build/lib/psshlib/version.py -> /usr/lib/python2.7/site-packages/psshlib 44 copying build/lib/psshlib/__init__.py -> /usr/lib/python2.7/site-packages/psshlib 45 copying build/lib/psshlib/color.py -> /usr/lib/python2.7/site-packages/psshlib 46 copying build/lib/psshlib/task.py -> /usr/lib/python2.7/site-packages/psshlib 47 copying build/lib/psshlib/cli.py -> /usr/lib/python2.7/site-packages/psshlib 48 copying build/lib/psshlib/askpass_server.py -> /usr/lib/python2.7/site-packages/psshlib 49 byte-compiling /usr/lib/python2.7/site-packages/psshlib/psshutil.py to psshutil.pyc 50 byte-compiling /usr/lib/python2.7/site-packages/psshlib/askpass_client.py to askpass_client.pyc 51 byte-compiling /usr/lib/python2.7/site-packages/psshlib/manager.py to manager.pyc 52 byte-compiling /usr/lib/python2.7/site-packages/psshlib/version.py to version.pyc 53 byte-compiling /usr/lib/python2.7/site-packages/psshlib/__init__.py to __init__.pyc 54 byte-compiling /usr/lib/python2.7/site-packages/psshlib/color.py to color.pyc 55 byte-compiling /usr/lib/python2.7/site-packages/psshlib/task.py to task.pyc 56 byte-compiling /usr/lib/python2.7/site-packages/psshlib/cli.py to cli.pyc 57 byte-compiling /usr/lib/python2.7/site-packages/psshlib/askpass_server.py to askpass_server.pyc 58 running install_scripts 59 copying build/scripts-2.7/pssh -> /usr/bin 60 copying build/scripts-2.7/pnuke -> /usr/bin 61 copying build/scripts-2.7/prsync -> /usr/bin 62 copying build/scripts-2.7/pslurp -> /usr/bin 63 copying build/scripts-2.7/pscp -> /usr/bin 64 copying build/scripts-2.7/pssh-askpass -> /usr/bin 65 changing mode of /usr/bin/pssh to 755 66 changing mode of /usr/bin/pnuke to 755 67 changing mode of /usr/bin/prsync to 755 68 changing mode of /usr/bin/pslurp to 755 69 changing mode of /usr/bin/pscp to 755 70 changing mode of /usr/bin/pssh-askpass to 755 71 running install_data 72 creating /usr/man 73 creating /usr/man/man1 74 copying man/man1/pssh.1 -> /usr/man/man1 75 copying man/man1/pscp.1 -> /usr/man/man1 76 copying man/man1/prsync.1 -> /usr/man/man1 77 copying man/man1/pslurp.1 -> /usr/man/man1 78 copying man/man1/pnuke.1 -> /usr/man/man1 79 running install_egg_info 80 Writing /usr/lib/python2.7/site-packages/pssh-2.3.1-py2.7.egg-info 81 [root@hadoop001 pssh-2.3.1]# pssh --version 82 2.3.1 83 [root@hadoop001 pssh-2.3.1]#