Encountered IOException running create table job: : org.apache.hadoop.hive.conf.HiveConf

19/08/09 16:30:16 ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
19/08/09 16:30:16 ERROR tool.CreateHiveTableTool: Encountered IOException running create table job: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
    at org.apache.sqoop.hive.HiveConfig.getHiveConf(HiveConfig.java:50)
    at org.apache.sqoop.hive.HiveImport.getHiveArgs(HiveImport.java:392)
    at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:379)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:337)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:241)
    at org.apache.sqoop.tool.CreateHiveTableTool.run(CreateHiveTableTool.java:57)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf

 

使用sqoop创建和mysql相同的表结构的时候:

sqoop create-hive-table --connect jdbc:mysql://10.136.198.112:3306/questions --username root --password root --table user --hive-table hhive

报错

Encountered IOException running create table job: : org.apache.hadoop.hive.conf.HiveConf_第1张图片

解决方法,添加环境变量

往/etc/profile最后加入 export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*

并且刷新source /etc/profile

然后再次执行sqoop语句,执行成功,但是hive中并没有生成表

Encountered IOException running create table job: : org.apache.hadoop.hive.conf.HiveConf_第2张图片

解决方法:讲hive/config下的hive-site.xml配置文件复制到sqoop/config下,再次执行,成功

hive中的表已经生成

转载于:https://my.oschina.net/renzhimin/blog/3085899

你可能感兴趣的:(Encountered IOException running create table job: : org.apache.hadoop.hive.conf.HiveConf)