Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Poblem when i try run hive-metastore

New Contributor

Hi,

I have this problem when i try run hive-metastore.

I just change the default database by postgres.

This is my stderr:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 203, in <module>
    HiveMetastore().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 375, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 56, in start
    create_metastore_schema()
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py", line 417, in create_metastore_schema
    user = params.hive_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 262, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'export HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ; /usr/hdp/current/hive-server2-hive2/bin/schematool -initSchema -dbType postgres -userName ambari -passWord [PROTECTED] -verbose' returned 1. SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.5.0-292/hive2/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.5.0-292/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:	 jdbc:postgresql://namenode:5432/ambari
Metastore Connection Driver :	 org.postgresql.Driver
Metastore connection User:	 ambari
Starting metastore schema initialization to 2.1.2000
Initialization script hive-schema-2.1.2000.postgres.sql
Connecting to jdbc:postgresql://namenode:5432/ambari
Connected to: PostgreSQL (version 9.5.13)
Driver: PostgreSQL JDBC Driver (version 42.2.2)
Transaction isolation: TRANSACTION_READ_COMMITTED
0: jdbc:postgresql://namenode:5432/ambari> !autocommit on
Autocommit status: true
0: jdbc:postgresql://namenode:5432/ambari> SET statement_timeout = 0
No rows affected (0.008 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET client_encoding = 'UTF8'
No rows affected (0.003 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET standard_conforming_strings = off 
No rows affected (0.002 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET check_function_bodies = false
No rows affected (0 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET client_min_messages = warning
No rows affected (0.001 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET escape_string_warning = off
No rows affected (0.001 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET search_path = public, pg_catalog
No rows affected (0 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET default_tablespace = ''
No rows affected (0.001 seconds)
0: jdbc:postgresql://namenode:5432/ambari> SET default_with_oids = false
No rows affected (0.002 seconds)
0: jdbc:postgresql://namenode:5432/ambari> CREATE TABLE "BUCKETING_COLS" ( "SD_I 
D" bigint NOT NULL, "BUCKET_COL_NAME" character varying(256) DEFAULT NULL::chara 
cter varying, "INTEGER_IDX" bigint NOT NULL )
Error: ERROR: relation "BUCKETING_COLS" already exists (state=42P07,code=0)

Closing: 0: jdbc:postgresql://namenode:5432/ambari
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
	at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:304)
	at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:277)
	at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:526)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
Caused by: java.io.IOException: Schema script failed, errorcode 2
	at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:410)
	at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:367)
	at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:300)
	... 8 more
*** schemaTool failed ***

I install the latest version of HDP (2.6.5) and Ubuntu 16.04.

Help!!

Thank

1 REPLY 1

New Contributor

Hi, Have you found any solution ?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.