使用Sqoop创建/导入配置单元表

时间:2017-03-15 04:56:56

标签: mysql hive sqoop

当我使用下面的import命令时,它允许我创建表并将数据从mysql导入到Hive,我可以在Hive中看到表“小部件”。

enableArchiveFileCompression="true" 

但是每当我使用“create-hive-table”命令时,我都会收到错误。

命令:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
  <targets >
   <target name="file" xsi:type="File"
  layout="${longdate} ${logger} ${message}" 
  fileName="${basedir}/logs/logfile.txt" 
  archiveFileName="${basedir}/archives/log.{#}.txt"
  archiveEvery="Day"
  archiveNumbering="Rolling"
  maxArchiveFiles="7"
enableArchiveFileCompression="true" />
  </targets>
  <rules>
    <logger name="*" minlevel="Debug" writeTo="logfile">
    </logger>
  </rules>
</nlog>

错误:

  

17/03/14 21:30:21 INFO hive.HiveImport:FAILED:执行错误,   从org.apache.hadoop.hive.ql.exec.DDLTask返回代码1。   java.lang.RuntimeException:无法实例化   org.apache.hadoop.hive.metastore.HiveMetaStoreClient 17/03/14 21:30:21   ERROR tool.CreateHiveTableTool:遇到运行create的IOException   table job:java.io.IOException:Hive退出,状态为1   org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:385)     在   org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:335)     在org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:239)     在   org.apache.sqoop.tool.CreateHiveTableTool.run(CreateHiveTableTool.java:58)     在org.apache.sqoop.Sqoop.run(Sqoop.java:145)at   org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)at   org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)at at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)at at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)at at   org.apache.sqoop.Sqoop.main(Sqoop.java:238)

任何人都可以帮助我,为什么我收到此错误。 来自你身边的任何意见都很棒:-)。

1 个答案:

答案 0 :(得分:0)

您是否正在运行Hadoop服务。

$ start-all.sh

蜂房&GT; show database;