How Do I Balance HDFS Data?
- Log in to the master node of the cluster and run the corresponding command to configure environment variables. /opt/client indicates the client installation directory. Replace it with the actual one.
source /opt/client/bigdata_env
kinit Component service user (If Kerberos authentication is enabled for the cluster, run this command to authenticate the user. Skip this step if the Kerberos authentication is disabled.)
- Run the following command to start the balancer:
- View the log.
After you execute the balance task, the hadoop-root-balancer-Host name.log log file will be generated in the client installation directory /opt/client/HDFS/hadoop/logs.
- (Optional) If you do not want to perform data balancing, run the following commands to stop the balancer:
source /opt/client/bigdata_env
kinit Component service user (If Kerberos authentication is enabled for the cluster, run this command to authenticate the user. Skip this step if the Kerberos authentication is disabled.)
/opt/client/HDFS/hadoop/sbin/stop-balancer.sh -threshold 5
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.