Impala ODBC Installation Notes

Source: Internet
Author: User
Tags dsn

Impala online documentation describes Impala ODBC interface installation and configuration
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/Impala/ Installing-and-using-impala/ciiu_impala_odbc.html
Impala ODBC Driver:
http://www.cloudera.com/content/support/en/downloads/connectors.html

This article explains in detail the installation and use of Impala ODBC in the CENTOS-6.5-X86_64 environment.

First, check whether the UNIXODBC is installed:

Rpm-qa|grep UnixODBC

If it is not installed, install it using the following command:

Yum Install UnixODBC

Yum Install Unixodbc-devel

Use the Odbcinst command to view the UNIXODBC configuration file path, different versions of the UNIXODBC profile path is different, if the source code is installed UNIXODBC, you can also be specified by compiling parameters--sysconfdir.

[Email protected] ~]# odbcinst-junixodbc 2.2.14DRIVERS .....:/etc/odbcinst.inisystem DATA SOURCES:/etc/ Odbc.inifile data SOURCES:/etc/odbcdatasourcesuser data SOURCES ...:/root/.odbc.inisqlulen size ...: 8SQLLEN size ....: 8SQLSETPOSIROW Size.: 8
Ii. Installing Impala ODBC driver

Download clouderaimpalaodbc-2.5.15.1015-1.el6.x86_64.rpm, save to:/home/soft directory, and install:

[Email protected] soft]# lltotal 16232-rw-r--r--. 1 root root 16619934 06:37 clouderaimpalaodbc-2.5.15.1015-1.el6.x86_64.rpm[[email protected] soft]# RPM-IVH Cloude raimpalaodbc-2.5.15.1015-1.el6.x86_64.rpm Preparing                ... ########################################### [100%]   1:CLOUDERAIMPALAODBC     

After the installation is complete the file in:/opt/cloudera/impalaodbc directory, this directory contains the installation document, LIB package, configuration file example.

[Email protected] impalaodbc]# pwd/opt/cloudera/impalaodbc[[email protected] impalaodbc]# lltotal 1016-rwxr-xr-x. 1 root root 1007048 Apr 12:21 Cloudera ODBC Driver for Impala Install guide.pdf-rwxr-xr-x.  1 root root   12003 Apr 12:21 cloudera-eula.txtdrwxr-xr-x. 3 root root    4096 07:15 errormessages-rwxr-xr-x. 1 root root    3261 Apr 12:21 readme.txt-rwxr-xr-x. 1 root root    2350 Apr 12:21 Release notes.txtdrwxr-xr-x. 2 Root root    4096 07:15 setupdrwxr-xr-x. 3 root root    


Set the driving environment variables:

Last added in/etc/profile:

Export LD_LIBRARY_PATH=/USR/LOCAL/LIB:/OPT/CLOUDERA/IMPALAODBC/LIB/64

Then execute: source/etc/profile

Causes the modified script to take effect immediately.

Copy: Cloudera.impalaodbc.ini to/etc/directory:


Modify: The following entry in/etc/cloudera.impalaodbc.ini:

# Generic odbcinstlib#   iodbc#odbcinstlib=libiodbcinst.so#   simbadm/unixodbcodbcinstlib=libodbcinst.so

That means not using IODBC, using UnixODBC


Third, modify the/etc/odbc.ini file

Refer to/opt/cloudera/impalaodbc/setup/odbc.ini, modify:/etc/odbc.ini file. The modified Odbc.ini are as follows:

[impalaodbc]# description:dsn description.# This key was not necessary and was only to give a Description of the data sourc E.description=cloudera ODBC Driver for Impala (64-bit) dsn# driver:the location where the ODBC Driver are installed to. driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so# the driverunicodeencoding setting is only used for simbadm# when set to 1, Simbadm runs in UTF-16 mode.# when set to 2, Simbadm runs in UTF-8 mode. #DriverUnicodeEncoding =2# Values for HOST, PORT, Krbfqdn, and Krbservicename should is set here.# they can also be specified on the connection Strin g.host=172.16.230.152port=21050database=default# the authentication mechanism.# 0-no authentication.# 1-kerberos Auth  entication# 2-username authentication.# 3-username/password authentication.# 4-username/password authentication with Ssl. authmech=0# Kerberos Related Settings. krbfqdn=krbrealm=krbservicename=# Username/password authentication with SSL settings. Uid=pwd=caissuedcertnamesmismatch=1trustedcerts=/opt/cloudera/impalaodbc/lib/64/cacerts.pem# Specify the proxy user ID to use. #DelegationUID =# General Settingstsasltransportbufsize=1000rowsfetchedperblock=1000sockettimeout=0stringcolumnlength= 32767usenativequery=0

Iv. Verifying the success of the installation

Execute Isql-v IMPALAODBC

[[email protected] ~]# isql-v impalaodbc+---------------------------------------+|                            connected!                                       || || sql-statement | | Help [TableName] | |                                       Quit | | |+---------------------------------------+sql> select * from Tab1; [S1000] [UnixODBC] [Cloudera] [IMPALAODBC] Error while executing a query in Impala: [HY000]: Error:Error:could not match input[isql]error:could not sqlprep Aresql> SELECT * from TAB1 +------------+------+-------------------------+------------------------------+| ID | col_1| col_2 | Col_3 |+------------+------+-------------------------+------------------------------+| 1 | 1 | 123.123 | 2012-10-24 08:55:00 | | 2 | 0 | 1243.5 | 2012-10-25 13:40:00 | | 3 | 0   | 24453.325 | 2008-08-22 09:33:21.123000000| | 4 | 0 | 243423.325 | 2007-05-12 22:32:21.334540000| | 5 | 1 | 243.325 | 1953-04-22 09:11:33 |+------------+------+-------------------------+------------------------------+sqlrowcount re Turns-15 rows fetched
Note: The executed SQL is not sealed at the end.

With this configuration, C + + programs can access the data in Impala through UNIXODBC.

V. License issues

The default installed Impala ODBC is the evaluation version, and you need to purchase license, see the Installation Documentation Cloudera ODBC Driver for Impala install guide.pdf in this paragraph:

If you were installing a driver with an evaluation license and you had purchased a perpetual license, then copy the Licens E.lic file you received via e-mail into THE/OPT/CLOUDERA/IMPALAODBC/LIB/32 or/opt/cloudera/impalaodbc/lib/64 folder, DEP Ending on the version of the driver you installed.

How long is the assessment, and no answer has been found yet. or let you always evaluate it:)


Original works, reproduced please specify the source http://blog.csdn.net/yangzhaohui168/article/details/38800803



Impala ODBC Installation Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.