宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

建站服务器

【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

shell脚本(查看多台服务器端口)-风君雪科技博客