diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop b/hadoop-common-project/hadoop-common/src/main/bin/hadoop index 513b0f161d..766becd50f 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop @@ -33,6 +33,7 @@ function hadoop_usage hadoop_add_subcommand "daemonlog" "get/set the log level for each daemon" hadoop_add_subcommand "distch" "distributed metadata changer" hadoop_add_subcommand "distcp" "copy file or directories recursively" + hadoop_add_subcommand "envvars" "display computed Hadoop environment variables" hadoop_add_subcommand "fs" "run a generic filesystem user client" hadoop_add_subcommand "jar " "run a jar file. NOTE: please use \"yarn jar\" to launch YARN applications, not this command." hadoop_add_subcommand "jnipath" "prints the java.library.path" @@ -138,6 +139,16 @@ case ${COMMAND} in CLASS=org.apache.hadoop.tools.DistCp hadoop_add_to_classpath_toolspath ;; + envvars) + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_COMMON_HOME='${HADOOP_COMMON_HOME}'" + echo "HADOOP_COMMON_DIR='${HADOOP_COMMON_DIR}'" + echo "HADOOP_COMMON_LIB_JARS_DIR='${HADOOP_COMMON_LIB_JARS_DIR}'" + echo "HADOOP_COMMON_LIB_NATIVE_DIR='${HADOOP_COMMON_LIB_NATIVE_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${HADOOP_TOOLS_PATH}'" + exit 0 + ;; fs) CLASS=org.apache.hadoop.fs.FsShell ;; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs index 3739ccbf14..a6644d1af3 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs @@ -34,6 +34,7 @@ function hadoop_usage hadoop_add_subcommand "debug" "run a Debug Admin to execute HDFS debug commands" hadoop_add_subcommand "dfs" "run a filesystem command on the file system" hadoop_add_subcommand "dfsadmin" "run a DFS admin client" + hadoop_add_subcommand "envvars" "display computed Hadoop environment variables" hadoop_add_subcommand "erasurecode" "run a HDFS ErasureCoding CLI" hadoop_add_subcommand "fetchdt" "fetch a delegation token from the NameNode" hadoop_add_subcommand "fsck" "run a DFS filesystem checking utility" @@ -134,6 +135,15 @@ case ${COMMAND} in hadoop_debug "Appending HADOOP_CLIENT_OPTS onto HADOOP_OPTS" HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_CLIENT_OPTS}" ;; + envvars) + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_HDFS_HOME='${HADOOP_HDFS_HOME}'" + echo "HDFS_DIR='${HDFS_DIR}'" + echo "HDFS_LIB_JARS_DIR='${HDFS_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${HADOOP_TOOLS_PATH}'" + exit 0 + ;; erasurecode) CLASS=org.apache.hadoop.hdfs.tools.erasurecode.ECCli hadoop_debug "Appending HADOOP_CLIENT_OPTS onto HADOOP_OPTS" diff --git a/hadoop-mapreduce-project/bin/mapred b/hadoop-mapreduce-project/bin/mapred index 9bf93300ef..66a19aee31 100755 --- a/hadoop-mapreduce-project/bin/mapred +++ b/hadoop-mapreduce-project/bin/mapred @@ -23,6 +23,7 @@ function hadoop_usage hadoop_add_subcommand "archive-logs" "combine aggregated logs into hadoop archives" hadoop_add_subcommand "classpath" "prints the class path needed for running mapreduce subcommands" hadoop_add_subcommand "distcp" "copy file or directories recursively" + hadoop_add_subcommand "envvars" "display computed Hadoop environment variables" hadoop_add_subcommand "historyserver" "run job history servers as a standalone daemon" hadoop_add_subcommand "hsadmin" "job history server admin interface" hadoop_add_subcommand "job" "manipulate MapReduce jobs" @@ -87,6 +88,15 @@ case ${COMMAND} in hadoop_debug "Appending HADOOP_CLIENT_OPTS onto HADOOP_OPTS" HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_CLIENT_OPTS}" ;; + envvars) + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_MAPRED_HOME='${HADOOP_MAPRED_HOME}'" + echo "MAPRED_DIR='${MAPRED_DIR}'" + echo "MAPRED_LIB_JARS_DIR='${MAPRED_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${HADOOP_TOOLS_PATH}'" + exit 0 + ;; historyserver) supportdaemonization="true" CLASS=org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 7f05dad738..da4ce4042f 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -32,6 +32,7 @@ function hadoop_usage hadoop_add_subcommand "cluster" "prints cluster information" hadoop_add_subcommand "container" "prints container(s) report" hadoop_add_subcommand "daemonlog" "get/set the log level for each daemon" + hadoop_add_subcommand "envvars" "display computed Hadoop environment variables" hadoop_add_subcommand "jar " "run a jar file" hadoop_add_subcommand "logs" "dump container logs" hadoop_add_subcommand "node" "prints node report(s)" @@ -96,6 +97,15 @@ case "${COMMAND}" in hadoop_debug "Append YARN_CLIENT_OPTS onto HADOOP_OPTS" HADOOP_OPTS="${HADOOP_OPTS} ${YARN_CLIENT_OPTS}" ;; + envvars) + echo "JAVA_HOME='${JAVA_HOME}'" + echo "HADOOP_YARN_HOME='${HADOOP_YARN_HOME}'" + echo "YARN_DIR='${YARN_DIR}'" + echo "YARN_LIB_JARS_DIR='${YARN_LIB_JARS_DIR}'" + echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" + echo "HADOOP_TOOLS_PATH='${HADOOP_TOOLS_PATH}'" + exit 0 + ;; jar) CLASS=org.apache.hadoop.util.RunJar hadoop_debug "Append YARN_CLIENT_OPTS onto HADOOP_OPTS"