开发者社区> 问答> 正文

sqoop导入hive表报错Could not load org.apache.?报错

软件运行环境:redhat 6

hadoop-2.6.0-cdh5.9.0

hive-1.1.0-cdh5.9.0

sqoop-1.4.6-cdh5.9.0 

hive在主节点,sqoop在从节点上

sqoop导入hive表示报错

16/12/09 17:18:47 INFO mapreduce.ImportJobBase: Transferred 49 bytes in 19.624 seconds (2.4969 bytes/sec)
16/12/09 17:18:47 INFO mapreduce.ImportJobBase: Retrieved 6 records.
16/12/09 17:18:47 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `sss` AS t LIMIT 1
16/12/09 17:18:47 INFO hive.HiveImport: Loading uploaded data into Hive
16/12/09 17:18:47 ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
16/12/09 17:18:47 ERROR tool.ImportTool: Encountered IOException running import 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.ImportTool.importTable(ImportTool.java:524)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:190)
        at org.apache.sqoop.hive.HiveConfig.getHiveConf(HiveConfig.java:44)
        ... 12 more



我的hive能正常启动,


网上说的环境变量的问题也配置了,还有什么问题可以去检查

export HIVE_HOME=/home/hadoop/hive-1.1.0-cdh5.9.0
export HADOOP_HOME=/home/hadoop/hadoop-2.6.0-cdh5.9.0
export HIVE_CONF_DIR=/home/hadoop/hive-1.1.0-cdh5.9.0/conf
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*



展开
收起
爱吃鱼的程序员 2020-06-08 20:12:08 696 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    定义用户变量 不是系统变量  (用户目录下)

    sudovim~/.bash_profile 

    exportHADOOP_CLASSPATH=$HADOOP_CLASSPATH:/cloud/hive-1.1.0-cdh5.10.0/lib/*

    source~/.bash_profile

     

    sqoop导入hive表报错Couldnotloadorg.apache.hadoop.hive.conf.HiveConf.MakesureHIVE_CONF_DIRissetcorrectly 

    方法1:

    往~/.bash_profile里新加一行
    exportHADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*
    然后,source~/.bash_profile

    cphive/lib/hive-common-3.0.0.jarsqoop/lib/   

    @yangchangjiang的答案有用,可惜积分不够顶不上去。

    2020-06-08 20:12:23
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像