Skip to content

HDDS-3128. Add support for kdiag and kerbname commands to ozone script#9868

Draft
navinko wants to merge 3 commits intoapache:masterfrom
navinko:HDDS-3128
Draft

HDDS-3128. Add support for kdiag and kerbname commands to ozone script#9868
navinko wants to merge 3 commits intoapache:masterfrom
navinko:HDDS-3128

Conversation

@navinko
Copy link
Contributor

@navinko navinko commented Mar 5, 2026

What changes were proposed in this pull request?

HDDS-3128. Add support for kdiag and kerbname commands to ozone script

  • Added changes for verifying how Kerberos principals map to local Unix users and collecting kerberos diagnostic which is useful when debugging and troubleshooting in secure clusters.
  1. ozone kdiag - This is useful when troubleshooting authentication failures in Ozone services.
    Exposes the Hadoop KDiag diagnostic tool through the Ozone CLI.
  2. ozone kerbname - Added a CLI utility to translate Kerberos principals into local user names using the configured hadoop.security.auth_to_local rules.
  • Fixed checkstyle issues.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-3128

How was this patch tested?

bash-5.1$ ozone kerbname om/om@EXAMPLE.COM
Name: om/om@EXAMPLE.COM to om
bash-5.1$ ozone kerbname om@EXAMPLE.COM
Name: om@EXAMPLE.COM to om
bash-5.1$ ozone kerbname om@EXAMPLE_ERORRCASE.COM
Exception in thread "main" org.apache.hadoop.security.authentication.util.KerberosName$NoMatchingRule: No rules applied to om@EXAMPLE_ERORRCASE.COM
at org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:429)
at org.apache.hadoop.ozone.kerberos.KerbName.main(KerbName.java:50)

bash-5.1$ ozone kdiag | grep -i login
JVM Kerberos Login Module = com.sun.security.auth.module.Krb5LoginModule
java.security.auth.login.config = "(unset)"
hadoop.kerberos.min.seconds.before.relogin = "60"
Ticket based login: true
Keytab based login: false

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @navinko for working on this. I think we should add these new commands under ozone debug, not at the top-level. Also, please implement as a picocli @Command. See VersionDebug as an example. KDiag would need to be copied to Ozone and adapted.

@navinko
Copy link
Contributor Author

navinko commented Mar 5, 2026

I think we should add these new commands under ozone debug, not at the top-level. Also, please implement as a picocli @Command. See VersionDebug as an example. KDiag would need to be copied to Ozone and adapted.

Hi @adoroszlai Thank you for reviewing . I have one doubt

KDiag would need to be copied to Ozone and adapted.
Does it mean keeping the wrapper and reuse Hadoop KDiag and append Ozone diagnostics or copy the KDiag implementation into Ozone and extend it further ?

@adoroszlai
Copy link
Contributor

adoroszlai commented Mar 5, 2026

KDiag would need to be copied to Ozone and adapted.

Does it mean keeping the wrapper and reuse Hadoop KDiag and append Ozone diagnostics or copy the KDiag implementation into Ozone and extend it further ?

The latter (copy to Ozone, change to use picocli instead of its own argument parsing, replace Hadoop-specific variables/properties with Ozone-specific ones, etc.).

@navinko
Copy link
Contributor Author

navinko commented Mar 6, 2026

KDiag would need to be copied to Ozone and adapted.

Does it mean keeping the wrapper and reuse Hadoop KDiag and append Ozone diagnostics or copy the KDiag implementation into Ozone and extend it further ?

The latter (copy to Ozone, change to use picocli instead of its own argument parsing, replace Hadoop-specific variables/properties with Ozone-specific ones, etc.).

Thank you , I will update the PR shortly.

@navinko navinko marked this pull request as draft March 6, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants