Pdsh安装 (Parallel Distributed Shell)

来源:互联网 发布:以交易为生 知乎 编辑:程序博客网 时间:2024/06/05 02:35

第一种方式: RPM安装

[root@slave1 ~]# rpm -ivh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

[root@slave1 ~]# yum install pdsh -y

#使用rpm包的安装 会有两种形态 一般rsh为默认 

#初始化的系统一般安装会是rsh

#安装了一些包的系统具体不清楚 哪些包 安装时会安装到ssh模块去 如下表:

#rsh的会报错

           

 

rsh状态

  

ssh状态

  

[root@xxx ~]# pdsh  -V

 

pdsh-2.26  (+readline+debug)

 

rcmd modules:  rsh,exec (default: rsh)

 

misc modules:  (none)

  

[root@slave1 ~]#  pdsh -V

 

pdsh-2.26  (+readline+debug)

 

rcmd modules:  ssh,exec (default: ssh)

 

misc modules:  (none)

  

[root@xxx ~]# pdsh  -w xxx hostname

 

pdsh@xxx: xxx: connect: Connection refused

解决办法 编译安装

  

[root@slave1 ~]#  pdsh -w slave1.hadoop.com hostname

 

slave1:  slave1.hadoop.com

 

[root@slave1 ~]# ssh-keygen

[root@slave1 ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub slave2.host.com

[root@slave1 ~]# pdsh -w slave2.host.com hostname

Slave2: slave2.hadoop.com

 

第二种方式:源码安装

[root@xxx ~]# cd /opt/

[root@xxx opt]# yum install wget -y

[root@xxx opt]# wget http://nchc.dl.sourceforge.net/project/pdsh/pdsh/pdsh-2.26/pdsh-2.26.tar.bz2

[root@xxx opt]# ls -l pdsh-2.26.tar.bz2

-rw-r--r--. 1 root root 490732 May  1  2011 pdsh-2.26.tar.bz2

[root@xxx opt]# tar -xf pdsh-2.26.tar.bz2 -C /usr/src/

[root@xxx opt]# cd /usr/src/pdsh-2.26/

[root@xxx opt]# yum install openssh-clients -y

[root@xxx pdsh-2.26]# yum install gcc -y

[root@xxx pdsh-2.26]# ./configure --with-ssh --without-rsh

[root@xxx pdsh-2.26]# make && make install

[root@xxx pdsh-2.26]# pdsh -V

pdsh-2.26

rcmd modules: ssh,exec (default: ssh)

misc modules: (none)

[root@xxx pdsh-2.26]# hostname

xxx

[root@xxx pdsh-2.26]# ssh-keygen

[root@xxx pdsh-2.26]# ssh-copy-id -i /root/.ssh/id_rsa.pub xxx

[root@xxx pdsh-2.26]# pdsh -w xxx hostname

xxx: xxx


0 0