开启集群:
#!/bin/bash #start zookeeper ssh hadoop001 "$ZOOKEEPER_HOME/bin/zkServer.sh start" ssh hadoop002 "$ZOOKEEPER_HOME/bin/zkServer.sh start" ssh hadoop003 "$ZOOKEEPER_HOME/bin/zkServer.sh start" sleep 8 #start hdfs+yarn+jobhistory ssh hadoop001 "$HADOOP_HOME/sbin/start-dfs.sh" ssh hadoop001 "$HADOOP_HOME/sbin/start-yarn.sh" sleep 5s ssh hadoop002 "$HADOOP_HOME/sbin/yarn-daemon.sh start resourcemanager" ssh hadoop001 "$HADOOP_HOME/sbin/mr-jobhistory-daemon.sh start historyserver" sleep 3 sh /home/hadoop/hadoopclustershell/jps.sh
关闭集群:
#!/bin/bash #stop jobhistory+yarn+hdfs ssh hadoop001 "$HADOOP_HOME/sbin/mr-jobhistory-daemon.sh stop historyserver" ssh hadoop001 "$HADOOP_HOME/sbin/stop-yarn.sh" ssh hadoop002 "$HADOOP_HOME/sbin/yarn-daemon.sh stop resourcemanager" ssh hadoop001 "$HADOOP_HOME/sbin/stop-dfs.sh" sleep 5 #stop zookeeper ssh hadoop001 "$ZOOKEEPER_HOME/bin/zkServer.sh stop" ssh hadoop002 "$ZOOKEEPER_HOME/bin/zkServer.sh stop" ssh hadoop003 "$ZOOKEEPER_HOME/bin/zkServer.sh stop" sh /home/hadoop/hadoopclustershell/jps.sh
查看状态:(/home/hadoop/hadoopclustershell/jps.sh)
#!/bin/bash echo "----------hadoop001 process----------" ssh hadoop001 "$JAVA_HOME/bin/jps" echo " " echo "----------hadoop002 process----------" ssh hadoop002 "$JAVA_HOME/bin/jps" echo " " echo "----------hadoop003 process----------" ssh hadoop003 "$JAVA_HOME/bin/jps" echo " "
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)