diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index ec1c837ef4d..70eae1cd282 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -653,6 +653,9 @@ Release 2.7.0 - UNRELEASED HDFS-7804. correct the haadmin command usage in #HDFSHighAvailabilityWithQJM.html (Brahma Reddy Battula via umamahesh) + HDFS-7772. Document hdfs balancer -exclude/-include option in + HDFSCommands.html (Xiaoyu Yao via cnauroth) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java index 5b87cb54ec3..71338e65e62 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java @@ -170,15 +170,14 @@ public class Balancer { private static final long GB = 1L << 30; //1GB private static final long MAX_SIZE_TO_MOVE = 10*GB; - private static final String USAGE = "Usage: java " - + Balancer.class.getSimpleName() + private static final String USAGE = "Usage: hdfs balancer" + "\n\t[-policy ]\tthe balancing policy: " + BalancingPolicy.Node.INSTANCE.getName() + " or " + BalancingPolicy.Pool.INSTANCE.getName() + "\n\t[-threshold ]\tPercentage of disk capacity" - + "\n\t[-exclude [-f | comma-sperated list of hosts]]" + + "\n\t[-exclude [-f | ]]" + "\tExcludes the specified datanodes." - + "\n\t[-include [-f | comma-sperated list of hosts]]" + + "\n\t[-include [-f | ]]" + "\tIncludes only the specified datanodes." + "\n\t[-idleiterations ]" + "\tNumber of consecutive idle iterations (-1 for Infinite) before exit."; 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 6a7f34c9c2c..0573158d97c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSCommands.md @@ -245,13 +245,22 @@ Commands useful for administrators of a hadoop cluster. ### `balancer` -Usage: `hdfs balancer [-threshold ] [-policy ] [-idleiterations ]` +Usage: + + hdfs balancer + [-threshold ] + [-policy ] + [-exclude [-f | ]] + [-include [-f | ]] + [-idleiterations ] | COMMAND\_OPTION | Description | |:---- |:---- | -| `-policy` *policy* | `datanode` (default): Cluster is balanced if each datanode is balanced.
`blockpool`: Cluster is balanced if each block pool in each datanode is balanced. | -| `-threshold` *threshold* | Percentage of disk capacity. This overwrites the default threshold. | -| `-idleiterations` *iterations* | Maximum number of idle iterations before exit. This overwrites the default idleiterations(5). | +| `-policy` \ | `datanode` (default): Cluster is balanced if each datanode is balanced.
`blockpool`: Cluster is balanced if each block pool in each datanode is balanced. | +| `-threshold` \ | Percentage of disk capacity. This overwrites the default threshold. | +| `-exclude -f` \ \| \ | Excludes the specified datanodes from being balanced by the balancer. | +| `-include -f` \ \| \ | Includes only the specified datanodes to be balanced by the balancer. | +| `-idleiterations` \ | Maximum number of idle iterations before exit. This overwrites the default idleiterations(5). | Runs a cluster balancing utility. An administrator can simply press Ctrl-C to stop the rebalancing process. See [Balancer](./HdfsUserGuide.html#Balancer) for more details.