Created 06-07-2016 02:38 PM
Hello,
I am trying to access a VIrtual Database from JBoss Data Virtualization using Sqoop. This database is defined to connect using a Truststore (JKS format), using another application like Squirrel i can connect using the following argument:
-Djavax.net.ssl.trustStore=/home/user/truststore-xxxxx.jks
Does anyone knows how can I use this argument with Sqoop?
Ps.: I already deploy my .jar file on $SQOOP_HOME/lib.
Created 06-07-2016 03:08 PM
Try with below two commands.
export HADOOP_OPTS=" -Djavax.net.ssl.trustStore=/home/user/truststore-xxxxx.jks"
OR
sqoop import -Dmapred.child.java.opts=" -Djavax.net.ssl.trustStore=/home/user/truststore-xxxxx.jks"
Created 06-07-2016 03:08 PM
Try with below two commands.
export HADOOP_OPTS=" -Djavax.net.ssl.trustStore=/home/user/truststore-xxxxx.jks"
OR
sqoop import -Dmapred.child.java.opts=" -Djavax.net.ssl.trustStore=/home/user/truststore-xxxxx.jks"
Created 06-08-2016 01:18 PM
@Washington Nascimento Thanks for confirming. Please accept the answer to close this thread.
Created 06-08-2016 01:13 PM
Hello Jitendra Yadav
The solution was great, the first one (export... HADOOP_OPTS...) worked for me!
Thanks
Created 06-08-2016 06:45 PM
Hello,
Now the problem is the following error:
Error: java.lang.RuntimeException: java.lang.RuntimeException: org.teiid.jdbc.TeiidSQLException: TEIID20020 Error establishing socket to host and port: xxxx.hostname:port. Reason: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:167) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:749) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
We tried to put the enviroment variable on all slave/master nodes like the following commando on /etc/profile ... /etc/bashrc
export HADOOP_OPTS="-Djavax.net.ssl.trustStore=/home/user/truststore.jks"
But unfortunately the error persists.
Thanks
Created 06-09-2016 10:15 AM
So is that the same exception you got initally?
Created on 06-09-2016 12:43 PM - edited 08-19-2019 03:10 AM
Hello,
It worked fine now, the first solution worked connected to the database, but when Sqoop was running Map Reduce, the same error occurred. This way all Map Reduce agents have this configuration.
So the solution is configure the TrustStore parameter on Map Reduce Configuration inside Ambari
The value:
-Djavax.net.ssl.trustStore=/home/user/truststore.jks
Thank you