当前位置:   article > 正文

Hive之——启动问题及解决方案_at org.apache.hadoop.hive.ql.session.sessionstate.

at org.apache.hadoop.hive.ql.session.sessionstate.start(sessionstate.java:50

问题1:

  1. Caused by: javax.jdo.JDODataStoreException: Required table missing : "`VERSION`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.autoCreateTables"  
  2. NestedThrowables:  
  3. org.datanucleus.store.rdbms.exceptions.MissingTableException: Required table missing : "`VERSION`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.autoCreateTables"  
  4.         at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:461)  
  5.         at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:732)  
  6.         at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:752)  
  7.         at org.apache.hadoop.hive.metastore.ObjectStore.setMetaStoreSchemaVersion(ObjectStore.java:6664)  
解决方法:
查看并跟踪hive的源码得出
  1. if ((this.readOnlyDatastore) || (this.fixedDatastore))    
  2. {    
  3.   this.autoCreateTables = false;    
  4.   this.autoCreateColumns = false;    
  5.   this.autoCreateConstraints = false;    
  6. }    
  7. else    
  8. {    
  9.   boolean autoCreateSchema = conf.getBooleanProperty("datanucleus.autoCreateSchema");    
  10.   if (autoCreateSchema)    
  11.   {    
  12.     this.autoCreateTables = true;    
  13.     this.autoCreateColumns = true;    
  14.     this.autoCreateConstraints = true;    
  15.   }    
  16.   else  
  17.   {    
  18.     this.autoCreateColumns = conf.getBooleanProperty("datanucleus.autoCreateColumns");    
  19.     this.autoCreateTables = conf.getBooleanProperty("datanucleus.autoCreateTables");    
  20.     this.autoCreateConstraints = conf.getBooleanProperty("datanucleus.autoCreateConstraints");    
  21.   }  
  22. }  
看来关键是 this.readOnlyDatastore和this.fixedDatastore 这2个字段而且autoCreateSchema 这个设置为true 就可以决定了其他的设置,所以其他设置在此都无效了。继续追踪org.datanucleus.store.AbstractStoreManager 发现了这2个字段的设置代码

  1. this.readOnlyDatastore = conf.getBooleanProperty("datanucleus.readOnlyDatastore");  
  2. this.fixedDatastore = conf.getBooleanProperty("datanucleus.fixedDatastore");    
修改的配置的内容如下

  1. <property>  
  2.     <name>datanucleus.readOnlyDatastore</name>  
  3.     <value>false</value>  
  4. </property>  
  5. <property>   
  6.     <name>datanucleus.fixedDatastore</name>  
  7.     <value>false</value>   
  8. </property>  
  9. <property>   
  10.     <name>datanucleus.autoCreateSchema</name>   
  11.     <value>true</value>   
  12. </property>  
  13. <property>  
  14.     <name>datanucleus.autoCreateTables</name>  
  15.     <value>true</value>  
  16. </property>  
  17. <property>  
  18.     <name>datanucleus.autoCreateColumns</name>  
  19.     <value>true</value>  
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/719410
推荐阅读
相关标签
  

闽ICP备14008679号