I use numerous tools to perform my SysAdmin duties. One of my favorite tools it clusterit, which is a suite of programs that allows you to run commands across one or more machines in parallel.
Clusterit is a collection of clustering tools loosely based on IBM’s PSSP clustering tools. Unlike PSSP or GLUnix, Clusterit allows fast parallel execution of remote commands as it is written in architecture-independent C. Administrators can choose from a variety of authentication methods, including SSH and Kerberos.
With Clusterit, administrators can run parallelized and load balanced software builds (using jsd/jsh) or manage a heterogeneous cluster of machines (using dsh/dvt/rvt).
You may install it right from command line, providing your servers have internet access and have wget utility installed.
# wget http://prdownloads.sourceforge.net/clusterit/clusterit-2.5.tar.gz
Once the software is installed, you should have a set of binaries and manual pages in /usr/local/clusterit. To use the various tools in the clusterit/bin directory, you will first need to create one or more cluster files. Each cluster file contains a list of hosts you want to manage as a group, and each host is separated by a newline. Here is an example:
# cat servers
The cluster file listed above contains 5 servers named server1 – server5. To tell clusterit you want to use this list of hosts, you will need to export the file via the #CLUSTER environment variable:
# export CLUSTER=/home/matty/clusters/servers
Once you specify the list of hosts you want to use in the #CLUSTER variable, you can start using the various tools. One of the handiest tools is dsh, which allows you to run commands across the hosts in parallel:
# dsh uptime
In the example above I ran the uptime command across all the servers listed in file that is referenced by the CLUSTER variable! You can also do more complex activities through dsh:
# dsh ‘if uname -a | grep SunOS >/dev/null; then echo Solaris; fi’
This example uses dsh to run uname across a batch of servers, and prints the string Solaris if the keyword “SunOS” is found in the uname output. Clusterit also comes with a distributed scp command called pcp, which you can use to copy a file to a number of hosts in parallel:
# pcp /etc/services /tmp
# openssl md5 /etc/services
In this example I am using pcp to copy the file /etc/services to each host, and then using dsh to create a checksum of the file that was copied. Clusterit also comes with a distributed top (dtop), distributed df (pdf) as well as a number of job control tools! If you are currently performing management operations using the old for stanza:
# cat hosts | while read host
Have a Unix Problem
Return to : - Unix System Administration Hints and Tips
(c) www.gotothings.com All material on this site is