Configuring Authentication
Some Drill databases require authentication. You can configure the Simba Drill JDBC Connector to authenticate the connection to the database using one of several methods. For more information, see the following sections:
For some of the connection properties used for authentication, the connector supports more than one property name. For example, you can set either AuthMech or auth to specify the authentication mechanism to use. For complete information about each connection property, see Connector Configuration Options.
Using Your Drill User Name and Password
You can configure the connector to use your Drill data store credentials to authenticate the connection.
You provide this information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.
To configure user name and password authentication:
- Set the
AuthMechproperty toPlain. - Set the
UIDproperty to an appropriate user name for accessing the Drill server. - Set the
PWDproperty to the password corresponding to the user name you provided.
For example:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=Plain;
UID=simba;PWD=simba
Using Kerberos
You can configure the connector to use the Kerberos protocol to authenticate the connection.
Kerberos must be installed and configured before you can use this authentication mechanism. For information about how to install and configure Kerberos, see the MIT Kerberos Documentation: http://web.mit.edu/kerberos/krb5-latest/doc/.
You can configure Kerberos authentication in the connector using a keytab or a service principal name, depending on the specific requirements of your Kerberos setup.
You provide this information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.
To configure Kerberos authentication using a keytab:
- Set the
AuthMechproperty toKerberos. - Set the
KrbKeytabproperty to the full path and file name of your keytab file. - Set the
UIDproperty to your client principal name. - Optionally, set the
KrbRealmproperty to the realm name of the service principal. If you do not set this property, the connector uses the default realm defined in your Kerberos setup.
For example:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=Kerberos;
KrbKeytab=C:\\myKeytabs\\myUser.keytab;UID=simba;
KrbRealm=drill.example.com
To configure Kerberos authentication using the service principal name:
- Run the
kinitcommand using the following syntax, where[Keytab]is the Kerberos credential and[Principal]is the Kerberos user principal to use for authentication: - In your connection URL, set the
AuthMechproperty toKerberos. - Do one of the following:
- To specify a complete service principal name including the primary and instance (and optionally, the realm), set the
KrbPrincipalproperty to the service principal name. - Or, to specify one or more components of the service principal name individually, configure one or more of the following connection properties as needed:
For example, the following settings are both valid:
KrbPrincipal=jsmith/simbadrill
KrbPrincipal=jsmith/simbadrill@drill.example.com
Component Configuration Instructions Primary
Set the
KrbServiceNameproperty to the primary name of the service principal.If you do not set this property, the connector uses the default value
drillas the primary name.Instance
Set the
KrbHostFQDNproperty to the instance name of the service principal.If you do not set this property, the connector uses the host name of the drillbit as the instance name.
Realm
Set the
KrbRealmproperty to the realm name of the service principal.If you do not set this property, the connector uses the default realm defined in your Kerberos setup.
- To specify a complete service principal name including the primary and instance (and optionally, the realm), set the
kinit -kt [Keytab] [Principal]
For example, to specify a complete service principal name for authentication:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=Kerberos;
KrbPrincipal=jsmith/simbadrill@drill.example.com
As another example, to specify your primary name only so that the connector authenticates the connection using the host name of the drillbit node as the instance name and the default realm defined in your Kerberos setup:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=Kerberos;
KrbServiceName=jsmith
Using MapR-SASL
You can configure the connector to use the MapR-SASL protocol to authenticate the connection.
The maprlogin utility must be installed and configured before you can use this authentication mechanism. For more information, see the MapR Security Guide: http://maprdocs.mapr.com/51/SecurityGuide/SecurityOverview.html.
You provide this information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.
To configure MapR-SASL authentication:
- Use the
maprloginutility to acquire amaprticket. For more information, see "Logging Into a Cluster with maprlogin" in the MapR Security Guide: http://maprdocs.mapr.com/51/SecurityGuide/LoggingIntoCluster.html. - In your connection URL, set the
AuthMechorauthproperty toMapRSASL.
For example:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=MapRSASL