Installing the psycopg2 Python package for PostgreSQL database
If you are using PostgreSQL as a backend database for Hue on 7.x.x, then you must install a version of the psycopg2 package to be at least 2.9.5 on all Hue hosts. The psycopg2 package is automatically installed as a dependency of Agent, but the version installed is often lower than 2.9.3.
Before you begin, you must disable the
postgresql10
section from the
cloudera-manager.repo
file as follows:- SSH in to the host as an Administrator.
- Change to the directory where you had downloaded the
cloudera-manager.repo
file. On RHEL, the file is present under the /etc/yum.repos.d directory. - Open the file for editing and update the value of the
enabled
property to0
as follows:[postgresql10] name=Postgresql 10 baseurl=https://archive.cloudera.com/postgresql10/redhat8/ gpgkey=https://archive.cloudera.com/postgresql10/redhat8/RPM-GPG-KEY-PGDG-10 enabled=0 gpgcheck=1 module_hotfixes=true
- Save the file and exit.
The following steps apply to CentOS 7, RHEL 7, OEL 7, CentOS 8, RHEL 8, and OEL 8:
- SSH into the Hue server host as a root user.
- Install the
psycopg2-binary
package as follows:pip3.8 install psycopg2-binary
- Repeat these steps on all the Hue server hosts.
If you get the "Error: pg_config executable not found" error
while installing the
psycopg2-binary
package, then run the following
commands to install the postgresql
, postgresql-devel
,
python-devel
packages:yum install postgresql postgresql-devel python-devel