Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Question on HDFS rebalance

avatar
Expert Contributor

HDFS rebalance could be performed from command line or through Ambari UI. Which one do you suggest ? I would like to know the status of the rebalance or logs with error message in case if it fails

1 ACCEPTED SOLUTION

avatar
Not applicable

@Kumar Veerappan

- Via Ambari or Command line. In both ways the same command will be used. The actual command will be : https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#balancer

hdfs balancer -threshold

.

- Ambari will use the following python script and the command: https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2....

def startRebalancingProcess(threshold):
  rebalanceCommand = 'hdfs balancer -threshold %s' % threshold
  return ['cmd', '/C', rebalanceCommand]

- Via command line you will get some additional options to be passed the the "hdfs balancer" command which will allow to get more control on it.

 hdfs balancer
          [-threshold <threshold>]
          [-policy <policy>]
          [-exclude [-f <hosts-file> | <comma-separated list of hosts>]]
          [-include [-f <hosts-file> | <comma-separated list of hosts>]]
          [-idleiterations <idleiterations>]

.

View solution in original post

1 REPLY 1

avatar
Not applicable

@Kumar Veerappan

- Via Ambari or Command line. In both ways the same command will be used. The actual command will be : https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#balancer

hdfs balancer -threshold

.

- Ambari will use the following python script and the command: https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2....

def startRebalancingProcess(threshold):
  rebalanceCommand = 'hdfs balancer -threshold %s' % threshold
  return ['cmd', '/C', rebalanceCommand]

- Via command line you will get some additional options to be passed the the "hdfs balancer" command which will allow to get more control on it.

 hdfs balancer
          [-threshold <threshold>]
          [-policy <policy>]
          [-exclude [-f <hosts-file> | <comma-separated list of hosts>]]
          [-include [-f <hosts-file> | <comma-separated list of hosts>]]
          [-idleiterations <idleiterations>]

.