Using Hue with PostgreSQL
To set up Hue to use a PostgreSQL database:
Create a database in PostgreSQL using the PostgreSQL database admin utility.
sudo -u postgres psql CREATE DATABASE $DBNAME;
Exit the database admin utility.
\q <enter>
Create the Hue user.
sudo -u postgres psql -d $DBNAME CREATE USER $HUEUSER WITH PASSWORD '$HUEPASSWORD';
where $HUEUSER is the Hue user name and $HUEPASSWORD is the Hue user password.
Open the /etc/hue/conf/hue.ini file. Edit the [[database]] section (modify for your PostgreSQL setup).
[[database]] engine=postgresql_psycopg2 host=$DATABASEIPADDRESSORHOSTNAME port=$PORT user=$HUEUSER password=$HUEPASSWORD name=$DBNAME
Install the PostgreSQL database adapter for Python (psycopg2).
For RHEL/CentOS/Oracle Linux:
yum install python-devel -y yum install postgresql-devel -y cd /usr/lib/hue source build/env/bin/activate pip install psycopg2
Synchronize Hue with the external database to create the schema and load the data:
cd /usr/lib/hue source build/env/bin/activate hue syncdb --noinput hue migrate deactivate