gpt4 book ai didi

java - 无法在 SQOOP 中创建 JOB

转载 作者:可可西里 更新时间:2023-11-01 14:42:23 26 4
gpt4 key购买 nike

我在 SQOOP 中运行了下面的代码片段,结果在代码下方列出了错误。

bin/sqoop job --create myjob import --connect jdbc:mysql://localhost/test -username root -password root --table patient -m 1 --target-dir/Sqoop/MRJob

administrator@ubuntu:~/sqoop-1.4.4.bin__hadoop-1.0.0$ bin/sqoop job --create myjob import --connect jdbc:mysql://localhost/test -username root -password root --table patient -m 1 --target-dir /Sqoop/MRJob Warning: /usr/lib/hcatalog does not exist! HCatalog jobs will fail. Please set $HCAT_HOME to the root of your HCatalog installation. Warning: $HADOOP_HOME is deprecated.

14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Error parsing arguments for job: 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: import 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: --connect 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: jdbc:mysql://localhost/test 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: -username 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: root 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: -password 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: root 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: --table 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: patient 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: -m 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: 1 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: --target-dir 14/07/16 23:23:36 ERROR tool.BaseSqoopTool: Unrecognized argument: /Sqoop/MRJob

Try --help for usage instructions. usage: sqoop job [GENERIC-ARGS] [JOB-ARGS] [-- [] [TOOL-ARGS]]

Job management arguments: --create Create a new saved job --delete Delete a saved job --exec Run a saved job --help
Print usage instructions --list List saved jobs --meta-connect Specify JDBC connect string for the metastore --show Show the parameters for a saved job --verbose
Print more information while working

Generic Hadoop command-line arguments: (must preceed any tool-specific arguments) Generic options supported are -conf specify an application configuration file -D use value for given property -fs specify a namenode -jt specify a job tracker -files specify comma separated files to be copied to the map reduce cluster -libjars specify comma separated jar files to include in the classpath. -archives specify comma separated archives to be unarchived on the compute machines.

The general command line syntax is bin/hadoop command [genericOptions] [commandOptions]

有人可以帮我解决这个问题吗??

预先感谢您的帮助。

注意:我的SQL相关字典很完美。问候

最佳答案

您需要在 sqoop 命令中做一个小改动。正确的语法是

bin/sqoop job --create myjob -- import --connect jdbc:mysql://localhost/test --username root --password root --table PATIENT -m 1 --target-dir/Sqoop/MR作业

[ 注意:“--”和导入前的空格。其次,在用户名和密码前使用 POSIX 表示法“--”。第三,使用大写字母指定表名] 它应该可以工作。

很少有标准:使用选项文件 来存储凭据(用户名、密码和连接字符串)并将其作为参数传递给--options-file。希望这可以帮助。

关于java - 无法在 SQOOP 中创建 JOB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24787616/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com