Configure Hue to Store Data in PostgreSQL
About this task
Procedure
-
Install the following packages:
CentOS yum install gcc python-devel postgresql-develSLES zypper install gcc python-devel postgresql-develUbuntu apt-get install gcc python-dev postgresql-server-dev-all -
Ensure that the
pg_configcommand is in yourPATH. For example, on CentOS with PostgreSQL 9.4 development package from the postgresql.org official repository, you need to add the directory withpg_configmanually:export PATH="/usr/pgsql-9.4/bin:$PATH" -
Install the Python
psycopg2package in Hue:cd /opt/mapr/hue/hue-<version> source ./bin/activate pip install psycopg2 deactivate -
Configure database connection parameters in the
[desktop][[database]]section ofhue.ini. Set the following properties for your database connection parameters:[desktop] ... [[database]] engine=postgresql_psycopg2 host=<host> port=5432 user=<user> password=<password> name=<database> schema=<schema>Example of Configuration[desktop] ... [[database]] engine=postgresql_psycopg2 host=node1 port=5432 user=hue password=hue_password name=hue schema=public -
Perform the initial data migration:
sudo /opt/mapr/server/configure.sh -R -
Restart Hue:
maprcli node services -name hue -action restart -nodes <node_with_hue>