setting up ClusterIt (DSH)

installinstall

see clusterit-install

setupsetup

as user

nake 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/cluster.conf

Systems' InventorySystems' 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 (to be able to convert this inventory to also be used by Ansible) add -w or -g to define targets (e.g. here -g hosts to reproduce the overall behaviour).

as user

vi $HOME/cluster.conf

GROUP:centos6
host1
host2

GROUP:centos7
host3
host4

GROUP:solaris9
host5

LUMP:hosts
centos6
centos7
solaris9

UsageUsage

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.

AlternativesAlternatives

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 formatConverting 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

ResourcesResources

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
Licensed under MIT