我正在尝试将 sqoop 作业作为 oozie 动作运行。我将 MySQL 作为 jobtracker 节点上的元存储。我在某处读到 oozie sqoop 无法通过导入创建配置单元表。所以我试图将数据转储到hdfs。那仍然是真的吗?
我检查了共享库。
我正在尝试从 MS SQL 数据库中进行 Sqoop。
当我运行不需要来自 shell 的元存储的 sqoop 命令时,它可以工作。
sqoop import --connect 'jdbc:sqlserver://host;username=sqoopimport;password=password;database=db1' --table t1--target-dir /user/root/sqoop-import/tmp/t1
当我尝试将其作为 sqoop 操作运行时,出现此错误
>>> Invoking Sqoop command line now >>>
2151 [main] WARN org.apache.sqoop.tool.SqoopTool - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
2259 [main] WARN org.apache.sqoop.ConnFactory - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
2285 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Got error creating database manager: java.io.IOException: No manager for connect string: 'jdbc:sqlserver://host;username=sqoopimport;password=password;database=db1'
at org.apache.sqoop.ConnFactory.getManager(ConnFactory.java:185)
at org.apache.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:217)
at org.apache.sqoop.tool.ImportTool.init(ImportTool.java:83)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:464)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
at org.apache.oozie.action.hadoop.SqoopMain.runSqoopJob(SqoopMain.java:203)
at org.apache.oozie.action.hadoop.SqoopMain.run(SqoopMain.java:172)
at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:37)
at org.apache.oozie.action.hadoop.SqoopMain.main(SqoopMain.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:495)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
工作流.xml
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.2" name="sqoop-wf">
<start to="sqoop-node"/>
<action name="sqoop-node">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
<property>
<name>oozie.use.system.libpath</name>
<value>true</value>
</property>
<property>
<name>oozie.libpath</name>
<value>/user/oozie/share/lib/sqoop</value>
</property>
</configuration>
<command>import --connect 'jdbc:sqlserver://host;username=sqoopimport;password=password;database=db1' --table t1--target-dir /user/root/sqoop-import/tmp/t1</command>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
我认为这是主要原因。我在共享库目录 2285 [main] 错误 org.apache.sqoop.tool.BaseSqoopTool 中有库 - 创建数据库管理器时出错:java.io.IOException:连接字符串没有管理器:
我错过了什么吗?任何帮助表示赞赏。
谢谢, 阿布舍克