wrong way in Sqoop 1.4.4 user guide:
sqoop import --connect jdbc:mysql://database.example.com/employees \ --username venkatesh --passwordFile ${user.home}/.password
right way in Sqoop 1.4.5 user guide:
sqoop import --connect jdbc:mysql://database.example.com/employees \ --username venkatesh --password-file ${user.home}/.password
the other flaw is that when you create the password file with "echo" command, make sure you don't append a new line character to the password. Here's a handy script to create a password:
echo -n "password" > .passwordhdfs dfs -put .password /user/$USER/hdfs dfs -chmod 400 /user/$USER/.passwordrm .password
And now when you create a job, you can pass --password-file option and the /user/$USER/.password as the location and it will work.
The fix for flaw #2 I found in this Stack Overflow post.
No comments:
Post a Comment