Configuring Encryption for ODBC Connection
Explains how to configure SSL encryption between ODBC connection to Hiveserver2 on non-secure cluster.
About this task
Hive uses cyrus-sasl-plain package for ODBC connection.
Procedure
-
Generate
ssl_keystore/ssl_truststoreby running the following command:sudo bash /opt/mapr/server/manageSSLKeys.sh create -ug mapr:maprIMPORTANTMake a note of theCN=HOST_NAMEparameter in the output. - Configure SSL for Hive as described in Configure Encryption without Authentication.
-
Generate the
.pemfile. To generate: -
Configure SSL for ODBC driver by making the following changes in the
/etc/odbc.ini,/etc/odbcinst.ini, and/etc/mapr.hiveodbc.initfiles. That is, in the:/etc/odbc.inifile:- Replace
<HOST_NAME>with the host name. - Set the value for
TrustedCertsto path tossl_keystore.pemfile. - Add the following to the
file:
[ODBC Data Sources] Sample MapR Hive DSN=Hive Hive ODBC Driver 64-bit [Hive] Driver=/opt/mapr/hiveodbc/lib/64/libmaprhiveodbc64.so HOST=<HOST_NAME> PORT=10000 SSL=1 CAIssuedCertNamesMismatch=1 TrustedCerts=/opt/mapr/conf/ssl_keystore.pem AuthMech=4
- Replace
/etc/odbcinst.inifile, add the following:[ODBC Drivers] Mapr Hive ODBC Driver=Installed [Mapr Hive ODBC Driver 64-bit] Description=Mapr Hive ODBC Driver (64-bit) Driver=/opt/mapr/hiveodbc/lib/64/libmaprhiveodbc64.soetc/mapr.hiveodbc.inifile, add the following:[Driver] ErrorMessagesPath=/opt/mapr/hiveodbc/ErrorMessages/ LogLevel=0 LogPath= SwapFilePath=/tmp
Example
Sample /etc/odbc.ini file
[ODBC Data Sources]
Sample MapR Hive DSN=Hive Hive ODBC Driver 64-bit
[Hive]
Driver=/opt/mapr/hiveodbc/lib/64/libmaprhiveodbc64.so
HOST=<HOST_NAME>
PORT=10000
SSL=1
CAIssuedCertNamesMismatch=1
TrustedCerts=/opt/mapr/conf/ssl_keystore.pem
AuthMech=4
Sample /etc/odbcinst.ini file
[ODBC Drivers]
Mapr Hive ODBC Driver=Installed
[Mapr Hive ODBC Driver 64-bit]
Description=Mapr Hive ODBC Driver (64-bit)
Driver=/opt/mapr/hiveodbc/lib/64/libmaprhiveodbc64.so
Sample /etc/mapr.hiveodbc.ini file
[Driver]
ErrorMessagesPath=/opt/mapr/hiveodbc/ErrorMessages/
LogLevel=0
LogPath=
SwapFilePath=/tmp