[Resolved] PostgreSQL Connection: Error in Hive with PostgreSQL in Hadoop Cluster | Hive|PostgreSQL





I am trying to add Hive service with PostgreSQL integration in a Hadoop cluster but getting PostgreSQLconnection: error.

PostgreSQL connection: error

resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: ERROR: Unable to connect to the DB. Please check DB connection properties.
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "localhost", user "hive", database "hive", SSL off

Solution:

Step 1: First, we will go with pg_hba.conf file in the Hadoop cluster

/var/lib/pgsql/data/pg_hba.conf

Step 2: Then edit the pg_hba.conf file. Here we give Hive hostname like below :

vi /var/lib/pgsql/data/pg_hba.conf
host         hive         hive     IPAddress/0          md5

Save the configuration file using the below shortcut.

ESC :wq!

Step 3: Ater that restart the PostgreSQL server in the installation node.

sudo service postgresql restart

Step 4: Once completed the above steps then tye to check Hive JDBC “Test Connection”

Step 5: Test Connection success “Ok” then proceed with the next steps.




Step 6: In case if your facing the same issue then restart all services.

The above resolutions are very simple to resolve the Hive with PostgreSQL configuration in the Hadoop cluster.

Summary:

In the Hadoop cluster, Hive is used for the DataWarehouse system. We need to integrate with other DataBases like MySQL, PostgreSQL, MariaDB. Here I am trying to integrate the Hive with Existing PostgreSQL in the cluster. While integrating getting PostgreSQL connection error. I have added the PostgreSQL JDBC jar file in the edge node. After that getting the same error then I have checked log files it showing the same error then proceed with the above steps the “Test Connection” established successfully.




In case the above steps are not working properly then you need to check log file for complete error. Try to give grant permission access PostgreSQL to Hive. After that create a sample database and try to connect Hive as well for the better Hive JDBC connections in the cluster.