FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

前端 未结 8 1474
庸人自扰
庸人自扰 2021-01-01 07:05

I shutdown my HDFS client while HDFS and hive instances were running. Now when I relogged into Hive, I can\'t execute any of my DDL Tasks e.g. \"show tables\" or \"describe

8条回答
  •  星月不相逢
    2021-01-01 07:49

    I have resolved the problem. These are the steps I followed:

    1. Go to $HIVE_HOME/bin/metastore_db
    2. Copied the db.lck to db.lck1 and dbex.lck to dbex.lck1
    3. Deleted the lock entries from db.lck and dbex.lck
    4. Log out from hive shell as well as from all running instances of HDFS
    5. Re-login to HDFS and hive shell. If you run DDL commands, it may again give you the "Could not instantiate HiveMetaStoreClient error"
    6. Now copy back the db.lck1 to db.lck and dbex.lck1 to dbex.lck
    7. Log out from all hive shell and HDFS instances
    8. Relogin and you should see your old tables

    Note: Step 5 may seem a little weird because even after deleting the lock entry, it will still give the HiveMetaStoreClient error but it worked for me.

    Advantage: You don't have to duplicate the effort of re-creating the entire database.

    Hope this helps somebody facing the same error. Please vote if you find useful. Thanks ahead

提交回复
热议问题