ArafatKhan2198 opened a new pull request, #7229:
URL: https://github.com/apache/ozone/pull/7229
## What changes were proposed in this pull request?
In some customer environments, the configuration value for the DataNode
storage directory (`hdds.datanode.dir`) was only available on the server-side,
but not on the client-side. As a result, when users executed commands like
ozone debug container list, the tool would fall back to the client’s default
configuration, potentially leading to discrepancies or incorrect paths being
used. Specifically, the command would revert to the path defined in the default
configuration (`dfs.datanode.data.dir`), which in this case was :-
`/tmp/hadoop-root/dfs/data/hdds/VERSION`
```
[root@ccycloud~]# ozone debug container list
/tmp/hadoop-root/dfs/data/hdds/VERSION (No such file or directory)
```
### Initial Workaround:
To overcome this, we initially allowed users to manually override the
configuration using the -D parameter, like so:
```
ozone debug -Dhdds.datanode.dir=/data/hdds container list
```
While functional, this was not ideal. It required users to understand and
manipulate the underlying configuration properties at runtime, making the CLI
usage more complex and less intuitive.
### Solution:
We introduced a new `--path` (`-p`) option to simplify the process. This
allows users to directly specify the DataNode storage directory path where
container data and metadata are stored, without relying on client-side
configuration or overriding properties with `-D`.
For example:
```
sh-4.2$ ozone debug container list -p
Missing required parameter for option '--path' (<dataPath>)
Usage: ozone debug container list [-p=<dataPath>]
Show container info of all container replicas on datanode
-p, --path=<dataPath> Specifies the absolute path to the DataNode storage
directory containing container data and metadata.
If provided, this path will be used instead of
the
default configured path. Example:
--path=/data/hdds
```
This makes it easier for users to specify custom DataNode paths, especially
when the configuration value isn't accessible on the client side.
**_If the path is not explicitly provided, the client-side configuration
will still be used as a fallback._**
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11479
## How was this patch tested?
Tested Manually.
--
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]