一、说在前面
今天跟着教程学会了在免密登录的基础上如何单点启动,并写了一个启动脚本。
二、单点启动
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
======================启动 / 停止======================= (1)单点启动/停止 hdfs --daemon start/stop namenode/datanode/secondarynamenode yarn --daeon start/stop resourcemanager/nodemanager (2)群起/群停 前提:配置ssh免密登录,配置workers文件(hadoop2.x中是slavers) 在NN的节点(102):start-dfs.sh/stop-dfs.sh 在RM的节点(103):start-yarn.sh/stop-yarn.sh
三、启动脚本
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
====================mycluster.sh======================= #!/bin/bash if [ $# -lt 1 ] then echo "Input Args Error!!!!" exit fi case $1 in start) echo "================= START HDFS =================" ssh hadoop102 /opt/module/hadoop-3.1.3/sbin/start-dfs.sh echo "================= START YARN =================" ssh hadoop103 /opt/module/hadoop-3.1.3/sbin/start-yarn.sh ;; stop) echo "================= STOP YARN =================" ssh hadoop103 /opt/module/hadoop-3.1.3/sbin/stop-yarn.sh echo "================= STOP HDFS =================" ssh hadoop102 /opt/module/hadoop-3.1.3/sbin/stop-dfs.sh ;; *) echo "Input Args Error!!!!" ;; esac