Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2748

[MR-279] NM should pass a whitelisted environmental variables to the container

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: mrv2, nodemanager
    • Labels:
      None

      Description

      This is similar to MAPREDUCE-103 . We should pass a whitelisted set of environment variables from NM env to the container. By default, we should pass HADOOP_* variables. This can be a simple configuration key that NodeManager reads.

      Today, we already either pass the following correctly or assume that it works but doesn't

      • YARN_HOME: ContainerLaunch#writeLaunchEnv
      • HADOOP_CLIENT_OPTS: MapReduceChildJVM#setVMEnv
      • JAVA_HOME: TaskAttemptImpl#createContainerLaunchContext - Works by shell-expansion.
      • LD_LIBRARY_PATH: Assumed to work via shell-expansion but doesn't.

        Issue Links

          Activity

          Hide
          Arun C Murthy added a comment -

          Fixed via MAPREDUCE-3068.

          Show
          Arun C Murthy added a comment - Fixed via MAPREDUCE-3068 .
          Hide
          Vinod Kumar Vavilapalli added a comment -

          I am reopening this ticket for tracking the effort to make the list of envs to be configurable.

          MAPREDUCE-2880 already fixed the code to pass correct values for essential variables like HADOOP_COMMON_HOME from NM down to the containers. It will be useful to have this configurable - like JAVA_HOME for containers separate from the NM's JAVA_HOME, or may be extra envs that NM doesn't need to be set with.

          Also another minor TODO is to verify that the streaming examples I commented about above are working now.

          Show
          Vinod Kumar Vavilapalli added a comment - I am reopening this ticket for tracking the effort to make the list of envs to be configurable. MAPREDUCE-2880 already fixed the code to pass correct values for essential variables like HADOOP_COMMON_HOME from NM down to the containers. It will be useful to have this configurable - like JAVA_HOME for containers separate from the NM's JAVA_HOME, or may be extra envs that NM doesn't need to be set with. Also another minor TODO is to verify that the streaming examples I commented about above are working now.
          Hide
          Arun C Murthy added a comment -

          Fixed via MAPREDUCE-2880.

          Show
          Arun C Murthy added a comment - Fixed via MAPREDUCE-2880 .
          Hide
          Vinod Kumar Vavilapalli added a comment -

          Not that because of this bug, the NM's environment is not passed to streaming/pipes at all. So the following commands will not work in YARN+MR.

          $HADOOP_COMMON_HOME//bin/hadoop --config $HADOOP_CONF_DIR jar $HADOOP_STREAMING_JAR -input input.txt -mapper '$HADOOP_COMMON_HOME/bin/hadoop dfs -ls /' -reducer NONE -output Output

          The failure is because HADOOP_COMMON_HOME is not known to the streaming process. Instead the following will work, essentially you should expand HADOOP_COMMON_HOME yourselves for now:

          $HADOOP_COMMON_HOME//bin/hadoop --config $HADOOP_CONF_DIR jar $HADOOP_STREAMING_JAR -input input.txt -mapper '/path/to/common/home/bin/hadoop dfs -ls /' -reducer NONE -output Output

          Show
          Vinod Kumar Vavilapalli added a comment - Not that because of this bug, the NM's environment is not passed to streaming/pipes at all. So the following commands will not work in YARN+MR. $HADOOP_COMMON_HOME//bin/hadoop --config $HADOOP_CONF_DIR jar $HADOOP_STREAMING_JAR -input input.txt -mapper '$HADOOP_COMMON_HOME/bin/hadoop dfs -ls /' -reducer NONE -output Output The failure is because HADOOP_COMMON_HOME is not known to the streaming process. Instead the following will work, essentially you should expand HADOOP_COMMON_HOME yourselves for now: $HADOOP_COMMON_HOME//bin/hadoop --config $HADOOP_CONF_DIR jar $HADOOP_STREAMING_JAR -input input.txt -mapper '/path/to/common/home/bin/hadoop dfs -ls /' -reducer NONE -output Output

            People

            • Assignee:
              Unassigned
              Reporter:
              Vinod Kumar Vavilapalli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development