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 libnsl
SLES zypper install gcc
Ubuntu apt-get install gcc
-
Ensure that the library required to install the Oracle module in Hue is
available through the
LD_LIBRARY_PATH
environment variable. The module that provides support for Oracle in Hue requires thelibclntsh.so
library to be available through theLD_LIBRARY_PATH
environment variable. Typically, the library is located under the$ORACLE_HOME
or$ORACLE_HOME/lib
directories. 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
. -
Install the Python
cx_Oracle
package in Hue:cd /opt/mapr/hue/hue-<version> . bin/activate pip install cx_Oracle==5.3 deactivate
NOTEPython 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=0
parameter, 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.sh
to 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