1,经过Cloudera Manager添加Hive服务,在启动Hive的时候遇到错误:java
.org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load drivermysql
这种状况,猜想是缺乏jdbc驱动,因而添加jdbc驱动到相应的包下面。报的错中提示了lib路径,添加一下便可。sql
mysql-connector-java-5.1.36-bin.jar添加到hive的lib:
/opt/cloudera/parcels/CDH-5.4.7-1.cdh5.4.7p0.36/lib/hive/lib数据库
2,启动以后报错:org.apache.hadoop.hive.metastore.HiveMeta MetaException(message:Version infomation not found int metastore)apache
这个是hive中没有版本信息,是常常碰到的。由于首次使用hive,没有相应的版本信息。oop
.修改conf/hive-site.xml 中的 “hive.metastore.schema.verification” 值为 false 便可解决 MetaException(message:Version information not found in metastore. )”ui
固然,若是是cm中,修改经过截面修改一下hive.metastore.schema.verification,而后重启如下便可。this
3,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"编码
在启动hive的时候启动失败,经过日志,发现这个问题。查阅资料,发现修改配置文件中的datanucleus.autoCreateSchema 为true便可。这样会自动进行建立表操做。.net
4,FAILED: Error in metadata: MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes
这个错误一看就知道,超长了。须要修改mysql的hive数据库的编码。alter database hive character set latin1; 修改完成后就正常了。
以上摘自(https://blog.csdn.net/duyuanhai/article/details/77540288)
如下我本身补充
5,按照上面处理后依旧报错
generally unnecessary. javax.jdo.JDODataStoreException: Exception thrown obtaining schema column information from datastore
去网上查,大体都是说mysql驱动版本问题,而后尝试各类版本,依旧出错。屡次尝试后,怀疑TMD 启动HIVE就没有用个人驱动包,遂查日志看hive启动环境中使用的mysql驱动是谁
使用系统里面的mysql驱动包,遂替换该jar包
mv mysql-connector-java.jar mysql-connector-java.jar.bk
ln -s /opt/cm-5.11.2/share/cmf/lib/mysql-connector-java-5.1.27-bin.jar /usr/share/java/mysql-connector-java.jar
把其指向个人jar,问题解决