Uploaded image for project: 'Bigtop'
  1. Bigtop
  2. BIGTOP-1038

PIDFILE in service scripts of Hadoop is inconsistent with the path in hadoop-daemon.sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.6.0
    • None
    • Init scripts
    • None

    Description

      PIDFILE in service scripts is fixed value because of variable expansion during packaging.

      $ grep 'PIDFILE=' /etc/init.d/hadoop-*
      /etc/init.d/hadoop-hdfs-datanode:PIDFILE="/var/run/hadoop-hdfs/hadoop-hdfs-datanode.pid"
      /etc/init.d/hadoop-hdfs-namenode:PIDFILE="/var/run/hadoop-hdfs/hadoop-hdfs-namenode.pid"
      /etc/init.d/hadoop-mapreduce-historyserver:PIDFILE="/var/run/hadoop-mapreduce/mapred-mapred-historyserver.pid"
      /etc/init.d/hadoop-yarn-nodemanager:PIDFILE="/var/run/hadoop-yarn/yarn-yarn-nodemanager.pid"
      /etc/init.d/hadoop-yarn-resourcemanager:PIDFILE="/var/run/hadoop-yarn/yarn-yarn-resourcemanager.pid"
      

      However, HADOOP_IDENT_STRING composing pidfile path is configurable in hadoop-env.sh.

      $ grep HADOOP_IDENT_STRING /usr/lib/hadoop/sbin/hadoop-daemon.sh
      #   HADOOP_IDENT_STRING   A string representing this instance of hadoop. $USER by default
        export HADOOP_IDENT_STRING=$HADOOP_SECURE_DN_USER
      if [ "$HADOOP_IDENT_STRING" = "" ]; then
        export HADOOP_IDENT_STRING="$USER"
        chown $HADOOP_IDENT_STRING $HADOOP_LOG_DIR
      export HADOOP_LOGFILE=hadoop-$HADOOP_IDENT_STRING-$command-$HOSTNAME.log
      log=$HADOOP_LOG_DIR/hadoop-$HADOOP_IDENT_STRING-$command-$HOSTNAME.out
      pid=$HADOOP_PID_DIR/hadoop-$HADOOP_IDENT_STRING-$command.pid
      

      As a result, the path of pidfile matches only when HADOOP_IDENT_STRING is service user name which is the default.

      Attachments

        Issue Links

          Activity

            People

              iwasakims Masatake Iwasaki
              iwasakims Masatake Iwasaki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: