zoukankan      html  css  js  c++  java
  • hadoop启动脚本

    记录一下一个简单的hadoop启动脚本

    就是启动zookeeper集群,hadoop的HDFS和YRAN的脚本

    start-cluster.sh

     

    关于关闭的脚本,只需要顺序换一下,然后将start改为stop

    #!/bin/bash
    # 集群IP地址
    hadoop001=IP地址
    hadoop002=IP地址
    hadoop003=IP地址
    # 输出提示信息
    echo "--------------------正在启动集群----------------------"
    echo "--------------------zookeeper集群启动----------------------"
    
    for host in hadoop001 hadoop002 hadoop003
    do
            # 具体逻辑
            echo "ssh to $host"
            ssh $host "/program/apache-zookeeper-3.5.8-bin/bin/zkServer.sh start"
            ssh $host "jps"
            # 输出提示
            echo "启动成功!!!"
    #结束
    done
    
    #启动HDFS集群
    echo "--------------------HDFS集群启动----------------------"
    echo "ssh to $hadoop001"
    ssh $hadoop001 "/program/hadoop-3.2.1/sbin/start-dfs.sh"
    
    ## 查看jps进程,这一段其实可以不用
    #for jps in hadoop001 hadoop002 hadoop003
    #do
    #       echo "查看进程 $jps"
    #       ssh $jps "jps"
    #       echo "$jps HDFS启动成功"
    #       echo "--------------------分割线----------------------"
    #done
    
    
    #启动YARN集群,还有启动historyserver
    echo "--------------------YARN集群及history启动----------------------"
    echo "ssh to $hadoop002"
    ssh $hadoop002 "/program/hadoop-3.2.1/sbin/start-yarn.sh"
    ssh $hadoop002 "/program/hadoop-3.2.1/bin/mapred --daemon start historyserver"
    echo "JobHistoryServer进程启动成功"
    -- 插入 --                             
  • 相关阅读:
    [BZOJ3195][Jxoi2012]奇怪的道路
    [codeforces696B]Puzzles
    [codeforces464D]World of Darkraft
    [COGS1000]伊吹萃香 最短路
    [BZOJ4653][NOI2016]区间 贪心+线段树
    [BZOJ4540][HNOI2016]序列 莫队
    [BZOJ4870][Shoi2017]组合数问题 dp+矩阵乘
    Loj 2005 相关分析
    Loj 114 k大异或和
    bzoj 2212 Tree Rotations
  • 原文地址:https://www.cnblogs.com/kle-cola/p/13974637.html
Copyright © 2011-2022 走看看