HDDS-2098 : Ozone shell command prints out ERROR when the log4j file … (#1411)

This commit is contained in:
avijayanhwx 2019-09-16 22:36:53 -07:00 committed by Bharat Viswanadham
parent 292bce7908
commit 4f67081038
1 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,12 @@ function ozonecmd_case
subcmd=$1
shift
ozone_default_log4j="${HADOOP_CONF_DIR}/log4j.properties"
ozone_shell_log4j="${HADOOP_CONF_DIR}/ozone-shell-log4j.properties"
if [ ! -f "${ozone_shell_log4j}" ]; then
ozone_shell_log4j=${ozone_default_log4j}
fi
case ${subcmd} in
auditparser)
HADOOP_CLASSNAME=org.apache.hadoop.ozone.audit.parser.AuditParser
@ -118,7 +124,7 @@ function ozonecmd_case
;;
freon)
HADOOP_CLASSNAME=org.apache.hadoop.ozone.freon.Freon
OZONE_FREON_OPTS="${OZONE_FREON_OPTS} -Dhadoop.log.file=ozone-freon.log -Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties"
OZONE_FREON_OPTS="${OZONE_FREON_OPTS} -Dhadoop.log.file=ozone-freon.log -Dlog4j.configuration=file:${ozone_shell_log4j}"
HADOOP_OPTS="${HADOOP_OPTS} ${OZONE_FREON_OPTS}"
OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-tools"
;;
@ -139,7 +145,8 @@ function ozonecmd_case
;;
sh | shell)
HADOOP_CLASSNAME=org.apache.hadoop.ozone.web.ozShell.OzoneShell
HDFS_OM_SH_OPTS="${HDFS_OM_SH_OPTS} -Dhadoop.log.file=ozone-shell.log -Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties"
HDFS_OM_SH_OPTS="${HDFS_OM_SH_OPTS} -Dhadoop.log.file=ozone-shell.log
-Dlog4j.configuration=file:${ozone_shell_log4j}"
HADOOP_OPTS="${HADOOP_OPTS} ${HDFS_OM_SH_OPTS}"
OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-ozone-manager"
;;