Repository: ambari Updated Branches: refs/heads/trunk f0d571c3a -> 24c39273f
AMBARI-8174. Ambari-deployed cluster can't start datanode as root from command line. Fix for hadoop-env. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/24c39273 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/24c39273 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/24c39273 Branch: refs/heads/trunk Commit: 24c39273ff0487c71f5688c14bf2ef8df9786210 Parents: f0d571c Author: Siddharth Wagle <swa...@hortonworks.com> Authored: Thu Nov 6 12:20:09 2014 -0800 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Thu Nov 6 12:20:09 2014 -0800 ---------------------------------------------------------------------- .../HDP/2.0.6/services/HDFS/package/scripts/utils.py | 12 ++++++------ .../HDP/2.2/services/HDFS/configuration/hadoop-env.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/24c39273/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py index 08358f5..150d0a4 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py @@ -101,13 +101,13 @@ def service(action=None, name=None, user=None, create_pid_dir=False, except OSError: pass # Process is not running pass + pass - # Set HADOOP_SECURE_DN_USER correctly in hadoop-env if DN is running as root - # in secure mode. - if user == 'root': - params.dn_proc_user = 'root' - hdfs.setup_hadoop_env(replace=True) - pass + # Set HADOOP_SECURE_DN_USER correctly in hadoop-env if DN is running as root + # in secure mode. + if name == 'datanode' and user == 'root': + params.dn_proc_user = 'root' + hdfs.setup_hadoop_env(replace=True) pass hadoop_env_exports_str = '' http://git-wip-us.apache.org/repos/asf/ambari/blob/24c39273/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/hadoop-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/hadoop-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/hadoop-env.xml index d25a25b..929e9c9 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/hadoop-env.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/hadoop-env.xml @@ -136,7 +136,7 @@ export JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:/usr/hdp/current/hadoop-client/lib export HADOOP_OPTS="-Dhdp.version=$HDP_VERSION $HADOOP_OPTS" HDFS_DN_PROC_USER={{dn_proc_user}} -if [ $HDFS_DN_PROC_USER="root" ]; then +if [ $HDFS_DN_PROC_USER == "root" ]; then export HADOOP_SECURE_DN_USER="{{hdfs_user}}" else export HADOOP_SECURE_DN_USER=""