HDFS-11270. Document the missing options of NameNode bootstrap command. Contributed by Yiqun Lin
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c0e0ef29 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c0e0ef29 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c0e0ef29 Branch: refs/heads/YARN-5085 Commit: c0e0ef29696109af9a018462059f08fd99ee3121 Parents: 0665c5f Author: Mingliang Liu <[email protected]> Authored: Tue Dec 27 11:21:10 2016 -0800 Committer: Mingliang Liu <[email protected]> Committed: Tue Dec 27 11:21:10 2016 -0800 ---------------------------------------------------------------------- .../hadoop/hdfs/server/common/HdfsServerConstants.java | 1 + .../org/apache/hadoop/hdfs/server/namenode/NameNode.java | 5 ++++- .../hadoop/hdfs/server/namenode/ha/BootstrapStandby.java | 10 ++++++++-- .../hadoop-hdfs/src/site/markdown/HDFSCommands.md | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/c0e0ef29/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java index d112a48..c9a46f0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java @@ -156,6 +156,7 @@ public interface HdfsServerConstants { RECOVER ("-recover"), FORCE("-force"), NONINTERACTIVE("-nonInteractive"), + SKIPSHAREDEDITSCHECK("-skipSharedEditsCheck"), RENAMERESERVED("-renameReserved"), METADATAVERSION("-metadataVersion"), UPGRADEONLY("-upgradeOnly"), http://git-wip-us.apache.org/repos/asf/hadoop/blob/c0e0ef29/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java index d825177..f6c724b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java @@ -307,7 +307,10 @@ public class NameNode extends ReconfigurableBase implements + RollingUpgradeStartupOption.getAllOptionString() + " ] | \n\t[" + StartupOption.IMPORT.getName() + "] | \n\t[" + StartupOption.INITIALIZESHAREDEDITS.getName() + "] | \n\t[" - + StartupOption.BOOTSTRAPSTANDBY.getName() + "] | \n\t[" + + StartupOption.BOOTSTRAPSTANDBY.getName() + " [" + + StartupOption.FORCE.getName() + "] [" + + StartupOption.NONINTERACTIVE.getName() + "] [" + + StartupOption.SKIPSHAREDEDITSCHECK.getName() + "] ] | \n\t[" + StartupOption.RECOVER.getName() + " [ " + StartupOption.FORCE.getName() + "] ] | \n\t[" + StartupOption.METADATAVERSION.getName() + " ]"; http://git-wip-us.apache.org/repos/asf/hadoop/blob/c0e0ef29/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java index 5e0f416..4d6716f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java @@ -136,8 +136,14 @@ public class BootstrapStandby implements Tool, Configurable { } private void printUsage() { - System.err.println("Usage: " + this.getClass().getSimpleName() + - " [-force] [-nonInteractive] [-skipSharedEditsCheck]"); + System.out.println("Usage: " + this.getClass().getSimpleName() + + " [-force] [-nonInteractive] [-skipSharedEditsCheck]\n" + + "\t-force: formats if the name directory exists.\n" + + "\t-nonInteractive: formats aborts if the name directory exists,\n" + + "\tunless -force option is specified.\n" + + "\t-skipSharedEditsCheck: skips edits check which ensures that\n" + + "\twe have enough edits already in the shared directory to start\n" + + "\tup from the last checkpoint on the active."); } private NamenodeProtocol createNNProtocolProxy(InetSocketAddress otherIpcAddr) http://git-wip-us.apache.org/repos/asf/hadoop/blob/c0e0ef29/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md index a0d0ed7..7b00e9c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md @@ -535,7 +535,7 @@ Usage: [-rollingUpgrade <rollback |started> ] | [-importCheckpoint] | [-initializeSharedEdits] | - [-bootstrapStandby] | + [-bootstrapStandby [-force] [-nonInteractive] [-skipSharedEditsCheck] ] | [-recover [-force] ] | [-metadataVersion ] @@ -550,7 +550,7 @@ Usage: | `-rollingUpgrade` \<rollback\|started\> | See [Rolling Upgrade document](./HdfsRollingUpgrade.html#NameNode_Startup_Options) for the detail. | | `-importCheckpoint` | Loads image from a checkpoint directory and save it into the current one. Checkpoint dir is read from property dfs.namenode.checkpoint.dir | | `-initializeSharedEdits` | Format a new shared edits dir and copy in enough edit log segments so that the standby NameNode can start up. | -| `-bootstrapStandby` | Allows the standby NameNode's storage directories to be bootstrapped by copying the latest namespace snapshot from the active NameNode. This is used when first configuring an HA cluster. | +| `-bootstrapStandby` `[-force]` `[-nonInteractive]` `[-skipSharedEditsCheck]` | Allows the standby NameNode's storage directories to be bootstrapped by copying the latest namespace snapshot from the active NameNode. This is used when first configuring an HA cluster. The option -force or -nonInteractive has the same meaning as that described in namenode -format command. -skipSharedEditsCheck option skips edits check which ensures that we have enough edits already in the shared directory to start up from the last checkpoint on the active. | | `-recover` `[-force]` | Recover lost metadata on a corrupt filesystem. See [HDFS User Guide](./HdfsUserGuide.html#Recovery_Mode) for the detail. | | `-metadataVersion` | Verify that configured directories exist, then print the metadata versions of the software and the image. | --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
