在oozie编辑器中使用sqoop操作时出错(色调)

wfypjpf4  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(301)

我试图在色调的oozie编辑器中使用sqoop操作,但是我不能让它工作。
这是我迄今为止尝试过的。
我把一切都放在争论中,而不是命令中(http://alvincjin.blogspot.com.au/2014/06/create-sqoop-action-in-oozie-using-hue.html)
此外,我正在尝试连接到teradata,因此我将jdbcjar放在hdfs中,并将它们添加到文件中。这就是当前工作流在编辑器中的样子:sqoop操作。
工作流定义为:

<workflow-app name="Sqoop_test" xmlns="uri:oozie:workflow:0.5">
    <start to="sqoop-b20d"/>
    <kill name="Kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <action name="sqoop-b20d">
        <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>development</value>
                </property>
                <property>
                    <name>mapred.job.name</name>
                    <value>test_sqoop</value>
                </property>
                <property>
                    <name>mapred.task.timeout</name>
                    <value>0</value>
                </property>
            </configuration>
              <arg>import</arg>
              <arg>--connect</arg>
              <arg>jdbc:teradata://XXXXX</arg>
              <arg>--query</arg>
              <arg>select count(*) from XXXXX</arg>
              <arg>--fetch-size</arg>
              <arg>10000</arg>
              <arg>--num-mappers</arg>
              <arg>1</arg>
              <arg>--hive-table-name</arg>
              <arg>XXXXX.tmp_sqoop_test</arg>
              <arg>--hive-import</arg>
              <arg>--hive-overwrite</arg>
              <arg>--target-dir</arg>
              <arg>/user/dXXXXX/digital/test/tmp_sqoop_test</arg>
              <arg>--username</arg>
              <arg>XXXXX</arg>
              <arg>--password</arg>
              <arg>XXXXX</arg>
            <file>/user/hue/oozie/workspaces/digital/lib/terajdbc4.jar#terajdbc4.jar</file>
            <file>/user/hue/oozie/workspaces/digital/lib/teradata-connector-1.3.4-hadoop220.jar#teradata-connector-1.3.4-hadoop220.jar</file>
        </sqoop>
        <ok to="End"/>
        <error to="Kill"/>
    </action>
    <end name="End"/>
</workflow-app>

但是,我得到一个错误:

2016-01-06 14:13:52,114 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(296)) - Error parsing arguments for import:
2786 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: --hive-table-name
2016-01-06 14:13:52,114 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(299)) - Unrecognized argument: --hive-table-name
2786 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: XXXXX.tmp_sqoop_test
2016-01-06 14:13:52,114 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(299)) - Unrecognized argument: tdcprdr_app_digital.tmp_sqoop_test
2786 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: --hive-import
2016-01-06 14:13:52,114 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(299)) - Unrecognized argument: --hive-import
2786 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: --hive-overwrite
2016-01-06 14:13:52,114 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(299)) - Unrecognized argument: --hive-overwrite
2787 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: --target-dir
2016-01-06 14:13:52,115 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(299)) - Unrecognized argument: --target-dir
...

我的印象是,这个错误可以通过把一切都放在争论中来解决。当运行shell脚本时,同样的代码也能工作。我试过把import命令和连接字符串放在command部分,但都没有运行。我也尝试过创建一个简单的sqoop操作,只使用query和connect语句,如下所示:

<workflow-app name="Sqoop_minimal" xmlns="uri:oozie:workflow:0.5">
    <start to="sqoop-eeeb"/>
    <kill name="Kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <action name="sqoop-eeeb">
        <sqoop xmlns="uri:oozie:sqoop-action:0.2">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
              <arg>import</arg>
              <arg>--connect</arg>
              <arg>jdbc:teradata://tdXXXXX</arg>
              <arg>--query</arg>
              <arg>select count(*) from XXXXX</arg>
              <arg>--target-dir</arg>
              <arg>/user/dXXXXX/digital/test/tmp_sqoop_test</arg>
              <arg>--username</arg>
              <arg>XXXXX</arg>
              <arg>--password</arg>
              <arg>XXXXX</arg>
            <file>/user/hue/oozie/workspaces/digital/lib/teradata-connector-1.3.4-hadoop220.jar#teradata-connector-1.3.4-hadoop220.jar</file>
            <file>/user/hue/oozie/workspaces/digital/lib/terajdbc4.jar#terajdbc4.jar</file>
        </sqoop>
        <ok to="End"/>
        <error to="Kill"/>
    </action>
    <end name="End"/>
</workflow-app>

通过此工作流,我得到一个非常模糊的错误,如下所示:

>>> Invoking Sqoop command line now >>>

2287 [main] WARN  org.apache.sqoop.tool.SqoopTool  - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
2016-01-06 14:57:48,381 WARN  [main] tool.SqoopTool (SqoopTool.java:loadPluginsFromConfDir(175)) - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
2324 [main] INFO  org.apache.sqoop.Sqoop  - Running Sqoop version: 1.4.5.3.0.0.0-249
2016-01-06 14:57:48,418 INFO  [main] sqoop.Sqoop (Sqoop.java:<init>(92)) - Running Sqoop version: 1.4.5.3.0.0.0-249
2339 [main] WARN  org.apache.sqoop.tool.BaseSqoopTool  - Setting your password on the command-line is insecure. Consider using -P instead.
2016-01-06 14:57:48,433 WARN  [main] tool.BaseSqoopTool (BaseSqoopTool.java:applyCredentialsOptions(1014)) - Setting your password on the command-line is insecure. Consider using -P instead.
Intercepting System.exit(1)

<<< Invocation of Main class completed <<<

Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]

Oozie Launcher failed, finishing Hadoop job gracefully

oozie版本是4.1.0.3.0.0.0-249。
我试过在网上寻找解决方案,但没有成功。任何帮助都将不胜感激。谢谢您!
已经看到并尝试了以下链接:

https://community.cloudera.com/t5/Batch-Processing-and-Workflow/Sqoop-fails-with-quot-Error-parsing-arguments-for-import-quot/td-p/31930

http://stackoverflow.com/questions/25770698/sqoop-free-form-query-causing-unrecognized-arguments-in-hue-oozie
zzlelutf

zzlelutf1#

对于sqoop--hive table name use--hive table,没有这样的参数。现在不应该显示未识别的参数

相关问题