Monday, September 28, 2015

[Cluster]: Install Pdsh on CentOS 6

Install Pdsh on CentOS 6

This video will guide you on installing pdsh (parallel distributed shell) on CentOS 6.x

1. Install the following prerequisites:
yum install readline-devel ncurses-devel pam-devel make gcc gcc-c++ rsh rpm-build -y

2. Create the following user(to avoid building erros) and give it a password:
useradd -u 6885 dennis
passwd dennis

3. Log in as the user and download the source file from the project's website:
su - dennis
wget 
https://pdsh.googlecode.com/files/pdsh-2.29.tar.bz2
4. Build an RPM out of it using the following flags:
rpmbuild -tb --with machines pdsh-2.29.tar.bz2

5. Install the created RPMs as root:
su -
cd /home/dennis/rpmbuild/RPMS/x86_64
yum install *.rpm -y

6. Logout the user and delete it if you want:
exit
exit
userdel -r dennis

7. Make sure all the requested nodes have an IP in /etc/hosts:
cat /etc/hosts

10.0.0.1 node1
10.0.0.2 node2
10.0.0.3 node3
10.0.0.4 node4
10.0.0.5 node5
10.0.0.6 node6
10.0.0.7 node7

8. Make sure all nodes have passwordless ssh login if not run the following:
ssh-keygen (if needed)
for i in localhost node{1..7}; do ssh-copy-id $i;done

9. Update the machines file:
vi /etc/machines

node1
node2
node3
node4
node5
node6
node7

10. Test pdsh using:
pdsh -a uptime
pdsh -a date
pdsh -a uname -r 
(-a stands for all)

No comments: