能够将第三方产品设计为使用ODBC与Impala集成。为得到最佳体验,请确保支持您打算使用的任何第三方产品。验证支持包括检查Impala,ODBC,操做系统和第三方产品的版本是否已获批准同时使用。在配置系统以使用ODBC以前,请下载链接器。在访问下载ODBC链接器所需的页面以前,您可能须要登陆并接受许可协议。html
继续阅读:sql
重要提示:截至2015年末,大多数商业智能应用程序都使用2.x ODBC驱动程序进行了认证。虽然此页面上的说明涵盖了2.x和1.x驱动程序,可是对于链接到Impala的大多数ODBC应用程序,只能使用2.x驱动程序。ide
有关安装说明,请参阅链接器文档页面。ui
下载:https://www.cloudera.com/downloads/connectors/impala/odbc/2-5-43.htmlthis
文档:http://www.cloudera.com/documentation/other/connectors/impala-odbc/spa
rpm -qa|grep unixODBC操作系统
假设没有安装。使用如下的命令安装:设计
yum install unixODBCunix
yum install unixODBC-develcode
使用odbcinst命令查看unixODBC配置文件路径,不一样版本号的unixODBC配置文件路径是不一样的,假设是源码方式安装unixODBC,也可以经过编译參数--sysconfdir指定。
[root@h1 ~]# odbcinst -j unixODBC 2.2.14 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /root/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8
2、安装Impala ODBC驱动
yum --nogpgcheck localinstall /opt/src/ClouderaImpalaODBC-2.5.43.1032-1.el7.x86_64.rpm
Marking /opt/src/ClouderaImpalaODBC-2.5.43.1032-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ClouderaImpalaODBC.x86_64 0:2.5.43.1032-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================
Package Arch Version Repository Size
=====================================================================================
Installing:
ClouderaImpalaODBC
x86_64 2.5.43.1032-1 /ClouderaImpalaODBC-2.5.43.1032-1.el7.x86_64 49 M
Transaction Summary
=====================================================================================
Install 1 Package
Total size: 49 M
Installed size: 49 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ClouderaImpalaODBC-2.5.43.1032-1.x86_64 1/1
Verifying : ClouderaImpalaODBC-2.5.43.1032-1.x86_64 1/1
Installed:
ClouderaImpalaODBC.x86_64 0:2.5.43.1032-1
Complete!
安装完毕后的文件在:/opt/cloudera/impalaodbc 文件夹,这个文件夹包括了安装文档、lib包、配置文件演示样例。
ll /opt/cloudera/impalaodbc/
total 644
-rwxr-xr-x 1 root root 528661 Apr 25 03:19 Cloudera-ODBC-Driver-for-Impala-Install-Guide.pdf
drwxr-xr-x 3 root root 4096 Aug 16 16:27 ErrorMessages
-rwxr-xr-x 1 root root 12003 Apr 25 03:19 EULA.txt
drwxr-xr-x 3 root root 4096 Aug 16 16:27 lib
-rwxr-xr-x 1 root root 15623 Apr 25 03:19 Release-Notes-Impala-ODBC.txt
drwxr-xr-x 2 root root 4096 Aug 16 16:27 Setup
-rwxr-xr-x 1 root root 83667 Apr 25 03:19 third-party-licenses.txt
问题:cdh5.15 impala2.12 下装impalaODBC-2.5.39报以下错误,提示冲突,换2.5.43便可
rpm -ivh /opt/src/ClouderaImpalaODBC-2.5.39.1020-1.el7.x86_64.rpm
Preparing... ################################# [100%]
file /opt/cloudera from install of ClouderaImpalaODBC-2.5.39.1020-1.x86_64 conflicts(冲突) with file from package cloudera-manager-daemons-5.15.0-1.cm5150.p0.62.el7.x86_64
Cloudera ODBC Connector的2.5和2.0版本(目前已针对某些但不是全部BI应用程序进行了认证)使用HiveServer2协议,对应于Impala端口21050.Impala支持使用全部受支持的驱动程序版本进行Kerberos身份验证,而且须要ODBC 2.05.13用于LDAP用户名/密码身份验证的Impala或更高版本。
Cloudera ODBC Connector的1.x版使用原始的HiveServer1协议,对应于Impala端口21000。
设置驱动的环境变量:
在 /etc/profile 最后加入:
export ODBCINI=/etc/odbc.ini
export ODBCSYSINI=/etc
export CLOUDERAIMPALAODBCINI=/etc/cloudera.impalaodbc.ini
而后运行:source /etc/profile
使改动的脚本立刻生效。
拷贝:cloudera.impalaodbc.ini 到 /etc/文件夹:
[root@h1 Setup]#cp /opt/cloudera/impalaodbc/lib/64/cloudera.impalaodbc.ini /etc/ [root@h1 Setup]#
改动:/etc/cloudera.impalaodbc.ini 中的例如如下条目:
# Generic ODBCInstLib # iODBC #ODBCInstLib=libiodbcinst.so # SimbaDM / unixODBC ODBCInstLib=libodbcinst.so
也就是说不使用iODBC , 使用 unixODBC
參照 /opt/cloudera/impalaodbc/Setup/odbc.ini , 在/etc/odbc.ini 加入例如如下的内容:
[impalaodbc] # Description: DSN Description. # This key is not necessary and is only to give a description of the data source. Description=Cloudera ODBC Driver for Impala (64-bit) DSN # Driver: The location where the ODBC driver is 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 be set here. # They can also be specified on the connection string. HOST=172.16.230.152 PORT=21050 Database=default # The authentication mechanism. # 0 - no authentication. # 1 - Kerberos authentication # 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=1 TrustedCerts=/opt/cloudera/impalaodbc/lib/64/cacerts.pem # Specify the proxy user ID to use. #DelegationUID= # General settings TSaslTransportBufSize=1000 RowsFetchedPerBlock=1000 SocketTimeout=0 StringColumnLength=32767 UseNativeQuery=0
运行 isql -v impalaodbc
[root@h1 ~]# isql -v impalaodbc +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+