zoukankan      html  css  js  c++  java
  • cdh启动datanode报错

    问题:

    为cdh新增节点时,在分配datanode后,启动报错

    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/config.zip: 权限不够.
    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/proc.json: 权限不够.
    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/config.zip,Permission deny
    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/proc.zip,Permission deny

    以为是权限问题,chmod -R 777 /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process,重启后生成新的文件夹,权限还是有问题,推测是启动过程中root用去创建了,接着hdfs去读这个文件,所以报错

    解决:

    当重启时,此处将进程挂起3分钟,手动用root用户将/youdir/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process目录改为777,然后,没有然后,只需等待,3分钟后,居然就成功了,成功了。

    /youdir/opt/cloudera-manager/cm-5.11.2/lib64/cmf/service/common/cloudera-config.sh
    # When created, the final resting place of config files is unknown,
    # so it is marked as {{CMF_CONF_DIR}}. We know what this directory will
    # be here in this script, so search-replace it.
    replace_conf_dir() {
      echo "CONF_DIR=$CONF_DIR"
      echo "CMF_CONF_DIR=$CMF_CONF_DIR"
    
    ############fix the Can't open /youdir/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/config.zip,   ###################
    ############fix the Can't open /youdir/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/proc.json     ###################
      sleep 3m;
      
    
    ############fix end#############################
    
    
      # Exclude files that we don't want to be modified. (OPSAPS-37023)
      EXCLUDE_CMF_FILES=('cloudera-config.sh' 'httpfs.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' '*.log' '*.keytab' '*jceks')
      find $CONF_DIR -type f ! -path "$CONF_DIR/logs/*" $(printf "! -name %s " ${EXCLUDE_CMF_FILES[@]}) -exec perl -pi -e "s#{{CMF_CONF_DIR}}#$CONF_DIR#g" {} ;
    }

    分析:

    在日志中

    中发现在find命令后,报错,那就在find命令前将进程挂起,修改目录权限,待执行find时,权限已符合要求

    + EXCLUDE_CMF_FILES=('cloudera-config.sh' 'httpfs.sh' 'hue.sh' 'impala.sh' 'sqoop.sh' 'supervisor.conf' '*.log' '*.keytab' '*jceks')
    ++ printf '! -name %s ' cloudera-config.sh httpfs.sh hue.sh impala.sh sqoop.sh supervisor.conf '*.log' hdfs.keytab '*jceks'
    + find /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE -type f '!' -path '/software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/logs/*' '!' -name cloudera-config.sh '!' -name httpfs.sh '!' -name hue.sh '!' -name impala.sh '!' -name sqoop.sh '!' -name supervisor.conf '!' -name '*.log' '!' -name hdfs.keytab '!' -name '*jceks' -exec perl -pi -e 's#{{CMF_CONF_DIR}}#/software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE#g' '{}' ';'
    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/config.zip: 权限不够.
    Can't open /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE/proc.json: 权限不够.
    + make_scripts_executable
    + find /software/opt/cloudera-manager/cm-5.11.2/run/cloudera-scm-agent/process/642-hdfs-DATANODE -regex '.*.(py|sh)$' -exec chmod u+x '{}' ';'
    + '[' DATANODE_MAX_LOCKED_MEMORY '!=' '' ']'
    + ulimit -l

     参考文章:https://blog.csdn.net/u011120550/article/details/80598653

  • 相关阅读:
    SQL: 返回刚插入记录的ID 及 output 更新记录时得到更新记录的ID值 .
    asp.net 用伪静态修改webconfig配置文件 .
    Asp.Net : 捕捉和记录网站中出现的所有未处理错误,抛出详细的页面来源和访问ip,调用的接口方法及异常实例(记事本日志,系统日志及数据库日志)
    js闭包(转载) (jquery ajax 异步 多循环运用 )
    c# enum 枚举名称和ID 互换获取.................
    WCF :服务开发与调用的完整示例
    关于DataSet 、 DataTable 、 ArrayList 、 IList 、Array
    Expression Tree不完全入门
    WF4 Beta2:IExecutionProperty的使用
    Groovy 1.8.9, 2.0.7 和 2.1.1 发布
  • 原文地址:https://www.cnblogs.com/pu20065226/p/10792288.html
Copyright © 2011-2022 走看看