After expanding or shrinking (without migrating data) a volume (using the add-brick and remove-brick commands respectively), you need to rebalance the data among the servers. In a non-replicated volume, all bricks should be up to perform replace brick operation (start option). In a replicated volume, at least one of the brick in the replica should be up.
Important
In Red Hat Storage 2.0 Update 4 release, the fix-layout step after adding a brick has been deprecated. When a brick is added, the distributed hash table is modified automatically.
To rebalance a volume
- Start the rebalance operation on any one of the servers using the following command:
# gluster volume rebalanceVOLNAMEstartFor example:# gluster volume rebalance test-volume start Starting rebalancing on volume test-volume has been successful
- Start the migration operation forcefully on any one of the servers using the following command:
# gluster volume rebalanceVOLNAMEstart forceFor example:# gluster volume rebalance test-volume start force Starting rebalancing on volume test-volume has been successful
You can display the status information about rebalance volume operation, as needed.
To view status of rebalance volume
- Check the status of the rebalance operation, using the following command:
# gluster volume rebalanceVOLNAMEstatusFor example:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 14567 150 0 in progress 10.16.156.72 140 2134 201 2 in progressThe time to complete the rebalance operation depends on the number of files on the volume along with the corresponding file sizes. Continue checking the rebalance status, verifying that the number of files rebalanced or total files scanned keeps increasing.For example, running the status command again might display a result similar to the following:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 14567 150 0 in progress 10.16.156.72 140 2134 201 2 in progressThe rebalance status displays the following when the rebalance is complete:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 15674 170 0 completed 10.16.156.72 140 3423 321 2 completed