2016-06-17 41 views
0

Sqoop作業始終在CLI中提示輸入密碼。爲了避免這種情況,有人說sqoop.metastore.client.record.password屬性應該設置爲true。但到處都有人說我需要在sqqop_site.xml中更改此值。無論如何,我可以將這個價值單獨設置爲一項工作。我試圖像下面創建一個作業和sqoop無法創建它帶有密碼問題的Sqoop作業

sqoop job --create TEST -D sqoop.metastore.client.record.password=true -- import \ 
--connect jdbc:netezza://xx.xxx.xx.xxx/database \ 
--username username \ 
--password password \ 
--table tablename \ 
--split-by key \ 
--hcatalog-database hivedatabase \ 
--hcatalog-table hivetable \ 
--hcatalog-storage-stanza 'STORED as ORC TBLPROPERTIES('orc.compress'='NONE')' \ 
-m 100 

錯誤:

Warning: /usr/iop/4.1.0.0/sqoop/../accumulo does not exist! Accumulo imports will fail. 
Please set $ACCUMULO_HOME to the root of your Accumulo installation. 
16/06/17 07:10:08 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6_IBM_20 
16/06/17 07:10:08 ERROR tool.BaseSqoopTool: Error parsing arguments for job: 
16/06/17 07:10:08 ERROR tool.BaseSqoopTool: Unrecognized argument: -D 
16/06/17 07:10:08 ERROR tool.BaseSqoopTool: Unrecognized argument: sqoop.metastore.client.record.password=true 

任何人都可以請幫我這。我需要在CLI中提示輸入密碼來運行一個作業。

+0

配置在sqoop-site.xml中sqoop.metastore.client.autoconnect.username 這些參數sqoop.metastore.client.autoconnect.password – marjun

+0

我不想改變sqoop_site.xml文件。我只想更改一項工作 – Sathyaraj

回答

1

您可以將密碼保存在文件中,並使用參數--password-file指定此文件的路徑。

--password-file 'Set path for a file containing the authentication password' 

Sqoop將讀取該文件中的密碼,並將其傳遞到使用安全的手段,而不在任務配置中暴露密碼MapReduce的集羣。

+0

這正是我們如何解決這個問題。只要存儲的密碼的位置通過權限和組等被鎖定,那麼它是相對安全的。在我們的情況下,我們採取了一個額外的步驟來加密hadoop端的密碼,然後從一個內部調用sqoop命令它可以在將密碼傳遞給sqoop之前解密密碼。 –

+0

./bin/sqoop export --bindir ./ --connect jdbc:mysql:// localhost/DBname --username DB_Username --passoword yourDBpassword --tabletablename --export-dir/hdfspath –