HADOOP群起脚本

Posted 溜肉段小能手

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HADOOP群起脚本相关的知识,希望对你有一定的参考价值。

echo "=====================正在开启datanode节点========================"
for i in [email protected] [email protected] [email protected]
do
        ssh $i /opt/module/hadoop-2.7.2/sbin/hadoop-daemon.sh start datanode
        done

        echo "=====================正在开启secondarynamenode节点========================"

        ssh [email protected] /opt/module/hadoop-2.7.2/sbin/hadoop-daemon.sh start secondarynamenode

        echo "=====================正在开启ResourceManager节点========================"

        ssh [email protected] /opt/module/hadoop-2.7.2/sbin/yarn-daemon.sh start resourcemanager

        echo "=====================正在开启nodeManager节点========================"

        for i in [email protected] [email protected] [email protected]
        do
                    ssh $i /opt/module/hadoop-2.7.2/sbin/yarn-daemon.sh start datamanager
                done
                echo "=============================正在启动Yarn==============================="
                ssh [email protected] /opt/module/hadoop-2.7.2/sbin/start-yarn.sh

                echo "=====================正在开启jobhistoryServer节点========================"

                ssh [email protected] /opt/module/hadoop-2.7.2/sbin/mr-jobhistory-daemon.sh start historyserver

        echo "=====================正在启动zookeeper节点========================"
        for i in [email protected] [email protected] [email protected]
        do          
            ssh $i /opt/module/zookeeper-3.4.10/bin/zkServer.sh start
            done
        done
done

群关闭脚本

#!/bin/bash

echo "=====================正在关闭集群服务============================"

echo "=====================正在关闭zookeeper节点========================"
for i in [email protected] [email protected] [email protected]
do  ssh $i /opt/module/zookeeper-3.4.10/bin/zkServer.sh stop
    done

echo "=====================正在关闭jobhistoryServer节点========================"

ssh [email protected]  /opt/module/hadoop-2.7.2/sbin/mr-jobhistory-daemon.sh stop historyserver

echo "=====================正在关闭ResourceManager节点========================"

ssh [email protected] /opt/module/hadoop-2.7.2/sbin/yarn-daemon.sh stop resourcemanager

echo "=====================正在关闭nodeManager节点========================"

for i in [email protected] [email protected] [email protected]
do
        ssh $i /opt/module/hadoop-2.7.2/sbin/yarn-daemon.sh stop datamanager
        done

        echo "=====================正在关闭secondarynamenode节点========================"

        ssh [email protected] /opt/module/hadoop-2.7.2/sbin/hadoop-daemon.sh stop secondarynamenode

        echo "=====================正在关闭namenode节点========================"

        ssh [email protected] /opt/module/hadoop-2.7.2/sbin/hadoop-daemon.sh stop namenode
        echo "=====================关闭datanode节点========================"
        for i in [email protected] [email protected] [email protected]
        do
                ssh $i /opt/module/hadoop-2.7.2/sbin/hadoop-daemon.sh stop datanode
                done
        echo "=====================关闭Yarn节点========================"
        for i in [email protected] [email protected] [email protected]
        do
                ssh $i /opt/module/hadoop-2.7.2/sbin/stop-yarn.sh
                done

 

以上是关于HADOOP群起脚本的主要内容,如果未能解决你的问题,请参考以下文章

群起集群

Hadoop完全分布式群起集群

Hadoop集群常用脚本

Hadoop运行模式群起集群配置workers启动集群启动HDFS拼接Web端查看HDFS的NameNodeWeb端查看YARN的ResourceManager

Hadoop生态系统-zookeeper

Zookeeper群起脚本启动失败及查看状态出现:Error contacting service. It is probably not running