Skip to content

Commit

Permalink
Added changes to support without kerberos authentication (#2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
VenkatasivareddyTR authored Jun 14, 2024
1 parent 3682266 commit 80b4a0c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Map;

import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_RPC_PROTECTION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_SECURITY_AUTHENTICATION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_AUTH_ENABLED;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_CONFIG_FILES_S3_REFERENCE;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.PRINCIPAL_NAME;
Expand Down Expand Up @@ -129,6 +130,8 @@ private Connection createConnection(String host, String masterPort, String zooke
logger.info("Kerberos Authentication Enabled: " + kerberosAuthEnabled);
if (kerberosAuthEnabled) {
String keytabLocation = null;
config.set("hbase.security.authentication", HBASE_SECURITY_AUTHENTICATION);
config.set("hadoop.security.authentication", HBASE_SECURITY_AUTHENTICATION);
config.set("hbase.rpc.protection", configOptions.get(HBASE_RPC_PROTECTION));
logger.info("hbase.rpc.protection: " + config.get("hbase.rpc.protection"));
String s3uri = configOptions.get(KERBEROS_CONFIG_FILES_S3_REFERENCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class HbaseKerberosUtils
public static final String PRINCIPAL_NAME = "principal_name";
public static final String HBASE_RPC_PROTECTION = "hbase_rpc_protection";
public static final String KERBEROS_AUTH_ENABLED = "kerberos_auth_enabled";
public static final String HBASE_SECURITY_AUTHENTICATION = "kerberos";

private HbaseKerberosUtils() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Map;

import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_RPC_PROTECTION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_SECURITY_AUTHENTICATION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_AUTH_ENABLED;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_CONFIG_FILES_S3_REFERENCE;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.PRINCIPAL_NAME;
Expand Down Expand Up @@ -131,6 +132,8 @@ private HBaseConnection createConnection(String host, String masterPort, String
logger.info("Kerberos Authentication Enabled: " + kerberosAuthEnabled);
if (kerberosAuthEnabled) {
String keytabLocation = null;
config.set("hbase.security.authentication", HBASE_SECURITY_AUTHENTICATION);
config.set("hadoop.security.authentication", HBASE_SECURITY_AUTHENTICATION);
config.set("hbase.rpc.protection", configOptions.get(HBASE_RPC_PROTECTION));
logger.info("hbase.rpc.protection: " + config.get("hbase.rpc.protection"));
String s3uri = configOptions.get(KERBEROS_CONFIG_FILES_S3_REFERENCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.List;

import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_RPC_PROTECTION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.HBASE_SECURITY_AUTHENTICATION;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_AUTH_ENABLED;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.KERBEROS_CONFIG_FILES_S3_REFERENCE;
import static com.amazonaws.athena.connectors.hbase.HbaseKerberosUtils.PRINCIPAL_NAME;
Expand Down Expand Up @@ -103,6 +104,8 @@ private Configuration getHbaseConfiguration(String connectionStr)
logger.info("Kerberos Authentication Enabled: " + kerberosAuthEnabled);
if (kerberosAuthEnabled) {
String keytabLocation = null;
configuration.set("hbase.security.authentication", HBASE_SECURITY_AUTHENTICATION);
configuration.set("hadoop.security.authentication", HBASE_SECURITY_AUTHENTICATION);
configuration.set("hbase.rpc.protection", configOptions.get(HBASE_RPC_PROTECTION));
logger.info("hbase.rpc.protection: " + configuration.get("hbase.rpc.protection"));
String s3uri = configOptions.get(KERBEROS_CONFIG_FILES_S3_REFERENCE);
Expand Down
4 changes: 0 additions & 4 deletions athena-hbase/src/main/resources/core-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
<name>io.compression.codecs</name>
<value>org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.BZip2Codec,org.apache.hadoop.io.compress.DeflateCodec,org.apache.hadoop.io.compress.SnappyCodec,org.apache.hadoop.io.compress.Lz4Codec</value>
</property>
<property>
<name>hadoop.security.authentication</name>
<value>kerberos</value>
</property>
<property>
<name>hadoop.security.authorization</name>
<value>true</value>
Expand Down
4 changes: 0 additions & 4 deletions athena-hbase/src/main/resources/hbase-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@
<name>hbase.snapshot.master.timeout.millis</name>
<value>300000</value>
</property>
<property>
<name>hbase.security.authentication</name>
<value>kerberos</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>60000</value>
Expand Down

0 comments on commit 80b4a0c

Please sign in to comment.