Setting up ClusterIt (DSH)

Install from source

Make sur you’ve got GCC and shit as well as curses.h & X11/Xlib.h to compile the source.

Slackware

apt install libX11 xorgproto libxcb libXau libXdmcp

RHEL

yum groupinstall "Development Tools"
yum install libX11-devel ncurses-devel

Debian/Ubuntu

apt install build-essential libx11-dev libncurses5-dev

Fetch, extract and install ClusterIt

wget https://downloads.sourceforge.net/project/clusterit/clusterit/clusterit-2.5/clusterit-2.5.tar.gz
# http://prdownloads.sourceforge.net/clusterit/clusterit-2.5.tar.gz
tar xzf clusterit-2.5.tar.gz
cd clusterit-2.5/
./configure --sysconfdir=/etc --localstatedir=/var
echo $MAKEFLAGS
make
make install

which dsh

Setup

as user

Make sure you’ve set up SSH without a password from the clusterit system against the target hosts.

Make sure your SSH client is setup already

vi ~/.ssh/config

Setup a few needed variables on the system,

cp -pi ~/.profile ~/.profile.dist
vi ~/.profile

export RCMD_CMD="ssh -o VisualHostKey=no"
export RCP_CMD="scp -o VisualHostKey=no"
export CLUSTER=$HOME/dsh.conf

source $HOME/.profile

Systems' Inventory

Note. you shouldn’t repeat a same system name in various groups to use the overwall dsh (without -g nor -w) command. If you want to, however, which would make senses if you want to be able to convert this inventory to also be used by Ansible too, then add -w or -g to define targets (e.g. here -g hosts to reproduce the overall behaviour).

as user

vi $HOME/dsh.conf

GROUP:centos6
host1
host2

GROUP:centos7
host3
host4

GROUP:solaris9
host5

LUMP:hosts
centos6
centos7
solaris9

Usage

Display the hosts and groups,

dsh -q

Check that a generic command works on every target,

dsh -e echo ok
dsh -e hostname
dsh -e "grep -v ^# /etc/resolv.conf"
dsh -e "grep -v ^# /etc/hosts"

Execute defined hosts only,

dsh -e -w node1,node2

Then choose a specific group to proceed with more specific system commands,

dsh -e -g group

To upload and execute a script,

dsh -e -g group -s scriptname.bash

Note. rather use /bin/bash instead of /bin/ksh which is not necessarily available everywhere.

Alternatives

ansible

see ansible

pdsh

Make sure you’ve got EPEL and proceed

    yum install pdsh

Edit some hosts list

    cd ~/
    vi hosts.pdsh

    host1
    host2
    host3

Finally use it

    pdsh -w ^hosts.pdsh hostname

Converting to hosts file format

If you are using Ansible or other System Manager then this script might be useful to maintain a shared list of hosts or systems,

echo -n converting clusterit.conf to ansible hosts file...
sed 's/GROUP:\(.*\)/\[\1\]/' /etc/clusterit.conf > /etc/ansible/hosts && echo done

Resources

Homepage http://www.garbled.net/clusterit.html

Manuals http://www.garbled.net/clusterit.html#manpage

On FreeBSD tutorial http://www.seekingfire.com/documents/toolshed/clusterit.html

https://serverfault.com/questions/17931/what-is-a-good-modern-parallel-ssh-tool


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun