Storing Protected Passwords in Sqoop
Beginning with HDP 2.2, you can store passwords in a keystore. This allows storage of passwords that are not viewable in plain text, but are easily recoverable.
Steps
Store the credential on HDFS.
hadoop credential create mysql.password -provider jceks://hdfs/user/hue/test.jceks
2. Use the credential from the Sqoop command.
sqoop import \ -Dhadoop.security.credential.provider.path=jceks://hdfs/user/hue/test.jceks \ --verbose \ --connect 'jdbc:mysql://sandbox.hortonworks.com/demo' \ --table customer_address \ --username user_name \ --password-alias mysql.password \ --create-hcatalog-table \ --hcatalog-table customer_address \ --hcatalog-storage-stanza "stored as orc" \ -m 1
More Information
Hortonworks Community Connection (HCC) article, Working with .JCEKS files