1,mysql加载的jar包未找到!

.........
Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke the "BONECP" plugin to create a ConnectionPool gave an error : The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.
at org.datanucleus.store.rdbms.ConnectionFactoryImpl.generateDataSources(ConnectionFactoryImpl.java:232)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl.initialiseDataSources(ConnectionFactoryImpl.java:117)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl.<init>(ConnectionFactoryImpl.java:82)
... 79 more
Caused by: org.datanucleus.store.rdbms.connectionpool.DatastoreDriverNotFoundException: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.
at org.datanucleus.store.rdbms.connectionpool.AbstractConnectionPoolFactory.loadDriver(AbstractConnectionPoolFactory.java:58)
at org.datanucleus.store.rdbms.connectionpool.BoneCPConnectionPoolFactory.createConnectionPool(BoneCPConnectionPoolFactory.java:54)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl.generateDataSources(ConnectionFactoryImpl.java:213)
... 81 more

  

解决办法:

在mysql 官网下载  mysql-connector-java-5.0.8.tar.gz 的压缩包, 链接:mysql-connector下载

下载好后解压,将mysql-connector-java-5.0.8-bin.jar文件移动到 hive的安装目录下的lib文件夹下。

tar -zxvf mysql-connector-java-5.0.8.tar.gz  # 解压
mv mysql-connector-java-5.0.8、mysql-connector-java-5.0.8-bin.jar hive/lib/ #其中 hive/lib 为你的安装目录

注意:其中的 hive为你的安装hive安装目录。

2,MetaException(message 异常

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1652)
... 23 more
Caused by: MetaException(message:Version information not found in metastore. )
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:83)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:92)
at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6608)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:239)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:70)
... 28 more
Caused by: MetaException(message:Version information not found in metastore. )
at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7754)

解决方式:在hive/conf下的hive-site.xml文件中配置hive.metastore.schema.verification 属性为false:

   <property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>

其中hive.metastore.schema.verification防止架构版本不兼容时的 Metastore 操作。考虑将此设置为“True”,以减少 Metastore 操作期间发生架构损坏的可能性

3,MetaException(message:Hive metastore database is not initialized数据库没有初始化.

Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))
at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3793)
at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:244)
at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:227)
... 14 more
Caused by: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3556)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3528)
at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3790)
... 16 more

这是由于没有初始化数据库,生成元数据。 需要执行以下指令(在hive的bin目录下执行)

./schematool -initSchema -dbType mysql 

最新文章

  1. php常用的几个模块
  2. Mantis1.2.19 在Windows 平台上的安装配置详解
  3. TCP/IP详解 笔记十四
  4. [AMPPZ 2013]Bytehattan
  5. 第二十四篇、iOS 10版本适配
  6. [C和指针] rearrange.c
  7. shell中命令的执行流程
  8. 用macports装了一份openssl
  9. IOS Cell 重影
  10. php小测试,难点与分享
  11. [转载] linux中文件描述符fd和文件指针flip的理解
  12. 写给小前端er的nodejs,mongodb后端小攻略~ (windows系统~)
  13. Flask--特殊装饰器, CBV, 三方组件
  14. arcgis raster clip and mask difference 栅格 提取 clip 和 mask 方法的区别
  15. DateTimeOffset DateTime
  16. ajaxForm和ajaxSubmit 粘贴就可用
  17. [转]Visual Studio 2010 中安装Qt 5.1
  18. (转)帮你深入理解OAuth2.0协议
  19. 3.2 Spark内置RPC框架
  20. PS学习笔记 1---- 光和色的关系(上)

热门文章

  1. Mysql大概1700W大表删除1000W左右数据,发现数据大小和索引大小并没有减少思考
  2. CyclicBarrier(栅栏)的用法详解及与countDownLatch用法区别
  3. Linux 路由 策略路由
  4. jQuery EasyUI学习一
  5. JS常见面试题,看看你都会多少?
  6. ES6 class类 静态方法及类的继承
  7. 剑指offer 面试题4:二维数组中的查找
  8. 计算机科学: 寄存器&amp;内存
  9. 【Azure Developer】Python代码通过AAD认证访问微软Azure密钥保管库(Azure Key Vault)中机密信息(Secret)
  10. g/test/s/lose/won/g