Support Questions
Find answers, ask questions, and share your expertise

How to use sqoop password-alias together with sqoop option file ?

I'm able to use credential provider to encrypt password. Also be able to use it with sqoop command. But I can't work it out if I want to put connection string in option files. Anybody can give me some clue ?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you @Sonu Sahi for the response. I checked your colleague's blog. He is using password file but not the password alias (credential provider) which is saving password in keystore instead of file.

Any way I finally figure out how to make it work. In case some one else need this in the future, I paste my solution here:

The option file:

import

-connect

"jdbc:sqlserver://host:1433;database=DB1"

Script for Sqoop job defination:

sqoop job -Dhadoop.security.credential.provider.path=jceks://hdfs/user/root/mysql.password.jceks --create sqoop_test -- options-file db.props --username sqoop_ro --password-alias sqoop_ro.passwd --target-dir /XXX --query 'select ....'

This works for me.

Thanks

View solution in original post

2 REPLIES 2

Guru

Hu @Lucy zhang

My colleague has a nice blog post showing to do this in sqoop here: http://blog.ervits.com/2015/03/running-saved-sqoop-144-jobs-with.html

Thank you @Sonu Sahi for the response. I checked your colleague's blog. He is using password file but not the password alias (credential provider) which is saving password in keystore instead of file.

Any way I finally figure out how to make it work. In case some one else need this in the future, I paste my solution here:

The option file:

import

-connect

"jdbc:sqlserver://host:1433;database=DB1"

Script for Sqoop job defination:

sqoop job -Dhadoop.security.credential.provider.path=jceks://hdfs/user/root/mysql.password.jceks --create sqoop_test -- options-file db.props --username sqoop_ro --password-alias sqoop_ro.passwd --target-dir /XXX --query 'select ....'

This works for me.

Thanks

View solution in original post