【xcall.sh】
#!/bin/bash
params=$@
hosts=`cat /soft/hadoop/etc/hadoop/slaves`
tput setaf 2
echo =============localhost==================
tput setaf 7
$params
for host in $hosts ; do
tput setaf 2
echo =============$host===========================
tput setaf 7
ssh -4 $host "source /etc/profile ; $params"
done
原文地址:http://13088442.blog.51cto.com/13078442/1943670