Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
来源:互联网 发布:timcat如何绑定域名 编辑:程序博客网 时间:2024/05/18 01:05
在启动Hive时,报错:
The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
详细描述见一篇英文文档。
I'm trying to install Apache Hive, I insert HIVE_HOME and HADOOP_HOME into hive_config.sh and I copy some hive jar into the $HADOOP_HOME/lib But when to lunch it, by using hive command
this error appear :
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClientat org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:346)at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:606)at org.apache.hadoop.util.RunJar.main(RunJar.java:156)Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClientat org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1412)at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:62)at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2453)at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2465)at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:340)... 7 moreCaused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:526)at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1410)... 12 moreCaused by: javax.jdo.JDOFatalInternalException: Error creating transactional connection factoryNestedThrowables:java.lang.reflect.InvocationTargetExceptionetc ...
ANY HELP PLEASE !
相关回答:
Your hadoop should be in running condition. untar the downloaded hive and give the permission to the directory. Go to the hive/conf directory. Make hive-env.sh.template file to hive-env.sh and hive-default.xml.template file to hive-site.xml. Open hive-evn.sh and set JAVA_HOME in hive-env.sh and HADOOP_HOME and also set the hive path by.
export HIVE_HOME=/usr/local/hive
then open hive terminal by
hive
by default hive takes Derby database, if it gives error of metastore at the time of create table, go to metastore/metastore_db and delete the *.lck files.
Add the JAVA_HOME, HADOOP_HOME, HIVE_HOME in .bashrc or .bash_profile.
$cd ~$vi .bashrcpaste following to the end of the file#Hadoop variablesexport JAVA_HOME=/usr/lib/jvm/jdk/export PATH=$PATH:$JAVA_HOME/binexport HADOOP_HOME=/usr/local/hadoopexport PATH=$PATH:$HADOOP_INSTALL/binexport PATH=$PATH:$HADOOP_INSTALL/sbinexport HADOOP_MAPRED_HOME=$HADOOP_INSTALLexport HADOOP_COMMON_HOME=$HADOOP_INSTALLexport HADOOP_HDFS_HOME=$HADOOP_INSTALLexport YARN_HOME=$HADOOP_INSTALLexport HIVE_HOME=/usr/local/hiveexport PATH=$PATH:$HIVE_HOME/bin###end of paste
简单翻译:
Hadoop应该处于运行状态;
用户有对Hive文件的权限;
进入hive安装目录下的conf文件夹,由hive-env.sh.template文件复制出hive-env.sh文件,由hive-default.xml.template文件复制出hive-site.xml文件,在hive-site.xml文件中,设置JAVA_HOME、HADOOP_HOME和HIVE_HOME;
如果Hive使用的是Derby数据库,在创建table时报metastore错误,去metastore/metastore_db 目录,删除*.lck文件;
在.bashrc 或 .bash_profile加入JAVA_HOME, HADOOP_HOME, HIVE_HOME;
参考自:
http://stackoverflow.com/questions/28695444/apache-hive-unable-to-instantiate-org-apache-hadoop-hive-metastore-hivemetasto
错误原因:
未正确放置mysql jdbc jar 包
正确方法:
wget http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.37.tar.gztar xvzf mysql-connector-java-5.1.37.tar.gzcp mysql-connector-java-5.1.37/mysql-connector-java-5.1.37-bin.jar $HIVE_HOME/lib
目的是将mysql-connector-java-5.1.37/mysql-connector-java-5.1.37-bin.jar放在$HIVE_HOME/lib
- Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- MySql JDBC in eclipse "The driver class was not found in the specified driver JAR/Zip file." error
- JDBC Driver class not found: com.mysql.jdbc.Driver
- weblogic 配置 connectionpool Exception :JDBC driver is not on the CLASSPATH错误是怎么回事!(解决方法)
- com.mysql.jdbc.CommunicationsException: The driver was unable to create a connection......
- class not found exception:com.mysql.jdbc.Driver解决方法
- 解决org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.Driver
- 解决org.hibernate.HibernateException: JDBC Driver class not found: com.mysql.jdbc.Driver
- 严重: The web application [/] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregis
- The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister i
- The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister
- S2SH The web application[] registered the JDBC driver [com.mysql.jdbc.Driver] bur failed to unreqist
- Could not load JDBC driver class [com.mysql.jdbc.Driver]
- registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it
- tomcat 启动报错 registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister
- 使用DBCP出现registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it
- tomcat 之memory leak== registered the jdbc driver com mysql jdbc driver
- android 自定义文本组合控件
- 微信打开第三方app
- MFC 技巧之一
- sql基础04
- POJ 1637 Sightseeing tour (网络流解决混合图欧拉回路问题)
- Hive学习2_错误: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH
- 支付宝二维码支付文档,找了好久,记在这里
- 在adapter中动态删除item,并刷新界面。
- Tunnel Warfare
- RESTful API 设计最佳实践
- 你一定会经历的人生困苦处境,你经历了几个,十本经典收藏
- C语言实现strcat
- XAudio2学习三之获取音频输出设备信息
- 删除两个表的符合条件的数据