Powered By Blogger

Sunday, November 3, 2019

sqoop with jceks

We can use the encryption to send the password
Java cryptograpghy keystore

We are creating alias

hadoop credential create mysql.banking.password \
-provider jceks://hdfs/user/training/mysql.banking.password.jceks

hadoop fs -cat /user/training/mysql.banking.password.jceks

hadoop credential create \
-provider jceks://




[cloudera@quickstart Downloads]$ hadoop credential create mysql.banking.password \
> -provider jceks://hdfs/user/training/mysql.banking.password.jceks
WARNING: You have accepted the use of the default provider password
by not configuring a password in one of the two following locations:
    * In the environment variable HADOOP_CREDSTORE_PASSWORD
    * In a file referred to by the configuration entry
      hadoop.security.credstore.java-keystore-provider.password-file.
Please review the documentation regarding provider passwords in
the keystore passwords section of the Credential Provider API
Continuing with the default provider password.

Enter alias password:
Enter alias password again:
mysql.banking.password has been successfully created.
Provider jceks://hdfs/user/training/mysql.banking.password.jceks has been updated.
[cloudera@quickstart Downloads]$


hadoop fs -cat /user/training/mysql.banking.password.jceks

[cloudera@quickstart Downloads]$ hadoop fs -cat /user/training/mysql.banking.password.jceks
���� mysql.banking.password n1*�T��sr3com.sun.crypto.provider.SealedObjectForKeyProtector�W�Y�0�S xr javax.crypto.SealSqa�TP�C uq~��" 1��`% �aC�^�Јy f��ӑ�$�O�S�E>M,"�y�U�汄& ^�eA_�����x� y挼��/j7 �N����)� �#&\� + ��I�,� ] ͼ��`��.�� k@� 7�-2<�
      kQ{b# ��t PBEWithMD5AndTripleDESt PBEWithMD5AndTripleDES�~� މO�B���io�)�iC�[cloudera@quickstart Downloads]$


sqoop eval \
-Dhadoop.security.credential.provider.path=jceks://hdfs/user/training/mysql.banking.password.jceks \
--connect jdbc:mysql://quickstart.cloudera:3306/banking \
--username root \
--password-alias mysql.banking.password \
--query "select count(1) from member_details"





[cloudera@quickstart Downloads]$ sqoop eval \
> -Dhadoop.security.credential.provider.path=jceks://hdfs/user/training/mysql.banking.password.jceks \
> --connect jdbc:mysql://quickstart.cloudera:3306/banking \
> --username root \
> --password-alias mysql.banking.password \
> --query "select count(1) from member_details"
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
19/11/03 04:15:23 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0
19/11/03 04:15:25 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
------------------------
| count(1)             |
------------------------
| 999                  |
------------------------
[cloudera@quickstart Downloads]$

No comments:

Post a Comment