[ 
https://issues.apache.org/jira/browse/HDFS-6576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

surendra singh lilhore updated HDFS-6576:
-----------------------------------------
    Attachment: HDFS-6576_1.patch

> Datanode log is generating at root directory in security mode
> -------------------------------------------------------------
>
>                 Key: HDFS-6576
>                 URL: https://issues.apache.org/jira/browse/HDFS-6576
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 2.4.0
>            Reporter: surendra singh lilhore
>            Assignee: surendra singh lilhore
>            Priority: Minor
>             Fix For: 2.4.0
>
>         Attachments: HDFS-6576.patch, HDFS-6576_1.patch
>
>
> In hadoop-env.sh script we are exporting HADOOP_SECURE_DN_LOG_DIR , but in 
> above line export statement for HADOOP_LOG_DIR is commented 
> If in user environment HADOOP_LOG_DIR is not exported then 
> HADOOP_SECURE_DN_LOG_DIR env variable will export with "/" value and DN will 
> logs in root directory.
> {noformat}
> # Where log files are stored.  $HADOOP_HOME/logs by default.
> #export HADOOP_LOG_DIR=${HADOOP_LOG_DIR}/$USER
> # Where log files are stored in the secure data environment.
> export HADOOP_SECURE_DN_LOG_DIR=${HADOOP_LOG_DIR}/${HADOOP_HDFS_USER}
> {noformat}
> I think we should comment this line.
> In hadoop-daemon.sh already handled case if value of HADOOP_SECURE_DN_LOG_DIR 
> and HADOOP_LOG_DIR is empty.
> In hadoop-daemon.sh we assigning value of HADOOP_SECURE_DN_LOG_DIR in 
> HADOOP_LOG_DIR and after that we are checking if HADOOP_LOG_DIR is empty then 
> HADOOP_LOG_DIR  env variable export with "$HADOOP_PREFIX/logs" value
> {noformat}
> # Determine if we're starting a secure datanode, and if so, redefine 
> appropriate variables
> if [ "$command" == "datanode" ] && [ "$EUID" -eq 0 ] && [ -n 
> "$HADOOP_SECURE_DN_USER" ]; then
>   export HADOOP_PID_DIR=$HADOOP_SECURE_DN_PID_DIR
>   export HADOOP_LOG_DIR=$HADOOP_SECURE_DN_LOG_DIR
>   export HADOOP_IDENT_STRING=$HADOOP_SECURE_DN_USER
>   starting_secure_dn="true"
> fi
> if [ "$HADOOP_IDENT_STRING" = "" ]; then
>   export HADOOP_IDENT_STRING="$USER"
> fi
> # get log directory
> if [ "$HADOOP_LOG_DIR" = "" ]; then
>   export HADOOP_LOG_DIR="$HADOOP_PREFIX/logs"
> fi 
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to