配置hive的常見出錯總結

1. Hive metastore database is not initialized.

Exception in thread "main" java.lang.RuntimeException: 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)

報錯解決:

在hive的bin目錄下執行:./schematool -dbType mysql -initSchema


2.Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D


解決方案如下:
1.
查看hive-site.xml配置,會看到配置值含有"system:java.io.tmpdir"的配置項
2.在hive目錄下
新建文件夾iotmp
3.將含有"system:java.io.tmpdir"的配置項的值修改爲如上地址
啓動hive,成功!


3.The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH

解決方法:

將mysql-connector-java-5.1.37/mysql-connector-java-5.1.37-bin.jar放在$HIVE_HOME/lib

注意:mysql-connector-java-version-bin.jar的version(版本)不能太低,我試過5.1.7 版本,即使把jar放在lib下也會報錯


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章