• 使用service管理hdfs,yarn


    将hdfs设置为服务项
    vim /etc/rc.d/init.d/hdfs #!/bin/bash #chkconfig: 345 99 99 #description:hdfs server #processname:hdfs case $1 in start) /usr/apps/hadoop/hadoop-2.6.4/sbin/./start-dfs.sh;; # 开启hdfs的命令 stop) /usr/apps/hadoop/hadoop-2.6.4/sbin/stop-dfs.sh start;; # 关闭hdfs进程的脚本 *) echo "require start|stop" ;; esac chmod 777 /etc/rc.d/init.d/hdfs 增加到chkconfig中进行管理 chkconfig --add hdfs chkconfig --list hdfs service hdfs start service hsfs stop



    将yarn设置为服务项

    
    

    vim /etc/rc.d/init.d/yarn

    
    


    #!/bin/bash
    #chkconfig: 345 99 99
    #description:yarn server
    #processname:yarn
    case $1 in
    start) /usr/apps/hadoop/hadoop-2.6.4/sbin/./start-yarn.sh;; # 开启hdfs的命令
    stop) /usr/apps/hadoop/hadoop-2.6.4/sbin/stop-yarn.sh start;; # 关闭hdfs进程的脚本
    *) echo "require start|stop" ;;
    esac

    
    
    
    
    

    chmod 777 /etc/rc.d/init.d/yarn

    
    

    增加到chkconfig中进行管理
    chkconfig --add yarn
    chkconfig --list yarn

    
    

    使用service管理
    service yarn start
    service yarn stop



    备注

    #!/bin/bash
    #chkconfig: 345 99 99

      第二行的参数 345 是指在系统启动等级为 3 4 5 的时候 自动启动。99 是启动优先级。99是关闭优先级




  • 相关阅读:
    《将才》读后感
    存储过程
    frame间传值
    IBM TSM解决方案的技术优势
    通过ISA发布Sharepoint 2007的两种认证方式
    ISA Server 2006新功能(1)
    MetaWeblogAPI C# Code Sample
    客户域环境维护记录
    春运教训
    1明
  • 原文地址:https://www.cnblogs.com/anbylau2130/p/13617632.html
Copyright © 2020-2023  润新知