• 使用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是关闭优先级




  • 相关阅读:
    c#数据结构与算法
    学习资源---.NET
    怎样完全删除sqlserver
    树,森林 二叉树之间转化 原理
    ref 和out 区别
    GridView批量删除记录、全选及弹出确认对话框
    .NET基础 小记--------2013.8.10
    Xml 读写
    同步 异步 区别
    委托学习
  • 原文地址:https://www.cnblogs.com/anbylau2130/p/13617632.html
Copyright © 2020-2023  润新知