sqoop 导入数据到hive报错数据库不存在,但是我在hive已经创建了数据库

1,报错日志如下

19/05/25 22:18:43 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `back` AS t LIMIT 1
19/05/25 22:18:43 INFO hive.HiveImport: Loading uploaded data into Hive
19/05/25 22:18:50 INFO hive.HiveImport: 19/05/25 22:18:50 WARN conf.HiveConf: HiveConf of name hive.metatore.warehouse.dir does not exist
19/05/25 22:18:50 INFO hive.HiveImport: 
19/05/25 22:18:50 INFO hive.HiveImport: Logging initialized using configuration in jar:file:/opt/sqoop-1.4.7/lib/hive-common-1.1.0.jar!/hive-log4j.properties
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: Class path contains multiple SLF4J bindings.
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: Found binding in [jar:file:/opt/hbase-1.2.0/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: Found binding in [jar:file:/opt/hive-1.1.0/lib/hive-jdbc-1.1.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
19/05/25 22:18:51 INFO hive.HiveImport: SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
19/05/25 22:19:02 INFO hive.HiveImport: FAILED: SemanticException [Error 10072]: Database does not exist: t1
19/05/25 22:19:03 ERROR tool.ImportTool: Import failed: java.io.IOException: Hive exited with status 88
	at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:384)
	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: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)

2,神奇的是跑完了map但是最后却说hive的数据库不存在,可是我已经创建了,我想可能是sqoop没有读取到hive的元数据的原因,又怀疑是mysql的元数据出错了,删除了mysql里面的hive源数据库重新创建元数据库,结果还是类似的问题,想起了我上一篇文章的类似问题,于是我把hive的配置文件hive-site.xml拷贝到sqoop的conf目录下来,sqoop导入数据成功。

cp /usr/local/src/hive/conf/hive-site.xml /opt/sqoop-1.4.7/conf/
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值