Hadoop集群常用脚本
Posted 刘元涛
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hadoop集群常用脚本相关的知识,希望对你有一定的参考价值。
hadoop群起脚本
#!/bin/bash
if [ $# -lt 1 ]
then
echo "No Args Input..."
exit ;
fi
case $1 in
"start")
echo " =================== 启动 hadoop集群 ==================="
echo " --------------- 启动 hdfs ---------------"
ssh node101 "/opt/module/hadoop3.1.4/sbin/start-dfs.sh"
echo " --------------- 启动 yarn ---------------"
ssh node102 "/opt/module/hadoop3.1.4/sbin/start-yarn.sh"
echo " --------------- 启动 historyserver ---------------"
ssh node101 "/opt/module/hadoop3.1.4/bin/mapred --daemon start historyserver"
;;
"stop")
echo " =================== 关闭 hadoop集群 ==================="
echo " --------------- 关闭 historyserver ---------------"
ssh node101 "/opt/module/hadoop3.1.4/bin/mapred --daemon stop historyserver"
echo " --------------- 关闭 yarn ---------------"
ssh node102 "/opt/module/hadoop3.1.4/sbin/stop-yarn.sh"
echo " --------------- 关闭 hdfs ---------------"
ssh node101 "/opt/module/hadoop3.1.4/sbin/stop-dfs.sh"
;;
*)
echo "Input Args Error..."
;;
esac
查看所有机器运行的情况
#!/bin/bash
for host in node101 node102 node103
do
echo =============== $host ===============
ssh $host jps
done
以上是关于Hadoop集群常用脚本的主要内容,如果未能解决你的问题,请参考以下文章