Hive之——启动问题及解决方案

本文详细分析了Hive启动过程中遇到的两大类问题:元数据表缺失与权限问题,并提供了相应的解决办法。对于元数据表缺失,通过调整DataNucleus配置,启用自动创建表功能可解决。对于权限问题,包括本地目录权限、HDFS权限及用户权限,分别通过修改目录权限、配置Hive和Hadoop参数以及使用正确用户身份运行Hive来解决。
摘要由CSDN通过智能技术生成

问题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>  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

河南骏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值