hadoop之配置hive遇到的问题和错误
1.hive配置好之后,启动hive之前要初始化
初始化hive命令是:schematool -dbType mysql -initSchema
2.启动hive之前先启动hadoop,其命令如下:
./sbin/start-all.sh
./bin/hive
3.启动hive时遇到的问题
1)org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
出现这个错误的原因:是因为jdbc驱动放的目录不对,应该放在hive的lib目录下
2)Caused by:MetaException(message: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 -initSchema -dbType derby**
3)出现如下问题SessionHiveMetaStoreClient初始化hive
解决办法:将hive-site.xml以及hive-default.xml下的hive.metastore.schema.verification的值改为TRUE