FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
http://blog.csdn.net/lxpbs8851/article/details/11018933
起因是我重裝了mysql數據庫。 安裝之后 把訪問權限都配置好 : GRANT ALL PRIVILEGES ON*.* TO?'hive'@'%'?Identified by 'hive';??GRANT ALL PRIVILEGES ON*.* TO?'hive'@'localhost'?Identified by 'hive';??
GRANT ALL PRIVILEGES ON*.* TO?'hive'@'127.0.0.1'?Identified by 'hive';??
本機地址: 192.168.103.43? 機器名字:192-168-103-43
flush privileges; 啟動hive 發生下面的錯誤:
hive> show tables;
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTaskFAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClientFAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
?
cd ${HIVE_HOME}/bin
./hive -hiveconf hive.root.logger=DEBUG,console
hive> show tables;
得到如下的錯誤信息(當然 不同的問題所產生的日志是不同的):
Caused by: javax.jdo.JDOFatalDataStoreException: Access denied for user?'hive'@'192-168-103-43'?(using password: YES)
NestedThrowables:
java.sql.SQLException: Access denied for user?'hive'@'192-168-103-43'?(using password: YES)
??????? at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:298)
??????? at org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:601)
??????? at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:286)
??????? at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
??????? at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
??????? at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
??????? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
??????? at java.lang.reflect.Method.invoke(Method.java:597)
??????? at javax.jdo.JDOHelper$16.run(JDOHelper.java:1958)
??????? at java.security.AccessController.doPrivileged(Native Method)
??????? at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953)
??????? at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
??????? at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
??????? at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
??????? at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:262)
??????? at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:291)
??????? at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:224)
??????? at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:199)
??????? at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
??????? at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
??????? at org.apache.hadoop.hive.metastore.RetryingRawStore.<init>(RetryingRawStore.java:62)
??????? at org.apache.hadoop.hive.metastore.RetryingRawStore.getProxy(RetryingRawStore.java:71)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:413)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:401)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:439)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:325)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:285)
??????? at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:53)
??????? at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:58)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStore.newHMSHandler(HiveMetaStore.java:4102)
??????? at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:121)
??????? ... 28 more
?
發現數據庫的權限? HIVE需要的是
'hive'@'192-168-103-43'?這個IP地址
然后試著在mysql中加上權限:
GRANT ALL PRIVILEGES ON*.* TO?'hive'@'192-168-103-43'?Identified by 'hive';?
flush privileges;
?
再次登錄hive
hive> show tables;
OK
?
能正常的查詢表了,希望能幫到有同樣問題的人。
================
我的是com.mysql.jdbc.Driver notfound, 所以需要把mysql的驅動放到hive的lib目錄
總結
以上是生活随笔為你收集整理的FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu安装配置Mysql
- 下一篇: ubuntu下hbase的伪分布式安装与