问题描述
我在HDFS和hive实例运行时关闭了我的HDFS客户端。现在,当我记入Hive时,我无法执行任何DDL任务,例如show tables或describe tablename等。它给我错误,如下所示:
ERROR exec.Task(SessionState。 java:printError(401)) - FAILED:元数据错误:java.lang.RuntimeException:无法实例化org.apache.hadoop.hive.metastore.HiveMetaStoreClient
org.apache.hadoop.hive.ql.metadata。 HiveException:java.lang.RuntimeException:无法实例化org.apache.hadoop.hive.metastore.HiveMetaStoreClient
任何人都可以建议我需要做些什么才能在不重新创建表的情况下实现metastore_db的实例化?否则,我必须再次重复创建整个数据库/模式的工作。
我解决了这个问题。这些是我遵循的步骤:
- 转到$ HIVE_HOME / bin / metastore_db
- db.lck到db.lck1和dbex.lck到dbex.lck1
- 从db.lck和dbex.lck中删除锁定项
- Log从配置单元外壳以及所有正在运行的HDFS实例中移出
- 重新登录到HDFS和配置单元外壳。如果您运行DDL命令,它可能会再次给您无法实例化HiveMetaStoreClient错误。
- 现在将db.lck1复制到db.lck和dbex.lck1复制到dbex.lck
- 从所有配置单元外壳和HDFS实例注销
- Relogin,您应该看到旧表
注意:步骤5看起来有点不可思议,因为即使在删除锁定条目之后,它仍会给出HiveMetaStoreClient错误,但它对我有用。
优势:您不必重复重新创建整个数据库。\\ b
$ b
希望这可以帮助有人面临同样的错误。如果您觉得有用,请投票。提前致谢
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 tablename" etc. It is giving me the error as below
ERROR exec.Task (SessionState.java:printError(401)) - FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
Can anybody suggest what do I need to do to get my metastore_db instantiated without recreating the tables? Otherwise, I have to duplicate the effort of creating the entire database/schema once again.
I have resolved the problem. These are the steps I followed:
- Go to $HIVE_HOME/bin/metastore_db
- Copied the db.lck to db.lck1 and dbex.lck to dbex.lck1
- Deleted the lock entries from db.lck and dbex.lck
- Log out from hive shell as well as from all running instances of HDFS
- Re-login to HDFS and hive shell. If you run DDL commands, it may again give you the "Could not instantiate HiveMetaStoreClient error"
- Now copy back the db.lck1 to db.lck and dbex.lck1 to dbex.lck
- Log out from all hive shell and HDFS instances
- 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
这篇关于FAILED:元数据错误:java.lang.RuntimeException:无法实例化org.apache.hadoop.hive.metastore.HiveMetaStoreClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!