From 2c565fe262272d99ba406c989beabd1a731f9817 Mon Sep 17 00:00:00 2001 From: Gera Shegalov Date: Thu, 11 Jan 2018 00:38:36 -0800 Subject: [PATCH] HADOOP-15166: simplify minicluster start --- .../hadoop-common/src/site/markdown/CLIMiniCluster.md.vm | 2 +- hadoop-mapreduce-project/bin/mapred | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/CLIMiniCluster.md.vm b/hadoop-common-project/hadoop-common/src/site/markdown/CLIMiniCluster.md.vm index 806df0a41dc7d..9aa9ad2ef11c1 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/CLIMiniCluster.md.vm +++ b/hadoop-common-project/hadoop-common/src/site/markdown/CLIMiniCluster.md.vm @@ -41,7 +41,7 @@ Running the MiniCluster From inside the root directory of the extracted tarball, you can start the CLI MiniCluster using the following command: - $ HADOOP_CLASSPATH=share/hadoop/yarn/test/hadoop-yarn-server-tests-${project.version}-tests.jar bin/hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-${project.version}-tests.jar minicluster -rmport RM_PORT -jhsport JHS_PORT + $ bin/mapred minicluster -rmport RM_PORT -jhsport JHS_PORT In the example command above, `RM_PORT` and `JHS_PORT` should be replaced by the user's choice of these port numbers. If not specified, random free ports will be used. diff --git a/hadoop-mapreduce-project/bin/mapred b/hadoop-mapreduce-project/bin/mapred index 44f6216443eaa..9773ec89ded6c 100755 --- a/hadoop-mapreduce-project/bin/mapred +++ b/hadoop-mapreduce-project/bin/mapred @@ -36,6 +36,7 @@ function hadoop_usage hadoop_add_subcommand "sampler" client "sampler" hadoop_add_subcommand "frameworkuploader" admin "mapreduce framework upload" hadoop_add_subcommand "version" client "print the version" + hadoop_add_subcommand "minicluster" client "CLI MiniCluster" hadoop_generate_usage "${HADOOP_SHELL_EXECNAME}" true } @@ -101,6 +102,11 @@ function mapredcmd_case version) HADOOP_CLASSNAME=org.apache.hadoop.util.VersionInfo ;; + minicluster) + hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}/timelineservice"'/*' + hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}/test"'/*' + HADOOP_CLASSNAME=org.apache.hadoop.mapreduce.MiniHadoopClusterManager + ;; *) HADOOP_CLASSNAME="${subcmd}" if ! hadoop_validate_classname "${HADOOP_CLASSNAME}"; then