安装polysh
节点 | IP | 系统 | 功能 | CPU | 内存 | 硬盘 |
---|
node1 | 10.80.10.1 | centos7.9 | polysh | 4核心 | 8GB | 20GB |
node2 | 10.80.10.2 | centos7.9 | | 4核心 | 8GB | 20GB |
node3 | 10.80.10.3 | centos7.9 | | 4核心 | 8GB | 20GB |
node1
下载安装polysh:
下载网址:http://guichaz.free.fr/polysh/
1 2 3 4 5
| # cd /usr/local/src/ # wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gz # tar -xzvf polysh-0.4.tar.gz # cd polysh-0.4 # python setup.py install --home=~/polysh
|
添加polysh环境变量:
1 2 3 4
| # vim ~/.bash_profile # 尾行,添加配置 export PATH=$PATH:~/polysh/bin export PYTHONPATH=$PYTHONPATH:~/polysh/lib/python
|
1 2 3
| # source ~/.bash_profile # polysh --version polysh 0.4
|
配置ssh免密:
1 2 3 4 5
| # ssh-keygen 回车 回车 回车 # for i in {1,2,3}; do ssh-copy-id 10.80.10.${i}; done
|
连接一台主机:
1 2 3 4 5 6
| # polysh 10.80.10.2 ready (1)> ls 10.80.10.2 : anaconda-ks.cfg 10.80.10.2 : /root ready (1)> exit 10.80.10.2 : exit
|
连接多台主机:
1 2 3 4 5 6 7 8 9 10
| # polysh 10.80.10.2 10.80.10.3 ready (2)> ls 10.80.10.3 : anaconda-ks.cfg 10.80.10.2 : anaconda-ks.cfg ready (2)> pwd 10.80.10.3 : /root 10.80.10.2 : /root ready (2)> exit 10.80.10.3 : exit 10.80.10.2 : exit
|
读取主机文件进行连接:
1 2 3
| # vim ~/hosts 10.80.10.2 10.80.10.3
|
1 2 3 4 5 6 7 8 9 10
| # polysh --hosts-file ~/hosts ready (2)> ls 10.80.10.2 : anaconda-ks.cfg 10.80.10.3 : anaconda-ks.cfg ready (2)> hostname 10.80.10.3 : node3 10.80.10.2 : node2 ready (2)> exit 10.80.10.3 : exit 10.80.10.2 : exit
|