#!/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群起脚本
最新推荐文章于 2024-09-08 15:48:29 发布