一个shell 脚本

#!/bin/sh

for i in  1 2 3 4 5 6 7 8 9
do
       scp -r ~/Desktop/hadoop-0.20.2 slave"$i":~/Desktop/
       sudo scp /etc/profile slave"$i":/etc/profile
	ssh slave"$i" "source /etc/profile"
#	ssh slave"$i" "rm -rf /home/hadoop/tmp"

#	scp ~/.ssh/slave"$j"_dsa.pub slave"$i":~/.ssh/
#	cat ~/.ssh/slave"$i"_dsa.pub >> ~/.ssh/authorized_keys

#	cat ~/.ssh/slave"$j"_dsa.pub >> ~/.ssh/authorized_keys;
#	scp slave"$j":~/.ssh/slave"$j"_dsa.pub ~/.ssh/

	#scp slave"$j":~/.ssh/slave"$j"_dsa.pub ~/.ssh/
#	ssh slave"$i" "rm -rf /home/hadoop/tmp; rm -rf /home/hadoop/hdtmp;"
#	scp ~/Desktop/hadoop-2.2.0/etc/hadoop/yarn-site.xml slave"$i":~/Desktop/hadoop-2.2.0/etc/hadoop/
done

你可能感兴趣的:(Hadoop,Linux/Unix)