You found me when I was alive

Hadoop 服务开机自启动

    本人在这之前的博客


  • cd /etc/init.d
  • vim hadoop
    • #!/bin/bash
      #chkconfig:35 95 1
      #description:script to start/stop hadoop
      case $1 in
      start)
      sh /usr/hadoop-2.7.4/bin/start-all.sh
      ;;
      stop)
      sh /hadoop-2.7.4/bin/stop-all.sh
      ;;
      *)
      echo “Usage:$0(start|stop)”
      ;;
      esac
      exit
      !
  • 设置hadoop为开机自启动:chkconfig –add hadoop
  • 或者 chkconfig hadoop on
  • vim /etc/rc.d/rc.local 添加 /etc/init.d/hadoop start
打赏