Configure Hue to Store Data in Oracle Database
About this task
NOTE
To configure Hue with Oracle 12, you need the Oracle 11 Instant Client Base and
SDK.Procedure
-
Install the following packages:
RedHat yum install gcc libnslSLES zypper install gccUbuntu apt-get install gcc -
Ensure that the library required to install the Oracle module in Hue is
available through the
LD_LIBRARY_PATHenvironment variable. The module that provides support for Oracle in Hue requires thelibclntsh.solibrary to be available through theLD_LIBRARY_PATHenvironment variable. Typically, the library is located under the$ORACLE_HOMEor$ORACLE_HOME/libdirectories. Also, the library might include a version in the filename (for example,libclntsh.so.11.1), but the Oracle module for Hue requires it to be namedlibclntsh.so.-
Ensure that the
ORACLE_HOMEenvironment variable is set:ORACLE_HOME="<path_to_oracle_installation>" -
Use the
findcommand to locate the library:find "$ORACLE_HOME" -name "libclntsh.so*" -
Go to the directory and ensure that the library is available and has
the proper filename. If not, you can create a symbolic link:
ln -s libclntsh.so.11.* libclntsh.so -
Add the following variables to the Hue environment configuration by
creating a file in
/opt/mapr/hue/hue-<version>/desktop/conf/env.d/. For example, create/opt/mapr/hue/hue-<version>/desktop/conf/env.d/99-custom.shwith the following content:
or the following, depending on your Oracle configuration:export ORACLE_HOME="<path_to_oracle_installation>" export LD_LIBRARY_PATH="$ORACLE_HOME:$LD_LIBRARY_PATH"export ORACLE_HOME="<path_to_oracle_installation>" export LD_LIBRARY_PATH="$ORACLE_HOME/lib:$LD_LIBRARY_PATH"
-
Ensure that the
-
Install the Python
cx_Oraclepackage in Hue:cd /opt/mapr/hue/hue-<version> . bin/activate pip install cx_Oracle==5.3 deactivateNOTEPython cx_Oracle version 5.3 is supported. -
Configure the database connection parameters in the
[desktop][[database]]section ofhue.ini. Note these considerations:- Make sure that you have the appropriate permissions to use LOBs; for
example,
SQL GRANT on SYS.DBMS_LOB. - SID refers to the Oracle system ID, which is used to uniquely identify
the database.
[desktop] # ... [[database]] engine=oracle host=<host> port=1521 user=<user> password=<password> name=<SID of the database> - To achieve a multithreading environment, you can specify the
options={'threaded': true}parameter in this section. For example:[desktop] # ... [[database]] engine=oracle host=node1 port=1521 user=hue password=hue_password name=XE options={'threaded': true}By setting the
port=0parameter, you can use the Oracle Service Name instead of specifying the SSID. For example:[desktop] # ... [[database]] engine=oracle port=0 user=hue password=hue_password name=node1:1521/hue
- Make sure that you have the appropriate permissions to use LOBs; for
example,
-
Invoke
configure.shto perform the initial data migration:sudo /opt/mapr/server/configure.sh -R -
Restart Hue:
maprcli node services -action restart -nodes <node_with_hue> -name hue