Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ambari-server setup not updating the PostgreSQL JDBC driver for hive when upgrading PostgreSQL for HDP 2.3.4

avatar
New Contributor

I've been able to upgrade the driver manually by copying over the postgresql-jdbc.jar file saved in /usr/share/java. However, the driver does not get upgraded for the directory /usr/hdp/X.X.X.X-XXXX/hive/lib directory when I run the command

ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql-jdbc.jar

Is there a step I'm missing or doing incorrectly?

PostgreSQL was upgraded from v9.1 to v9.4 and the JDBC was being upgraded to match.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Jeffrey Barr

The following steps that you performed is good and suggested as per the doc. http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.18/bk_ambari-reference/content/_using_hive_wit...

ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql94-jdbc.jar   

.

However if you are still facing any issue then please check the output of "lsof" command to verify which JAR is being loaded by your hive.

lsof -p $PID | grep postgresql

.

Still if you find that old jar is being used then try restarting the hive and see if it works. Also perform the following steps as last option.

On the HiveServer2/Metastore Server

- find / -name 'postgre*.jar' -ls

- Remove old postgrexxx.jar from Agent's tmp directory and /usr/hdb/<version>/hive/lib

- Remove old postgrexxx.jar from Agent's cache directory

- Replace /usr/hdp/<version>/hadoop/lib/postgresql-jdbc.jar with newer version if exists.

- Restart ambari-agent - Restart Hive (hiveserver2/metastore) from Ambari

- Run find command again to make sure the version is correct by checking the file size

.

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Jeffrey Barr

The following steps that you performed is good and suggested as per the doc. http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.18/bk_ambari-reference/content/_using_hive_wit...

ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql94-jdbc.jar   

.

However if you are still facing any issue then please check the output of "lsof" command to verify which JAR is being loaded by your hive.

lsof -p $PID | grep postgresql

.

Still if you find that old jar is being used then try restarting the hive and see if it works. Also perform the following steps as last option.

On the HiveServer2/Metastore Server

- find / -name 'postgre*.jar' -ls

- Remove old postgrexxx.jar from Agent's tmp directory and /usr/hdb/<version>/hive/lib

- Remove old postgrexxx.jar from Agent's cache directory

- Replace /usr/hdp/<version>/hadoop/lib/postgresql-jdbc.jar with newer version if exists.

- Restart ambari-agent - Restart Hive (hiveserver2/metastore) from Ambari

- Run find command again to make sure the version is correct by checking the file size

.

.