Sqoop报错-Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is correctly

Issue

19/04/29 21:34:31 ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly.
19/04/29 21:34:31 ERROR tool.ImportTool: Import failed: 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:537)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
	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)

Sqoop报错-Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is correctly_第1张图片

Answer

在Sqoop-MySQL导入到Hive中,无法加载org.apache.hadoop.hive.conf.HiveConf, 确保正确设置HIVE_CONF_DIR

在/etc/profile文件里配置HIVE_CONF_DIR和HADOOP_CLASSPATH

export HIVE_CONF_DIR=/usr/local/hive/apache-hive-2.3.4/conf
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HIVE_HOME/lib/*

Sqoop报错-Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is correctly_第2张图片
Sqoop报错-Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is correctly_第3张图片

你可能感兴趣的:(大数据)