欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

黑猴子的家:xhadoop.sh

时间:2023-05-11

#!/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

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。