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_truststore
by running the following command:sudo bash /opt/mapr/server/manageSSLKeys.sh create -ug mapr:mapr
IMPORTANTMake a note of theCN=HOST_NAME
parameter in the output. - Configure SSL for Hive as described in Configure Encryption without Authentication.
-
Generate the
.pem
file. To generate: -
Configure SSL for ODBC driver by making the following changes in the
/etc/odbc.ini
,/etc/odbcinst.ini
, and/etc/mapr.hiveodbc.init
files. That is, in the:/etc/odbc.ini
file:- Replace
<HOST_NAME>
with the host name. - Set the value for
TrustedCerts
to path tossl_keystore.pem
file. - 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.ini
file, 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.so
etc/mapr.hiveodbc.ini
file, 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