@InterfaceAudience.Private public final class HBaseKerberosUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_KEYTAB |
static String |
CLIENT_PRINCIPAL |
static String |
KRB_KEYTAB_FILE |
static String |
KRB_PRINCIPAL |
private static org.slf4j.Logger |
LOG |
static String |
MASTER_KRB_PRINCIPAL |
Modifier | Constructor and Description |
---|---|
private |
HBaseKerberosUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getClientKeytabForTesting() |
static String |
getClientPrincipalForTesting() |
static org.apache.hadoop.conf.Configuration |
getConfigurationWoPrincipal() |
static String |
getKeytabFileForTesting() |
static String |
getPrincipalForTesting() |
static org.apache.hadoop.conf.Configuration |
getSecuredConfiguration() |
static boolean |
isKerberosPropertySetted() |
static org.apache.hadoop.security.UserGroupInformation |
loginAndReturnUGI(org.apache.hadoop.conf.Configuration conf,
String username) |
static void |
setClientKeytabForTesting(String clientKeytab) |
static void |
setClientPrincipalForTesting(String clientPrincipal) |
static void |
setKeytabFileForTesting(String keytabFile) |
static void |
setPrincipalForTesting(String principal) |
static void |
setSecuredConfiguration(org.apache.hadoop.conf.Configuration conf) |
static void |
setSecuredConfiguration(org.apache.hadoop.conf.Configuration conf,
String servicePrincipal,
String spnegoPrincipal)
Set up configuration for a secure HDFS+HBase cluster.
|
private static void |
setSecuredHadoopConfiguration(org.apache.hadoop.conf.Configuration conf,
String spnegoServerPrincipal) |
static void |
setSSLConfiguration(HBaseCommonTestingUtility utility,
Class<?> clazz)
Set up SSL configuration for HDFS NameNode and DataNode.
|
static void |
setSystemProperty(String propertyName,
String propertyValue) |
private static final org.slf4j.Logger LOG
public static final String KRB_PRINCIPAL
public static final String MASTER_KRB_PRINCIPAL
public static final String KRB_KEYTAB_FILE
public static final String CLIENT_PRINCIPAL
public static final String CLIENT_KEYTAB
private HBaseKerberosUtils()
public static boolean isKerberosPropertySetted()
public static void setPrincipalForTesting(String principal)
public static void setKeytabFileForTesting(String keytabFile)
public static void setClientPrincipalForTesting(String clientPrincipal)
public static void setClientKeytabForTesting(String clientKeytab)
public static void setSystemProperty(String propertyName, String propertyValue)
public static String getKeytabFileForTesting()
public static String getPrincipalForTesting()
public static String getClientPrincipalForTesting()
public static String getClientKeytabForTesting()
public static org.apache.hadoop.conf.Configuration getConfigurationWoPrincipal()
public static org.apache.hadoop.conf.Configuration getSecuredConfiguration()
public static void setSecuredConfiguration(org.apache.hadoop.conf.Configuration conf, String servicePrincipal, String spnegoPrincipal)
conf
- configuration object.servicePrincipal
- service principal used by NN, HM and RS.spnegoPrincipal
- SPNEGO principal used by NN web UI.public static void setSecuredConfiguration(org.apache.hadoop.conf.Configuration conf)
private static void setSecuredHadoopConfiguration(org.apache.hadoop.conf.Configuration conf, String spnegoServerPrincipal)
public static void setSSLConfiguration(HBaseCommonTestingUtility utility, Class<?> clazz) throws Exception
utility
- a HBaseTestingUtility object.clazz
- the caller test class.Exception
- if unable to set up SSL configurationpublic static org.apache.hadoop.security.UserGroupInformation loginAndReturnUGI(org.apache.hadoop.conf.Configuration conf, String username) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.