--Warehouse-dir工作但目标-dir错误

时间:2017-07-03 13:14:06

标签: sqoop

使用target-dir时,为什么--import-all-tables无效?

sqoop import-all-tables --connect jdbc:mysql://localhost/retail_db --username root --password cloudera --warehouse-dir /user/cloudera/retail_db

sqoop import-all-tables --connect jdbc:mysql://localhost/retail_db --username root --password cloudera --target-dir /user/cloudera/retail_db

错误日志;

Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
17/07/05 06:55:43 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.8.0
17/07/05 06:55:43 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/07/05 06:55:43 ERROR tool.BaseSqoopTool: Error parsing arguments for import-all-tables:
17/07/05 06:55:43 ERROR tool.BaseSqoopTool: Unrecognized argument: --target-dir
17/07/05 06:55:43 ERROR tool.BaseSqoopTool: Unrecognized argument: /user/cloudera/retail_db

1 个答案:

答案 0 :(得分:0)

请查看Sqoop用户指南: https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html

默认情况下,当发出一个import-all-tables命令时,它将导入到当前用户的hdfs主文件夹:

即: sqoop import-all-tables --connect jdbc:mysql:// localhost / retail_db --username root --password cloudera --target -dir / user / cloudera /

或以下也可以,它只会导入到/ user / cloudera /:

sqoop import-all-tables --connect jdbc:mysql:// localhost / retail_db --username root --password cloudera

但是在你的情况下,你使用的是另一个目的地,除了你的家庭目录,因此--warehouse-dir将在这里使用:

sqoop import-all-tables --connect jdbc:mysql:// localhost / retail_db --username root --password cloudera --warehouse-dir / user / cloudera / retail_db