OBIEE訪問hive數據環境搭建

OBIEE訪問hive數據環境搭建

     OBIEE 11.1.1.7.x支持hive數據源,本人想測試下hive數據和OBIEE的互通性,以下是最近個人搭建測試環境的流程和遇到的一些問題。

安裝環境:

1、 OS環境:Oracle VM VirtualBox 4.3.8,Oracle Linux Server release5.9。

2、 軟件環境(按安裝先後順序列舉):

a、 Oracle數據庫:12.1.0(for Linux)

虛機中已有環境。

b、 Hive 0.10:(for Linux)

Cloudera Enterprise 4.6.0(虛機中已有環境)

c、  Repository Creation Utility 11.1.1.7.0:(forLinux)

d、 同OBIEE網站,找到Repository Creation Utility (11.1.1.7.0),下載for Linux x86-64 (64-bit),約500MB。
OBIEE 11.1.1.7.0:(forLinux)

http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/downloads/bi-downloads-1923016.html,找到Oracle BusinessIntelligence v. 11.1.1.7.0,下載forLinux x86-64-bit,約7GB;安裝見http://docs.oracle.com/cd/E28280_01/bi.htm

e、  UnixODBC-2.3.2:(for Linux)

http://www.linuxfromscratch.org/blfs/view/cvs/general/unixodbc.html,下載unixODBC-2.3.2,約2MB。

f、 ClouderaHiveODBC-2.5.5.1006-1.el5.x86_64.rpm:(for Linux)

http://www.cloudera.com/content/support/en/downloads/download-components/download-products/downloads-listing/connectors/cloudera-odbc-drivers.html,下載Cloudera ODBCDriver for Apache Hive-> Cloudera ODBC Driver for Linux->EL5->64-bit,約16MB;安裝見http://docs.oracle.com/cd/E28280_01/bi.1111/e10540/deploy_rpd.htm#BABGIAJH

g、ClouderaHiveODBC64.msi:(for Windows)

http://www.cloudera.com/content/support/en/downloads/download-components/download-products/downloads-listing/connectors/cloudera-odbc-drivers.html,下載Cloudera ODBC Driver for Apache Hive-> Cloudera ODBCDriver for Windows->64-bit package,約9MB。安裝過程中,點windows,開始,在搜索框中輸入ODBC,配置Cloudera ODBCDriver for Apache Hive DSN Setup的hive數據源。

h、biee_111170_64_client_install.zip(only for Windows)

http://www.oracle.com/technetwork/cn/middleware/bi-enterprise-edition/downloads/bus-intelligence-applications-1942275-zhs.html,所需其他軟件->適用於 Microsoft Windows x8664位),約200MB。

安裝過程中遇到的問題及解決方法:

1、 虛機升級後OracleVirtualbox打不開。

報錯:

Cannot access the kernel driver! Make sure the kernel module has been loaded successfully. Failed to open a session for the virtual machine Masonux.

Virtual machine 'Masonux' has terminated unexpectedly during startup.

解決辦法:

打開C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv文件夾,找到VBoxDrv.inf文件,右擊鼠標,選擇“安裝“。重啓虛擬機即可正常使用。

2、 在Linux上安裝OBIEEserver提示不能有ORACLE_HOME環境變量。

解決辦法:
在終端運行unset ORACLE_HOME,然後重新安裝OBIEE。

3、 在Linux安裝OBIEEserver報錯。

報錯:

在root賬戶下安裝oracle11g時報[Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<]

解決辦法:

用oracle用戶登錄x-window。

4、在Linux上運行[root@localhostbin]# isql -v "Sample Cloudera Hive DSN 64",沒有通過。

報錯:

[01000][unixODBC][Driver Manager]Can't open lib '/opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.so' : file not found

[ISQL]ERROR: Could not SQLConnect

解決辦法:

在環境變量中增加,export LD_LIBRARY_PATH=/opt/cloudera/hiveodbc/lib/64:$LD_LIBRARY_PATH

5、Windows的ODBC安裝DNS,測試連接Hive不通過。

報錯:

Attempting connection

Failed to establish connection

SQLSTATE: HY000[Cloudera][HiveODBC] (34) Error from Hive: connect() failed: errno = 10061.

解決辦法:

a、通過Cloudera Manager查看hive服務以及端口,例如是默認值10000。

b、Linux上運行netstat -ntupl | grep 10000查看端口是否存在,剛好不存在。

c、運行/usr/bin/hiveserver2 --service hiveserver。

d、運行netstat -ntupl | grep 10000存在。則繼續測試ODBC的hive連接,可以通過。

參考:http://grokbase.com/t/cloudera/cdh-user/12crj9fmf9/cdh-4-1-1-and-hive-hive-is-working-but-nothing-listens-to-10000-port-jdbc-connection-failed

 

OBIEE的啓動和停止:

1、 手動啓動OBIEE 11g,按順序來。

a、cd /u02/middleware_home/user_projects/domains/bifoundation_domain/bin

b、sh startWebLogic.sh  (起來後放後臺ctl+Z, jobs -l; bg %1)

c、sh startManagedWebLogic.sh bi_server1(默認是bi_server1, 起來後放後臺ctl+Z, jobs -l; bg %1)

d、cd /u02/middleware_home/instances/instance1/bin/  &  ./opmnctl startall

e、cd /u02/middleware_home/instances/instance1/bin/ & ./opmnctl status 查看5個服務是否都已經Alive。

2、 手動停止OBIEE 11g,按順序來。

a、cd /u02/middleware_home/instances/instance1/bin/

b、./opmnctl shutdown  (ORACLE_BIEE_HOME=/u02/middleware_home)

c、cd /u02/middleware_home/user_projects/domains/bifoundation_domain/bin & sh stopManagedWebLogic.sh bi_server1

d、cd /u02/middleware_home/user_projects/domains/bifoundation_domain/bin & sh stopWebLogic.sh

 

環境變量:

export ODBCSYSINI=/usr/local/etc

export SIMBAINI=/opt/cloudera/hiveodbc/Setup/cloudera.hiveodbc.ini

export ODBCInstLib=/usr/local/lib/libodbcinst.so

export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

export LD_LIBRARY_PATH=/opt/cloudera/hiveodbc/lib/64:$LD_LIBRARY_PATH

 

odbcinst.int內容:

[ODBC Drivers]

Cloudera ODBC Driver for Apache Hive 32-bit=Installed

Cloudera ODBC Driver for Apache Hive 64-bit=Installed

 

[Cloudera ODBC Driver for Apache Hive 32-bit]

Description=Cloudera ODBC Driver for Apache Hive (32-bit)

Driver=/opt/cloudera/hiveodbc/lib/32/libclouderahiveodbc32.so

 

[Cloudera ODBC Driver for Apache Hive 64-bit]

Description=Cloudera ODBC Driver for Apache Hive (64-bit)

Driver=/opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.so

 

## The option below is for using unixODBC when compiled with -DSQL_WCHART_CONVERT.

## Execute 'odbc_config --cflags' to determine if you need to uncomment it.

# IconvEncoding=UCS-4LE

 

odbc.ini內容:

[ODBC]

# Specify any global ODBC configuration here such as ODBC tracing.

 

[ODBC Data Sources]

#Sample Cloudera Hive DSN 32=Cloudera ODBC Driver for Apache Hive 32-bit

Sample Cloudera Hive DSN 64=Cloudera ODBC Driver for Apache Hive 64-bit

 

#[Sample Cloudera Hive DSN 32]

 

# Description: DSN Description.

# This key is not necessary and is only to give a description of the data source.

#Description=Cloudera ODBC Driver for Apache Hive (32-bit) DSN

 

# Driver: The location where the ODBC driver is installed to.

#Driver=/opt/cloudera/hiveodbc/lib/32/libclouderahiveodbc32.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, HS2HostFQDN, and HS2KrbServiceName should be set here.

# They can also be specified on the connection string.

#HOST=[HOST]

#PORT=[PORT]

#Schema=default

#FastSQLPrepare=0

#UseNativeQuery=0

#HiveServerType=2

#AuthMech=0

#KrbHostFQDN=[Hive Server 2 Host FQDN]

#KrbServiceName=[Hive Server 2 Kerberos service name]

#UID=[User name]

 

[Sample Cloudera Hive DSN 64]

 

# Description: DSN Description.

# This key is not necessary and is only to give a description of the data source.

Description=Cloudera ODBC Driver for Apache Hive (64-bit) DSN

 

# Driver: The location where the ODBC driver is installed to.

Driver=/opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.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, HS2HostFQDN, and HS2KrbServiceName should be set here.

# They can also be specified on the connection string.

HOST=localhost

PORT=10000

Schema=default

FastSQLPrepare=0

UseNativeQuery=0

HiveServerType=2

AuthMech=2

UserName=hiveuser

#KrbHostFQDN=[Hive Server 2 Host FQDN]

#KrbServiceName=[Hive Server 2 Kerberos service name]

#UID=[User name]

 

cloudera.hiveodbc.ini內容:

[Driver]

 

## - Note that this default DriverManagerEncoding of UTF-32 is for iODBC.

## - unixODBC uses UTF-16 by default.

## - If unixODBC was compiled with -DSQL_WCHART_CONVERT, then UTF-32 is the correct value.

##   Execute 'odbc_config --cflags' to determine if you need UTF-32 or UTF-16 on unixODBC

## - SimbaDM can be used with UTF-8 or UTF-16.

##   The DriverUnicodeEncoding setting will cause SimbaDM to run in UTF-8 when set to 2 or UTF-16 when set to 1.

 

DriverManagerEncoding=UTF-32

ErrorMessagesPath=/opt/cloudera/hiveodbc/ErrorMessages/

LogLevel=0

LogPath=

## - Uncomment the ODBCInstLib corresponding to the Driver Manager being used.

## - Note that the path to your ODBC Driver Manager must be specified in LD_LIBRARY_PATH (LIBPATH for AIX).

## - Note that AIX has a different format for specifying its shared libraries.

# Generic ODBCInstLib

#   iODBC

ODBCInstLib=libiodbcinst.so

#   SimbaDM / unixODBC

#ODBCInstLib=libodbcinst.so

# AIX specific ODBCInstLib

#   iODBC

#ODBCInstLib=libiodbcinst.a(libiodbcinst.so.2)

#   SimbaDM

#ODBCInstLib=libodbcinst.a(odbcinst.so)

#   unixODBC

#ODBCInstLib=libodbcinst.a(libodbcinst.so.1)

參考:

http://www.rittmanmead.com/2013/04/obiee-odi-and-hadoop-part-2-connecting-obiee-11-1-1-7-to-hadoop-data-sources/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章