Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Hive Metastore start Problem with postgresql

$
0
0

Hi,

I am running into another issue. After installation with postgres as existing database for both hive and Oozie, Hive Metastore failes to start, the error log shows:

Fail: Execution of 'export HIVE_CONF_DIR=/etc/hive/conf.server ; /usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType postgres -userName hive -passWord [PROTECTED]' returned 1. Metastore connection URL: jdbc:postgresql://<postgresql server>:5432/hive
Metastore Connection Driver : org.postgresql.Driver
Metastore connection User: hive
Starting metastore schema initialization to 0.14.0
Initialization script hive-schema-0.14.0.postgres.sql
Error: The server's client_encoding parameter was changed to UTF8. The JDBC driver requires client_encoding to be UNICODE for correct operation. (state=08006,code=0)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
*** schemaTool failed ***

Which is kind of strange as postgresql doc states that UNICODE is just an alias of UTF8 (for them): http://www.postgresql.org/docs/9.2/static/multibyte.html ?

However, as a dirt workaround I found a file which seems to be used for the initialization:


# cat /usr/hdp/current/hive-metastore/scripts/metastore/upgrade/postgres/hive-schema-0.14.0.postgres.sql | grep client_encoding
SET client_encoding = 'UTF8';

replacing this value with UNICODE

sed -i "s/SET client_encoding = 'UTF8';/SET client_encoding = 'UNICODE';/" /usr/hdp/current/hive-metastore/scripts/metastore/upgrade/postgres/hive-schema-0.14.0.postgres.sql

on the node where the metastore is running allowed me to get one step further: when starting all services (others didn’t start as well, I guess due to dependencies), everything went to green.

It’s just the question: will I run into other issues here? i.e., is there other code relying on the client_encoding to be UNICODE or UTF8?

Best,
Helmut


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>