Hue Custom Databases

Hue needs its own database for such things as user account information, job submissions, and Hive queries.

Hue is packaged with a lightweight embedded database (PostgreSQL) for proof-of-concept deployments with one Hue server. Hue also supports connections to a custom external database, local or remote.

Connect Hue to an External Database

Custom Database Concepts

  • There are two ways to connect Hue to an external database:
    • During a new CDH installation with the Cloudera Manager Installation Wizard at Database Setup. The external (or custom) database must be installed, configured, and running.
    • After CDH is installed with Cloudera Manager on the Hue > Configuration tab. You can migrate and connect, or simply connect to the new database without saving the data in the old database.
  • Migrate to a new database only if you want to save data in your current database. Otherwise, simply connect to your new database and restart Hue.
    1. [migrate] Stop the Hue service.
    2. [migrate] Dump database (and delete "useradmin.userprofile" objects from .json file).
    3. Connect to new database.
    4. [migrate] Synchronize database (and drop foreign key to clean tables).
    5. [migrate] Load database (and add foreign key).
    6. Re/Start Hue service.
  • Install Oracle Instant Client libraries (Basic and SDK with headers) to use an Oracle database with Hue. You can use the zip files from Oracle or the parcel from Cloudera.
  • An external database can be remote–it does not need to be on the same host as the Hue server. Ensure the database server is properly configured (particularly the bind or listen address).
  • Managed CDH deployments must use Cloudera Manager to configure hue.ini:
    [desktop]
    ...
    [[database]]
    host=Database server host
    port=Database server port
    engine=Database server type (mysql, postgresql, oracle)
    name=Hue database name (or SID)
    user=Hue datbase username
    password=Hue database password