Data Movement and Integration
Also available as:
PDF
loading table of contents...

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

  1. Store the credential on HDFS.

    hadoop credential create mysql.password -provider jceks://hdfs/user/hue/test.jceks
  2. 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

Apache Commands Manual