skip to main content
Using the Driver : Apache Knox
  

Try DataDirect Drivers Now

Apache Knox

Apache Knox is a gateway system that serves as a reverse proxy to Apache Hadoop clusters. The primary advantages of Apache Knox are that it provides a single point of authentication that simplifies security policy enforcement while providing REST API access to a clustered environment. The driver supports connecting to Apache Knox in a similar manner to a standard connection using HTTP mode.
To connect to an Apache Knox gateway:
1. Configure the minimum required options required for a connection:
*Set the Database Name option to provide the name of the Apache Hive database to which you want to connect.
*Set the Host Name option to provide the name or IP address of the Apache Knox server to which you want to connect.
*Set the Port Number option to provide the port of the primary Apache Knox server that is listening for connections. The default for an Apache Knox gateway instance is 8443.
2. Set the Transport Mode option to 1 (HTTP).
3. Set the HTTP Path option to provide the path of the endpoint to be used for HTTP/HTTPS requests. This value is the Hive endpoint as defined by Apache Knox and corresponds to the name of the server topology file. The default for an Apache Knox gateway is gateway/default/hive.
4. Optionally, if your server is configured for SSL, set the Encryption Method option to 1 (SSL) to enable SSL data encryption. Data encryption behavior can be further configured using the connection properties described in "Summary of Data Encryption Related Options."
5. Optionally, if your server is configured for Kerberos authentication:
a. Set the Authentication Method option to 4 (Kerberos).
b. Set the Service Principal Name option to provide the service principal name for your Apache Knox gateway to be used for Kerberos authentication. The default for an Apache Knox gateway instance is knox/servername@REALM.COM. For example, knox/knoxserver1.example.com@EXAMPLE.COM.
The following examples demonstrates a basic connection to Apache Knox using Kerberos and SSL data encryption.
Using a connection string:
DRIVER=DataDirect 8.0 Apache Hive Wire Protocol;AuthenticationMethod=4;
DatabaseName=hivedb1;EncryptionMethod=1;HostName=HiveServer;
HTTPPath=gateway/default/hive;PortNumber=8443;
ServicePrincipalName=knox/knoxserver1.example.com@EXAMPLE.COM;
TransportMode=1;
Using the odbc.ini file:
Driver=ODBCHOME/lib/ivhivexx.so
Description=DataDirect Apache Hive Wire Protocol driver
AuthenticationMethod=4
Database=hivedb1
EncryptionMethod=1
HostName=HiveServer
HTTPPath=gateway/default/hive
HostNameInCertificate=MySubjectAltName
PortNumber=8443
ServicePrincipalName=knox/knoxserver1.example.com@EXAMPLE.COM
TransportMode=1
Note: If you receive an HTTP/1.1 500 Server Error message when attempting to insert a large number of rows with Apache Knox, reduce the value specified for the ArrayInsertSize property until the operation succeeds.