sqoop自动增量导入 报错

在Sqoop的查询案例中可能会出现以下的报错:

[admin@hadoop102 sqoop-1.4.6.bin__hadoop-2.0.4-alpha]$ bin/sqoop import \
> --connect jdbc:mysql://hadoop102:3306/company \
> --user root \
> --password root \
> --table staff \
> --target-dir /user/company \
> --delete-target-dir \
> --num-mappers 1 \
> --fields-terminated-by "\t"
Warning: /opt/module/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/bin/../../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /opt/module/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/bin/../../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/module/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/bin/../../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
18/08/07 22:12:04 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Error parsing arguments for import:
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --user
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: root
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --password
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: root
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --table
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: staff
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --target-dir
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: /user/company
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --delete-target-dir
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --num-mappers
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: 1
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: --fields-terminated-by
18/08/07 22:12:04 ERROR tool.BaseSqoopTool: Unrecognized argument: \t

Try --help for usage instructions.

其实,我们可以一眼就看出来报错的信息是在 import 上面,出错的原因,就是因为参数输入错误。漏掉了– import。正确的代码输入是这样子的。
sqoop自动增量导入 报错_第1张图片

你可能感兴趣的:(大数据)