首页 > 解决方案 > 为什么我的 sqoop 导入不适用于 hadoop 加密密码方法?

问题描述

根据一些要求,我使用了 hadoop 安全密码加密方法来加密密码并将其与 sqoop 导入一起使用。下面是讨论加密方法的链接。

http://www.hadoopadmin.co.in/tag/hadoop-security-credential-provider-path/

但是,当我执行以下 sqoop 导入时:-

sqoop import -Dhadoop.security.credentials.provider.path=jceks://<hdfs path to file>/encrypt.jceks --connect 'jdbc:sqlserver://IP:PORT/DB' -–username abd -–password-alias alias_pwd -–table Table_name --hive-import --create-hive-table --hive-table amitesh_db.hive_tbl --target-dir /<path>/hive_test -m 2

我收到以下错误:-

18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Error parsing arguments for import:
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: -–username
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: abd
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: -–password-alias
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: alias_pwd
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: -–table
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: Table_name 
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-import
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: --create-hive-table
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-table
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: amitesh_db.hive_tbl 
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: --target-dir
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: /<path>/hive_test
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: -m
18/08/27 08:17:42 ERROR tool.BaseSqoopTool: Unrecognized argument: 2

查看错误的性质,我尝试了 sqoop 开关的所有可能排列组合,但它们都不起作用。

有人可以帮我找出我的错误吗?

谢谢

标签: sqoop

解决方案


sqoop 调用命令中不需要凭据提供程序 api。您只需要指定密码别名就可以了。还要记住这一点,在 sqoop 中使用之前,您必须保存密码别名。hadoop 凭证提供程序 api 仅在 hadoop 2.6 之后可用。


推荐阅读