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,問題解決