Class ZKAuthentication
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKAuthentication
Provides ZooKeeper authentication services for both client and server processes.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
A JAAS configuration that defines the login modules that we want to use for ZooKeeper login. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isSecureZooKeeper
(org.apache.hadoop.conf.Configuration conf) Returnstrue
when secure authentication is enabled (whetherhbase.security.authentication
is set to "kerberos
").private static void
login
(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname, String loginContextProperty, String loginContextName) Log in the current process using the given configuration keys for the credential file and login principal.static void
loginClient
(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) Log in the current zookeeper client using the given configuration keys for the credential file and login principal.static void
loginServer
(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) Log in the current zookeeper server process using the given configuration keys for the credential file and login principal.
-
Field Details
-
LOG
-
-
Constructor Details
-
ZKAuthentication
private ZKAuthentication()
-
-
Method Details
-
loginServer
public static void loginServer(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException Log in the current zookeeper server process using the given configuration keys for the credential file and login principal.This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
- Parameters:
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentials- Throws:
IOException
- underlying exception from SecurityUtil.login() call
-
loginClient
public static void loginClient(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException Log in the current zookeeper client using the given configuration keys for the credential file and login principal.This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
- Parameters:
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentials- Throws:
IOException
- underlying exception from SecurityUtil.login() call
-
login
private static void login(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname, String loginContextProperty, String loginContextName) throws IOException Log in the current process using the given configuration keys for the credential file and login principal.This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
- Parameters:
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentialsloginContextProperty
- property name to expose the entry nameloginContextName
- jaas entry name- Throws:
IOException
- underlying exception from SecurityUtil.login() call
-
isSecureZooKeeper
Returnstrue
when secure authentication is enabled (whetherhbase.security.authentication
is set to "kerberos
").
-