配置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下也会报错


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