CDH5.11.0安裝啓動hive過程org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver

解決文章:http://blog.csdn.net/brotherdong90/article/details/4966173

1,通過Cloudera Manager添加Hive服務,在啓動Hive的時候遇到錯誤:

.org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver

這種情況,猜測是缺少jdbc驅動,於是添加jdbc驅動到相應的包下面。報的錯中提示了lib路徑,添加一下即可。

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)

   這個是hive中沒有版本信息,是經常碰到的。因爲首次使用hive,沒有相應的版本信息。

.修改conf/hive-site.xml 中的 “hive.metastore.schema.verification” 值爲 false 即可解決  MetaException(message:Version information not found in metastore. )”

當然,如果是cm中,修改通過截面修改一下hive.metastore.schema.verification,然後重啓以下即可。

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即可。這樣會自動進行創建表操作。


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;   修改完成後就正常了。

發佈了85 篇原創文章 · 獲贊 50 · 訪問量 64萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章