Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

avatar
New Member

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

avatar
New Member

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

avatar
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

avatar
New Member

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