Configuring disk balancer

Configure Disk Balancer feature flags, operational settings, and security permissions in ozone-site.xml to safely manage intra-node data migration across Datanode volumes.

The Disk Balancer is enabled by default. If you need to turn the feature off, set the hdds.datanode.disk.balancer.enabled property to false in your ozone-site.xml file on your Datanodes.

<property>
  <name>hdds.datanode.disk.balancer.enabled</name>
  <value>false</value>
</property>

You can tune the Disk Balancer using the following configuration properties:

Table 1. Disk Balancer configurations
Property Default value Description
hdds.datanode.disk.balancer.enabled true Enables or disables the Disk Balancer feature on the Datanode.
hdds.datanode.disk.balancer.volume.density.threshold.percent 10.0 The deviation percentage from average utilization required to trigger balancing.
hdds.datanode.disk.balancer.max.disk.throughputInMBPerSec 10 The maximum bandwidth (MB/s) the Disk Balancer is allowed to consume, ensuring no disruption to production I/O.
hdds.datanode.disk.balancer.parallel.thread 5 The maximum number of threads dedicated to concurrent container moves.
hdds.datanode.disk.balancer.service.interval 60s Specifies the time interval at which the Disk Balancer service checks for volume imbalance and reloads configuration settings.
hdds.datanode.disk.balancer.stop.after.disk.even true Controls whether the Disk Balancer service automatically stops after all volume data densities drop within the threshold.
hdds.datanode.disk.balancer.replica.deletion.delay 5m The delay time before the source container is deleted after a successful move.
hdds.datanode.disk.balancer.container.states CLOSED, QUASI_CLOSED A comma-separated list of container states eligible for moving.
hdds.datanode.disk.balancer.container.choosing.policy org.apache.hadoop. ozone.container. diskbalancer.policy. DefaultContainerChoosingPolicy The policy for selecting source and destination volumes and eligible containers to move.
hdds.datanode.disk.balancer.service.timeout 300s The maximum timeout duration allowed for Disk Balancer service operations.
hdds.datanode.disk.balancer.should.run.default false Specifies whether the Disk Balancer service should run by default.

Example configuration:

<configuration>
  <!-- Feature Activation -->
  <property>
    <name>hdds.datanode.disk.balancer.enabled</name>
    <value>true</value>
  </property>

  <!-- Threshold and Operational Limits -->
  <property>
    <name>hdds.datanode.disk.balancer.volume.density.threshold</name>
    <value>10.0</value>
  </property>

  <property>
    <name>hdds.datanode.disk.balancer.bandwidth.per.volume.in.mb</name>
    <value>20</value>
  </property>

  <property>
    <name>hdds.datanode.disk.balancer.parallel.threads</name>
    <value>5</value>
  </property>

  <property>
    <name>hdds.datanode.disk.balancer.container.states</name>
    <value>CLOSED,QUASI_CLOSED</value>
  </property>

  <property>
    <name>hdds.datanode.disk.balancer.stop-after-disk-even</name>
    <value>true</value>
  </property>
</configuration>