Support Questions

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

Hive MetaStore wont Start after Updating HDP 2.4 to 2.6

avatar
New Contributor

We updated HDP 2.4 to 2.6. We are using Hive version 1.2 as our default as we are not ready to migrate to 2.1.1 yet. Everything looked fine at first after the update. But later we tried to restart Hive MetaStore and am getting a error. It appears to be trying to update the MetaStore Schema in the DB even though the Upgrade it done

 

 

 

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)
    
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 oracle -userName HIVE -passWord [PROTECTED] -verbose' returned 1. SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.3.0-235/hive2/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.3.0-235/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:oracle:thin:@//********
Metastore Connection Driver :	 oracle.jdbc.driver.OracleDriver
Metastore connection User:	 HIVE
Starting metastore schema initialization to 2.1.2000
Initialization script hive-schema-2.1.2000.oracle.sql
Connecting to jdbc:oracle:thin:@//*******:1521/*****
Connected to: Oracle (version Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options)
Driver: Oracle JDBC driver (version 11.2.0.4.0)
Transaction isolation: TRANSACTION_READ_COMMITTED
0: jdbc:oracle:thin:@//******> !autocommit on
Autocommit status: true
0: jdbc:oracle:thin:@******//> CREATE TABLE SEQUENCE_TABLE ( SEQ 
UENCE_NAME VARCHAR2(255) NOT NULL, NEXT_VAL NUMBER NOT NULL )
Error: ORA-00955: name is already used by an existing object (state=42000,code=955)

Closing: 0: jdbc:oracle:thin:@//******:1521/*****
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 !!

 

 

 

 

I checked the version in the DB and I see 1.2.1000 set.  I got MetaStore to start by commenting out but this code on Ambari Agent but this is a bandaid. I cannot drop and recreate this DB as the DB was migrated .

 

/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py
 if params.init_metastore_schema:
      print "Commented out"
      #create_metastore_schema()

 

 

1 ACCEPTED SOLUTION

avatar
New Contributor

We fixed this by rerunning the update SQL script that is the last script from Ambari upgrade

View solution in original post

2 REPLIES 2

avatar
New Contributor

We fixed this by rerunning the update SQL script that is the last script from Ambari upgrade

avatar
Community Manager

I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. 


Cy Jervis, Manager, Community Program
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.