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 74c241400f..806df0a41d 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 @@ -55,6 +55,7 @@ There are a number of command line arguments that the users can use to control w $ -namenode URL of the namenode (default is either the DFS $ cluster or a temporary dir) $ -nnport NameNode port (default 0--we choose) + $ -nnhttpport NameNode HTTP port (default 0--we choose) $ -nodemanagers How many nodemanagers to start (default 1) $ -nodfs Don't start a mini DFS cluster $ -nomr Don't start a mini MR cluster diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java index 3cc73b5aba..324f0ca032 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/MiniHadoopClusterManager.java @@ -69,6 +69,7 @@ public class MiniHadoopClusterManager { private int numNodeManagers; private int numDataNodes; private int nnPort; + private int nnHttpPort; private int rmPort; private int jhsPort; private StartupOption dfsOpts; @@ -92,6 +93,8 @@ private Options makeOptions() { .addOption("datanodes", true, "How many datanodes to start (default 1)") .addOption("format", false, "Format the DFS (default false)") .addOption("nnport", true, "NameNode port (default 0--we choose)") + .addOption("nnhttpport", true, + "NameNode HTTP port (default 0--we choose)") .addOption( "namenode", true, @@ -152,7 +155,8 @@ public void start() throws IOException, FileNotFoundException, URISyntaxException { if (!noDFS) { dfs = new MiniDFSCluster.Builder(conf).nameNodePort(nnPort) - .numDataNodes(numDataNodes).startupOption(dfsOpts).build(); + .nameNodeHttpPort(nnHttpPort).numDataNodes(numDataNodes) + .startupOption(dfsOpts).build(); LOG.info("Started MiniDFSCluster -- namenode on port " + dfs.getNameNodePort()); } @@ -254,6 +258,7 @@ private boolean parseArguments(String[] args) { noDFS = cli.hasOption("nodfs"); numDataNodes = intArgument(cli, "datanodes", 1); nnPort = intArgument(cli, "nnport", 0); + nnHttpPort = intArgument(cli, "nnhttpport", 0); dfsOpts = cli.hasOption("format") ? StartupOption.FORMAT : StartupOption.REGULAR;