Skip to content

Commit

Permalink
set configuration hive.metastore.sasl.enabled automatically when ke…
Browse files Browse the repository at this point in the history
…rberos is enabled.
  • Loading branch information
yuqi1129 committed Oct 31, 2024
1 parent b2730a9 commit 58a69e8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ void testIcebergWithKerberosAndUserImpersonation() throws IOException {
CATALOG_BYPASS_PREFIX + "hive.metastore.kerberos.principal",
"hive/_HOST@HADOOPKRB"
.replace("_HOST", containerSuite.getKerberosHiveContainer().getHostName()));
properties.put(CATALOG_BYPASS_PREFIX + "hive.metastore.sasl.enabled", "true");

properties.put(IcebergConfig.CATALOG_BACKEND.getKey(), TYPE);
properties.put(IcebergConfig.CATALOG_URI.getKey(), URIS);
properties.put(IcebergConfig.CATALOG_WAREHOUSE.getKey(), WAREHOUSE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION;
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -78,6 +79,7 @@ private static HiveCatalog loadHiveCatalog(IcebergConfig icebergConfig) {
resultProperties.put(CatalogProperties.CLIENT_POOL_CACHE_KEYS, "USER_NAME");
hdfsConfiguration.set(HADOOP_SECURITY_AUTHORIZATION, "true");
hdfsConfiguration.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos");
hdfsConfiguration.set(METASTORE_USE_THRIFT_SASL.varname, "true");
hiveCatalog.setConf(hdfsConfiguration);
hiveCatalog.initialize(icebergCatalogName, properties);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ Map<String, String> getCatalogConfig() {
configMap.put(
"gravitino.iceberg-rest.authentication.kerberos.keytab-uri",
tempDir + HIVE_METASTORE_CLIENT_KEYTAB);
configMap.put("gravitino.iceberg-rest.hive.metastore.sasl.enabled", "true");
configMap.put(
"gravitino.iceberg-rest.hive.metastore.kerberos.principal",
"hive/_HOST@HADOOPKRB"
Expand Down

0 comments on commit 58a69e8

Please sign in to comment.