【实用内容】Hadoop群起脚本

#!/bin/bash

if [ $# -lt 1 ] then
	echo "No Args Input..."
	exit;
fi

case $1 in
"start")
	echo " =================== Starting hadoop ==================="
	echo " --------------- Starting HDFS ---------------"
	ssh linux01 "/opt/module/hadoop-3.3.4/sbin/start-dfs.sh"

	echo " --------------- Starting Yarn ---------------"
	 ssh linux02 "/opt/module/hadoop-3.3.4/sbin/start-yarn.sh"

	echo " --------------- Starting historyserver ---------------"
	ssh linux01 "/opt/module/hadoop-3.3.4/bin/mapred --daemon start historyserver"
;;

"stop") 
	echo " =================== Stopping hadoop ==================="
	echo " --------------- Stopping historyserver ---------------"
	ssh linux01 "/opt/module/hadoop-3.3.4/bin/mapred --daemon stop historyserver"

	echo " --------------- Stopping Yarn ---------------"
	ssh linux02 "/opt/module/hadoop-3.3.4/sbin/stop-yarn.sh"
	
	echo " --------------- Stopping HDFS ---------------"
	ssh linux01 "/opt/module/hadoop-3.3.4/sbin/stop-dfs.sh"
;;
*)
	 echo "Input Args Error..."
;;
esac

你可能感兴趣的:(实用内容,hadoop,大数据)