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/

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