Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5157]fix: User can specify the krb5 conf file path for Kerberos enabled Hadoop catalog #5165

Closed
wants to merge 1 commit into from

Conversation

tyoushinya
Copy link
Contributor

What changes were proposed in this pull request?

User can specify the krb5 conf file path for Kerberos enabled Hadoop catalog.

Why are the changes needed?

Fix: #5157

Does this PR introduce any user-facing change?

Add a property key java.security.krb5.conf for Kerberos enabled Hadoop catalog.

How was this patch tested?

Create a Hadoop catalog for Kerberos enabled HDFS, you can put krb5.conf in any readable path of Gravatino host, and add the config java.security.krb5.conf=/X/krb5.conf , then the Hadoop catalog can be created succeed and all works well.

KRB5_CONF_KEY,
"The Kerberos krb file for the catalog",
false /* immutable */,
"/etc/krb5.conf" /* defaultValue */,
Copy link
Contributor

Choose a reason for hiding this comment

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

As the default value is /etc/krb5.conf, what if the file is not found?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the file is not exist, "Can't get Kerberos realm" error message will be shown. This behavior is same as before.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

String krbFilePath = kerberosConfig.getKrb5Conf();
Preconditions.checkArgument(
StringUtils.isNotBlank(krbFilePath), "The Kerberos krb file can't be blank");
System.setProperty("java.security.krb5.conf", krbFilePath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this method class loader isolated? I mean what if I set java.security.krb5.conf in catalogA, does it take effect in catalogB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The configuration is separated for each catalog, this mean the setting of catalogA can not affect catalogB.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean if we set the value in catalogA, and in catalogB, could we still get the value if catalogB does not set it?

@@ -32,6 +32,7 @@ Besides the [common catalog properties](./gravitino-server-config.md#gravitino-c
| `default-filesystem-provider` | The name default filesystem providers of this Hadoop catalog if users do not specify the scheme in the URI. Default value is `builtin-local` | `builtin-local` | No | 0.7.0-incubating |
| `authentication.impersonation-enable` | Whether to enable impersonation for the Hadoop catalog. | `false` | No | 0.5.1 |
| `authentication.type` | The type of authentication for Hadoop catalog, currently we only support `kerberos`, `simple`. | `simple` | No | 0.5.1 |
| `java.security.krb5.conf` | Kerberos krb file for configuration of Kerberos. | /etc/krb5.conf | No | 0.7.0-incubating |
Copy link
Contributor

Choose a reason for hiding this comment

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

Let me think if there is a better name for it, java.security.krb5.conf is so long.

Copy link
Contributor

Choose a reason for hiding this comment

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

what about krb5.conf.path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LGTM about the name changing. That mean I should create a new PR for it, is it correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

That mean I should create a new PR for it?

No, if it's okay, please do it in this PR.

@jerqi
Copy link
Collaborator

jerqi commented Oct 18, 2024

krb5 conf can't be config option of the catalog. System.properties() can't be isolated with the class loader.

@tyoushinya tyoushinya closed this Oct 18, 2024
@tyoushinya tyoushinya deleted the fix-5157 branch October 18, 2024 07:51
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.

[Improvement] User can specify the krb5 conf file path for Kerberos enabled Hadoop catalog
3 participants