This is the documentation for Cloudera ODBC Connector for Microstrategy 2.0.
Documentation for other versions is available at Cloudera.com.

Driver Installation and Configuration for Red Hat Enterprise Linux or CentOS

This 32-bit driver is supported on Red Hat Enterprise Linux or CentOS, version 6.x and 5.x, both 32- and 64-bit systems.

Follow these steps to download and install the ODBC driver:
  1. Download the distribution (tar file) from the Cloudera downloads site (see the Cloudera ODBC Connectors downloads page).
  2. To install the files to the default location (/usr), execute the following:
    $ cd /usr
    
    $ sudo tar -zxf ClouderaHiveODBC-v2.00.tar.gz 

    If you plan to install different versions, you can place the files in an alternative location (for example, /opt/).

  3. Set the required environment variables by adding the following to the end of ODBC.sh:
    #
    # ODBC Driver for Hive
    #
    HIVE_CONFIG='odbc_driver_install_path'
    if [ "${HIVE_CONFIG}" != '<HIVE_CONFIG>' ]; then
               export HIVE_CONFIG
    
               mstr_append_path LD_LIBRARY_PATH "${HIVE_CONFIG:?}"/lib
               export LD_LIBRARY_PATH
    fi

    Substitute the full path of the parent directory of the driver libraries and include files for odbc_driver_install_path.

  4. Add a section for the ODBC driver to odbcinst.ini:
    [ODBC DRIVERS]
    Hive Driver=Installed
    
    [Hive Driver]
    Driver=odbc_driver_libs_path/libhiveodbc.so.1
    Description=Hive Driver
    Setup=odbc_driver_libs_path/libhiveodbc.so.1
    APILevel=2
    ConnectFunctions=YYY
    DriverODBCVer=1.0
    FileUsage=0
    SQLLevel=1

    Substitute the full path to the ODBC driver libraries for odbc_driver_libs_path.

  5. Create a system Data Service Name (DSN) for HiveServer2 by adding an entry to odbc.ini. For an Impala server, add an entry like the following:
    [ODBC DATA SOURCES]
    IMPALA-SERVER=Hive ODBC Driver
    
    [IMPALA-SERVER]
    Driver=odbc_driver_libs_path/libhiveodbc.so.1
    Description=Hive ODBC Driver
    Host=impalad_host
    Port=impalad_port
    Database=
    FRAMED=0
    Trace=Yes
    TraceFile=/tmp/odbc.log
    Type=HS2NoSasl
    
      Note: Use Type=HS2NoSasl when connecting to an Impala server not secured by Kerberos authentication. For an Impala server that does use Kerberos authentication, specify Type=, that is, leave the value blank.

    For an Apache Hive server, add an entry like the following:

    [ODBC DATA SOURCES]
    HS2=Hive ODBC Driver
    
    [HS2]
    Driver=odbc_driver_libs_path/libhiveodbc.so.1
    Description=Hive ODBC Driver
    Host=hs2_host
    Port=hs2_port
    Database=
    FRAMED=0
    Trace=Yes
    TraceFile=/tmp/odbc.log
    Substitute these values for the italicized items in the preceding configuration file examples:
    • Substitute the full path to the ODBC driver libraries for odbc_driver_libs_path.
    • Substitute the host name of the node running the impalad daemon or the HiveServer2 process for impalad_host or hs2_host.
    • Specify the port the HiveServer2 is listening on for impalad_port or hs2_port. By default, the port number is 21050 when your ODBC application accesses an Impala server, or 10000 to access a Hive server.

Configuring Secure Authentication for Linux

Optionally, you can enable authentication using the Kerberos subsystem. Currently, this security feature is supported by the ODBC connector only on Linux systems, not Windows. During the connector installation, specify the appropriate value for the Type field in odbc.ini, depending on whether Kerberos is enabled, as shown in the preceding section. For information about setting up Kerberos for your Impala nodes not managed by Cloudera Manager, see the Installing and Using Impala guide.

The DSN or connection URL should include the Kerberos principal of the server.

Follow these steps to set up Kerberos authentication on a client system:

  1. Install the libsasl2 package on Linux.
  2. Install the Kerberos client package for Kerberos authentication.
  3. Configuration options:
    • PRINCIPAL - Kerberos principal of HiveServer2
  4. The port information for the DSN depends on whether you are connecting to Cloudera Impala or Apache Hive.
    Sample DSN for Kerberos authentication when connecting to an Impala node:
    [HS2Kerberos]
    Database = default
    Description = Impala ODBC
    Driver = ClouderaHS2
    HOST = centOS64
    PORT = 21050
    PRINCIPAL = impala/<impalad-hostname>@myRelm.com
    
    Sample DSN for Kerberos authentication when connecting to a Hive server:
    [HS2Kerberos]
    Database = default
    Description = Hive2 ODBC
    Driver = ClouderaHS2
    HOST = centOS64
    PORT = 10000
    PRINCIPAL = node1/hiveserver2@myRelm.com