zoukankan      html  css  js  c++  java
  • shell脚本启动所有集群节点

    #profile变量追加到.bashrc中
    cat /etc/profile >> ~/.bashrc

    #start-all-cluster.sh  启动脚本

    #!/bin/bash
    echo "===================正在启动所有集群节点,请稍等。。。======================="
    echo "===================启动Zookeeper节点。。。=================================="
    for i in hadoop02 hadoop03 hadoop04
    do
    	ssh $i '/opt/zookeeper-3.4.9/bin/zkServer.sh start'
    done
    
    echo "===================启动HDFS节点,已开启HA==================================="
    ssh hadoop01 '/opt/hadoop-ha/sbin/start-dfs.sh'
    echo "===================启动YARN节点,已开启HA==================================="
    ssh hadoop01 '/opt/hadoop-ha/sbin/start-yarn.sh'
    echo "===================启动YARN-HA, ResourceManager节点"
    ssh hadoop02 '/opt/hadoop-ha/sbin/yarn-daemon.sh start resourcemanager'
    echo "===================启动HBASE================================================"
    ssh hadoop01 '/opt/hbase/bin/start-hbase.sh'
    echo "===================启动完成================================================="

    #stop-all-cluster.sh 停止脚本

    #!/bin/bash
    echo "=================正在关闭集群的服务,请稍等。。。==================="
    ssh hadoop01 '/opt/hbase/bin/stop-hbase.sh'
    ssh hadoop02 '/opt/hadoop-ha/sbin/yarn-daemon.sh stop resourcemanager'
    ssh hadoop01 '/opt/hadoop-ha/sbin/stop-yarn.sh'
    ssh hadoop01 '/opt/hadoop-ha/sbin/stop-dfs.sh'
    for i in hadoop02 hadoop03 hadoop04
    do
    	ssh $i '/opt/zookeeper-3.4.9/bin/zkServer.sh stop'
    done

    #status-all-cluster.sh 进程状态

    #!/bin/bash
    for i in hadoop01 hadoop02 hadoop03 hadoop04
    	do
    		echo "========================="$i"==================="
    		ssh $i jps
    	done
    

      

  • 相关阅读:
    算法总结7—多维缩放
    算法总结3—神经网络
    算法总结9—优化
    算法总结8—非负矩阵因式分解
    R语言系列—区间估计
    算法总结2—决策树分类器
    算法总结5&6k最近邻与聚类
    统计,逻辑与智能
    算法总结4—支持向量机
    R语言系列—回归分析
  • 原文地址:https://www.cnblogs.com/wuhaidong/p/10831913.html
Copyright © 2011-2022 走看看