From 8504e20b2e6b596c3297d6620346f8b1ab44297c Mon Sep 17 00:00:00 2001 From: Ravi Prakash Date: Tue, 1 Nov 2016 10:49:04 -0700 Subject: [PATCH] HADOOP-13773. Wrong HADOOP_CLIENT_OPTS in hadoop-env on branch-2. Contributed by Fei Hui (cherry picked from commit 045501a538800a48b77e688e46c55dce54473041) --- .../hadoop-common/src/main/conf/hadoop-env.cmd | 6 +++++- .../hadoop-common/src/main/conf/hadoop-env.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.cmd b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.cmd index 5dbd635d1d8..5aed07d21b6 100644 --- a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.cmd +++ b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.cmd @@ -58,7 +58,11 @@ set HADOOP_DATANODE_OPTS=-Dhadoop.security.logger=ERROR,RFAS %HADOOP_DATANODE_OP set HADOOP_SECONDARYNAMENODE_OPTS=-Dhadoop.security.logger=%HADOOP_SECURITY_LOGGER% -Dhdfs.audit.logger=%HDFS_AUDIT_LOGGER% %HADOOP_SECONDARYNAMENODE_OPTS% @rem The following applies to multiple commands (fs, dfs, fsck, distcp etc) -set HADOOP_CLIENT_OPTS=-Xmx512m %HADOOP_CLIENT_OPTS% +set HADOOP_CLIENT_OPTS=%HADOOP_CLIENT_OPTS% +@rem set heap args when HADOOP_HEAPSIZE is empty +if not defined HADOOP_HEAPSIZE ( + set HADOOP_CLIENT_OPTS=-Xmx512m %HADOOP_CLIENT_OPTS% +) @rem set HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData %HADOOP_JAVA_PLATFORM_OPTS%" @rem On secure datanodes, user to run the datanode as after dropping privileges diff --git a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh index 6469e611285..8d15f980134 100644 --- a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh +++ b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh @@ -64,7 +64,11 @@ export HADOOP_NFS3_OPTS="$HADOOP_NFS3_OPTS" export HADOOP_PORTMAP_OPTS="-Xmx512m $HADOOP_PORTMAP_OPTS" # The following applies to multiple commands (fs, dfs, fsck, distcp etc) -export HADOOP_CLIENT_OPTS="-Xmx512m $HADOOP_CLIENT_OPTS" +export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS" +# set heap args when HADOOP_HEAPSIZE is empty +if [ "$HADOOP_HEAPSIZE" = "" ]; then + export HADOOP_CLIENT_OPTS="-Xmx512m $HADOOP_CLIENT_OPTS" +fi #HADOOP_JAVA_PLATFORM_OPTS="-XX:-UsePerfData $HADOOP_JAVA_PLATFORM_OPTS" # On secure datanodes, user to run the datanode as after dropping privileges.