#!/bin/bash # The next lines are for chkconfig on RedHat systems. # chkconfig: 35 98 02 # description: Starts and stops hadoop Server #autor:516249940@qq.com #date:2017-03-06 # The next lines are for chkconfig on SuSE systems. # /etc/init.d/xxx # ### BEGIN INIT INFO # Provides: xxx # Required-Start: $network $syslog # Required-Stop: # Default-Start: 2 3 5 # Default-Stop: 0 6 # Short-Description: Starts and stops hadoop Server # Description: Starts and stops hadoop Server ### END INIT INFO HADOOP_SBIN="/usr/local/hadoop/sbin" JAVA_ETC="/etc/alternatives" case $1 in start) $HADOOP_SBIN/start-dfs.sh $HADOOP_SBIN/start-yarn.sh $HADOOP_SBIN/mr-jobhistory-daemon.sh start historyserver echo "the hadoop is ok" ;; stop) $HADOOP_SBIN/mr-jobhistory-daemon.sh stop historyserver $HADOOP_SBIN/stop-yarn.sh $HADOOP_SBIN/stop-dfs.sh echo "the hadoop is stop" ;; restart|reload|force-reload) $HADOOP_SBIN/mr-jobhistory-daemon.sh stop historyserver $HADOOP_SBIN/stop-yarn.sh $HADOOP_SBIN/stop-dfs.sh echo "the hadoop is stop" sleep 3 $HADOOP_SBIN/start-dfs.sh $HADOOP_SBIN/start-yarn.sh $HADOOP_SBIN/mr-jobhistory-daemon.sh start historyserver echo "the hadoop is ok" ;; status) # 查看状态需要做的步骤 $JAVA_ETC/jps ;; *) echo "$0 {start|stop|restart|status}" exit 4 ;; esac
简单的hadoop启动脚本
原创yanconggod 博主文章分类:hadoop&spark ©著作权
©著作权归作者所有:来自51CTO博客作者yanconggod的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
jenkins通过脚本启动java应用
本文简单简单介绍怎么通过jenkins来调用shell脚本启动java脚本。
html/xml shell -
简单介绍一下我的备份脚本
备份对每个企业的IT工程师都是逃不脱的工作。与其逃避不如主动出击,一次搞定异地备份。
备份文件 源文件 备份脚本 -
Hadoop启动Shell启动脚本分析
我的新浪微博:http://weibo.com
大数据 shell java hadoop JAVA