#!/bin/bashif [ $# -lt 1 ]then echo "No Args Input..." exit ;fiuser=`whoami`hadoop_home=/opt/module/hadoop-3.1.3case $1 in"start") echo " =================== 启动 hadoop 集群 ===================" echo " --------------- 启动 hdfs ---------------" ssh $user@hadoop102 "$hadoop_home/sbin/start-dfs.sh" echo " --------------- 启动 yarn ---------------" ssh $user@hadoop103 "$hadoop_home/sbin/start-yarn.sh" echo " --------------- 启动 historyserver ---------------" ssh $user@hadoop102 "$hadoop_home/bin/mapred --daemon start historyserver";;"stop") echo " =================== 关闭 hadoop 集群 ===================" echo " --------------- 关闭 historyserver ---------------" ssh $user@hadoop102 "$hadoop_home/bin/mapred --daemon stop historyserver" echo " --------------- 关闭 yarn ---------------" ssh $user@hadoop103 "$hadoop_home/sbin/stop-yarn.sh" echo " --------------- 关闭 hdfs ---------------" ssh $user@hadoop102 "$hadoop_home/sbin/stop-dfs.sh";;*) echo "Input Args Error...";;esac
黑猴子的家:xhadoop.sh
时间:2023-05-11
相关推荐