Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-609

/etc/init.d/hive-metastore incorrectly sets location for hive metastore log

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: CDH 5.0.2
    • Fix Version/s: None
    • Component/s: Hive
    • Labels:
    • Environment:
      RedHat rpm 0.12.0+cdh5.0.2+319-1.cdh5.0.2.p0.16.el6

      Description

      /etc/init.d/hive-metastore has this:

          exec_env="HADOOP_OPTS=\"-Dhive.log.dir=`dirname $LOG_FILE` -Dhive.log.file=${DAEMON}.log -Dhive.log.threshold=INFO\""
      
          # Autodetect JDBC drivers for metastore
          . /usr/lib/bigtop-utils/bigtop-detect-classpath
          exec_env="HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${BIGTOP_CLASSPATH} $exec_env"
      
          su -s /bin/bash $SVC_USER -c "$exec_env nohup nice -n 0 \
              $EXEC_PATH --service metastore $PORT \
                  > $LOG_FILE 2>&1 < /dev/null & "'echo $! '"> $PIDFILE"
      

      If you look at this code, instead of the -D option it should be using --hiveconf, and secondly $exec_env ends up before the $EXEC_PATH which might work for environment vars, but not for command line options. The result is - hive metastore logs to /dev/null as far as I can tell.

      It should be something along the lines of:

          
          # Autodetect JDBC drivers for metastore
          . /usr/lib/bigtop-utils/bigtop-detect-classpath
          exec_env="HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${BIGTOP_CLASSPATH} $exec_env"
      
          su -s /bin/bash $SVC_USER -c "$exec_env nohup nice -n 0 \
              $EXEC_PATH --service metastore --hiveconf hive.log.dir=`dirname $LOG_FILE` --hiveconf hive.log.file=${DAEMON}.log --hiveconf hive.log.threshold=INFO $PORT \
                  > $LOG_FILE 2>&1 < /dev/null & "'echo $! '"> $PIDFILE"
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              grisha Gregory Trubetskoy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: