Skip to main content
connect to impala from VM Ubuntu using Kerberos key tab                       
On client machine:(Ubuntu-VM)
1)  Download unix odbc driver:
http://www.unixodbc.org/unixODBC-2.3.4.tar.gz./configure make make install

2) install Cloudera impala odbc driver 
clouderaimpalaodbc_2.5.32.1002-2_amd64.debhttp://www.cloudera.com/downloads/connectors/impala/odbc/2-5-32.html
 dpkg -i clouderaimpalaodbc_2.5.32.1002-2_amd64.deb

3) cp /etc/odbc.ini and /etc/odbcinst.ini to home directory.

4) cat /home/user_impala/odbc.ini
[ODBC DATA Sources]Impala_DSN=Cloudera Impala ODBC Driver 64-bit[Impala_DSN]Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.soHOST=Impala.dev.Server.comPort=21050Database=irisAuthMech=1KrbRealm=DEV.SERVER.COMKrbFQDN=Impala.dev.Server.comKrbServiceName=impalaUID=user_impalaUseKeytab=1;#UPNKeytabMappingFile=/home/user_impala/service.keytabDefaultKeytabFile =/home/user_impala/service.keytab 

 5)cat /home/user_impala/odbcinst.ini 
[ODBC Drivers]Cloudera Impala ODBC Driver 64-bit=InstalledUsageCount=2[Impala_ODBC_Driver]Description=Cloudera Impala ODBC Driver (64-bit)Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.soUsageCount=2

6)Keep user_impala krb5.conf (from Implaa server) in /etc 
sudo cp krb5.conf  /etcsudo chmod 755 /etc/krb5*

4) Export Env.
export ODBCINI=/home/user_impala/odbc.iniexport ODBCSYSINI=/home/user_impala/odbcinst.iniexport CLOUDERAIMPALAODBCINI=/opt/cloudera/impalaodbc/lib/64/cloudera.impalaodbc.iniexport LD_PRELOAD=/usr/lib/libodbcinst.soexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/cloudera/impalaodbc/lib/64:.


5) Done
 $ isql -v Impala_DSN

+---------------------------------------+
| Connected! 
| sql-statement  
| help [tablename]
| quit
+---------------------------------------+
SQL> show tables;
+---------------------------------------------------------------------
| name    
+---------------------------------------------------------------------
| commodity_data            
| ml_data 
| mt_data_base  
| mdl_data_inc 
| processed_data_sample 
+---------------------------------------------------------------------
SQLRow Count returns -1 
19 rows fetched
SQL>
 ^Z[1]+  Stopped


 more details:
 http://www.cloudera.com/documentation/other/connectors/impala-odbc/latest/Cloudera-ODBC-Driver-for-Impala-Install-Guide.pdf


Comments

Popular posts from this blog

how to get hive table size from metastore mysql

select    d.name  as db_name ,t.tbl_name     as tbl_name ,from_unixtime(min(t.create_time))   as create_time ,min(t.owner)          as owner ,min(case when tp.param_key = 'COLUMN_STATS_ACCURATE'  then tp.param_value                 end) as COLUMN_STATS_ACCURATE ,min(case when tp.param_key = 'last_modified_by'       then tp.param_value                 end) as last_modified_by ,min(case when tp.param_key = 'last_modified_time'     then from_unixtime(tp.param_value)  end) as last_modified_time  ,min(case when tp.param_key = 'numFiles'               then tp.param_value                 end) as numFiles ,min(case when tp.param_key = 'numRows'                th...

Hadoop Yarn MR(MapReduce) streaming using Shell script part 2

Friends, This is a streaming MapReduce job (shell script) that reads any text input and computes the average length of all words that start with each character . --------------------------------------------------------------------------------------------------------------------------------------------------------------- $ cat avg_ln_mpr.sh #! /bin/bash while  read  line do  for word in `echo $line`  do     c=`expr substr $word 1 1`     l=`expr length $word`     echo $c $l  done     done --------------------------------------------------------------------------------------------------------------------------------------------------------------- $ cat avg_ln_rdr.sh #! /bin/bash old='' new='' val='' cnt=1 sum=0 avg=0 start=0 while  read  line do new=`echo $line|cut -d' ' -f1` val=`echo $line|cut -d' ' -f2` if [ "$old" != "$new" ]; then [ $start -ne 0 ] &...

MySQL replication - Master Slave Easy way with Crash test sample

I expect we have Master and Slave machines having MySQL installed  on both with server-id as 1 and 2 on Master and Slave . Mysql Replication steps: On Master: stop all transactions. mysql> FLUSH TABLES WITH READ LOCK; mysql> show master status ; +---------------+----------+--------------+------------------+ | File          | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---------------+----------+--------------+------------------+ | binlog.000005 |  4913710 |              |                  | +---------------+----------+--------------+------------------+ take mysql dump of Master $ mysqldump -u root -p --all-databases --master-data > dbdump.sql mysql> unlock tables; transfer dump file  to slave host scp dbdump.sql  usr@slave:/tmp/ On Slave: [usr@slave ~]$ ls -ltr -rwx------ 1 usr usr 57319214 Nov  6 06:06 dbdump.sql...