【异常】mysql导入hive表报错Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly

sqoop导入hive表报错Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly。

 

首先检查HiveConf类是否存在:
[hadoop@hadoop01 app]$ cd apache-hive-1.1.0-cdh5.7.0-bin/lib/
[hadoop@hadoop01 lib]$ jar tf hive-common-1.1.0-cdh5.7.0.jar | grep HiveConf.class
org/apache/hadoop/hive/conf/HiveConf.class

可以看到HiveConf.class是存在的,只是环境没有找到。

解决方法:
修改环境配置,将hive的lib添加到HADOOP_CLASSPATH中
[root@hadoop01 ~]# vi ~/.bash_profile
export HADOOP_CLASSPATH=/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/lib/*
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*
source ~/.bash_profile

 

posted @ 2020-03-30 21:36  lemon胡  阅读(502)  评论(0编辑  收藏  举报