Setting up ClusterIt

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
apt install libx11-dev libncurses5-dev

Fetch, extract and install ClusterIt

as root

#wget http://prdownloads.sourceforge.net/clusterit/clusterit-2.5.tar.gz
wget https://sourceforge.net/projects/clusterit/files/latest/download
mv download clusterit-2.5.tar.gz
tar xzf clusterit-2.5.tar.gz
cd clusterit-2.5/
./configure
echo $MAKEJOBS
make -j8
make install

as user

which dsh

Configuration

as user

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

Make sure you are good with SSH client 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/cluster.conf

. ~/.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).

vi $HOME/cluster.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 "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

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

References


HOME | GUIDES | BENCHMARKS | html