docker 中 ambari 启动 hdp 2.6.1.0 问题汇总以及解决

nameNode 启动报错

log显示ulimit -c unlimited异常,形如'resource_management.core.exceptions.Fail: Execution of 'ambari-sudo.sh su hdfs -l -s /bin/bash -c 'ulimit -c unlimited ;  /usrp/current/hadoop-client/sbin/hadoop-daemon.sh --config /usrp/current/hadoop-client/conf start namenode'' returned 1. -bash: line 0: ulimit: core file size: cannot modify limit: Operation not permitted
starting namenode, logging to ar/log/hadoopfs/hadoop-hdfs-namenode-wy1.jcloud.local.out'

原因:CentOS7.2上启动HDFS的时候,在启动HDFS的namenode或者datanode的时候,非root启动的时候,会要求执行ulimit -c unlimited这个命令,但是执行的时候是su称hdfs帐号来启动,这时候因为hdfs帐号没有权限执行这个命令,所以会导致HDFS的namenode或者datanode启动失败

解决办法:将/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py中cmd = format("{ulimit_cmd} {hadoop_daemon} —config {hadoop_conf_dir} {action} {name}")这行的{ulimit_cmd} 去掉

resourceManager 启动异常

log显示'resource_management.core.exceptions.Fail: DFS directory '/ats/done/' does not exist !'和'resource_management.core.exceptions.Fail: DFS directory '/ats/active/' does not exist !'

解决:手动创建hdfs相应目录,su hdfs、hdfs dfs -mkdir -p /ats/done、hdfs dfs -mkdir -p /ats/active,并设置权限,如下:
drwxr-xr-x   - yarn          hadoop          0 2017-03-29 16:18 /ats
drwxrwxrwt   - yarn hadoop          0 2017-08-15 00:16 /ats/active
drwx------   - yarn hadoop          0 2017-08-15 00:15 /ats/done