ChenSammi commented on code in PR #9310:
URL: https://github.com/apache/ozone/pull/9310#discussion_r2540760832
##########
hadoop-hdds/docs/content/design/diskbalancer.md:
##########
@@ -118,6 +119,91 @@ and is not already being moved by another balancing
operation. To optimize perfo
containers repeatedly, it caches the list of containers for each volume which
auto expires after one hour of its last
used time or if the container iterator for that is invalidated on full
utilisation.
+## CLI Interface
+
+The DiskBalancer CLI provides the following commands:
+
+### Command Syntax
+
+**Start DiskBalancer:**
+```bash
+ozone admin datanode diskbalancer start [<datanode-address> ...] [OPTIONS]
[--in-service-datanodes]
+```
+
+**Stop DiskBalancer:**
+```bash
+ozone admin datanode diskbalancer stop [<datanode-address> ...]
[--in-service-datanodes]
+```
+
+**Update Configuration:**
+```bash
+ozone admin datanode diskbalancer update [<datanode-address> ...] [OPTIONS]
[--in-service-datanodes]
+```
+
+**Get Status:**
+```bash
+ozone admin datanode diskbalancer status [<datanode-address> ...]
[--in-service-datanodes] [--json]
+```
+
+**Get Report:**
+```bash
+ozone admin datanode diskbalancer report [<datanode-address> ...]
[--in-service-datanodes] [--json]
+```
+
+### Command Options
+
+| Option | Description
|
Example |
+|-------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------|
+| `<datanode-address>` | One or more datanode addresses as
positional arguments. Addresses can be:<br>- Hostname (e.g., `DN-1`) - uses
default CLIENT_RPC port (9858)<br>- Hostname with port (e.g., `DN-1:9858`)<br>-
IP address (e.g., `192.168.1.10`)<br>- IP address with port (e.g.,
`192.168.1.10:9858`)<br>- Stdin (`-`) - reads datanode addresses from standard
input, one per line | `DN-1`<br>`DN-1:9858`<br>`192.168.1.10`<br>`-` |
+| `--in-service-datanodes` | It queries SCM for all IN_SERVICE
datanodes and executes the command on all of them.
| `--in-service-datanodes` |
+| `--json` | Format output as JSON.
|
`--json` |
+| `-t/--threshold` | Volume density threshold percentage
(default: 10.0). Used with `start` and `update` commands.
| `-t 5`<br>`--threshold 5.0` |
+| `-b/--bandwidth-in-mb` | Maximum disk bandwidth in MB/s
(default: 10). Used with `start` and `update` commands.
| `-b 20`<br>`--bandwidth-in-mb 50` |
+| `-p/--parallel-thread` | Number of parallel threads (default:
1). Used with `start` and `update` commands.
| `-p 5`<br>`--parallel-thread 10` |
+| `-s/--stop-after-disk-even` | Stop automatically after disks are
balanced (default: false). Used with `start` and `update` commands.
| `-s false`<br>`--stop-after-disk-even true` |
+
+### Examples
+
+```bash
+# Start DiskBalancer on a specific datanode
+ozone admin datanode diskbalancer start DN-1
+
+# Start DiskBalancer on multiple datanodes
+ozone admin datanode diskbalancer start DN-1 DN-2 DN-3
+
+# Start DiskBalancer on all IN_SERVICE datanodes
+ozone admin datanode diskbalancer start --in-service-datanodes
+
+# Start DiskBalancer with configuration parameters
+ozone admin datanode diskbalancer start DN-1 -t 5 -b 20 -p 5
+
+# Read datanode addresses from stdin
+echo -e "DN-1\nDN-2" | ozone admin datanode diskbalancer start -
Review Comment:
Can we support a option "-f" which accepts an file, for example "-f
datanode_list.txt", in stead of this command pipeline mode ? Get input from
file is a common used practice in Ozone and Hadoop CLI. Why get input from
stdin is not really popular.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]