【发布时间】:2015-04-13 21:35:02
【问题描述】:
我们正在尝试使用 sqoop 作业作为 spring xd 的模块将数据从 sql server 摄取到 hdfs。
当我尝试使用 xd - shell of spring xd 工具运行以下命令时:
sqoop --command=import --args='--connect 'jdbc:sqlserver://localhost/mydb'
--username root --password p@ss --query select * from tablename
--target-dir /path/to/hdfs/file'
从 spring xd shell 作为 sqoop 作业启动作业时出现以下错误:
sqoop.errors
Try --help for usage instructions.
Exception in thread "main" java.lang.RuntimeException: Sqoop failed - return code 1
at org.springframework.xd.sqoop.SqoopRunner.main(SqoopRunner.java:81)
更多错误
19:38:40,556 ERROR main tool.BaseSqoopTool - Error parsing arguments for import:
19:38:40,556 ERROR main tool.BaseSqoopTool - Unrecognized argument: '--connect
19:38:40,556 ERROR main tool.BaseSqoopTool - Unrecognized argument: 'jdbc:sqlserver://localhost/mydb'
19:38:40,556 ERROR main tool.BaseSqoopTool - Unrecognized argument: --username
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: root
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: --password
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: p@ss
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: --query
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: select
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: *
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: from
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: tablename
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: --target-dir
19:38:40,557 ERROR main tool.BaseSqoopTool - Unrecognized argument: /path/to/hdfs/file'
退出说明:
java.lang.IllegalStateException: Step execution failed - Exception in thread "main" java.lang.RuntimeException: Sqoop failed - return code 1
at org.springframework.batch.step.tasklet.x.AbstractProcessBuilderTasklet.execute(AbstractProcessBuilderTasklet.java:209)
我也尝试将= 放在参数之后,但得到了相同的结果。
为什么?
【问题讨论】:
-
您好,欢迎来到 Stack Overflow!在当前状态下,您的问题无法回答;请尝试对其进行编辑以提高可读性,并添加有关您尝试过的内容的更多详细信息。
-
我添加了大部分信息。可读吗?