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

Sqoop import error. JDBC driver.

Sqoop import error. JDBC driver.

New Contributor

Hello,

I cannot resolve issue with Sqoop import during last three days.

I use: Cloudera Ent.trial 5.16.2 with Java 1.7.0

Cluster: 1 master, 2 datanode. OS - CentOs7. Java version "1.7.0_261".
MySQL created DB Corp with table pet. User 'skottking' has been granted all permissions on DB with table.

JDBC connector copied in /var/lib/sqoop/: mysql-connector-java-5.1.49-bin.jar

permissions on sqoop/ sqoop:sqoop drwxr-xr-x

command:

1. su - root

2. sqoop import --connect jdbc:mysql://127.0.0.1:3306/Corp --table pet --username skottking -P -m 1;

3. HUE -> File Browser -> user/skottking i see the command creates empty folder 'pet' and after that nothing happened

ERROR:

==========================================

20/08/06 12:07:47 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-skottking/compile/c5e621d7875703cd93cdbeb934d61a6d/pet.jar

20/08/06 12:07:47 WARN manager.MySQLManager: It looks like you are importing from mysql.
20/08/06 12:07:47 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
20/08/06 12:07:47 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
20/08/06 12:07:47 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
20/08/06 12:07:47 INFO mapreduce.ImportJobBase: Beginning import of pet

==========================================

20/08/06 12:07:52 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1596697363400_0004
20/08/06 12:07:52 INFO impl.YarnClientImpl: Submitted application application_1596697363400_0004
20/08/06 12:07:52 INFO mapreduce.Job: The url to track the job: http://srv-cm5master01.local:8088/proxy/application_1596697363400_0004/
20/08/06 12:07:52 INFO mapreduce.Job: Running job: job_1596697363400_0004
20/08/06 12:08:32 INFO mapreduce.Job: Job job_1596697363400_0004 running in uber mode : false
20/08/06 12:08:32 INFO mapreduce.Job: map 0% reduce 0%
20/08/06 12:08:48 INFO mapreduce.Job: Task Id : attempt_1596697363400_0004_m_000000_0, Status : FAILED
Error: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

======================================================

Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:223)
at org.apache.sqoop.mapreduce.db.DBInputFormat.setDbConf(DBInputFormat.java:168)
... 10 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

=================================================================

20/08/06 12:09:04 INFO mapreduce.Job: map 100% reduce 0%
20/08/06 12:09:05 INFO mapreduce.Job: Job job_1596697363400_0004 failed with state FAILED due to: Task failed task_1596697363400_0004_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0

20/08/06 12:09:05 INFO mapreduce.ImportJobBase: Retrieved 0 records.
20/08/06 12:09:05 ERROR tool.ImportTool: Import failed: Import job failed!

==============================================

Have no idea how to resolve the issue. Tried a lot of advises from Google - nothing helped. Created diff tables, used different users with diff privileges - same result. I see only empty folder in hdsf or Hue with name of table.

 

 

 

 

 

2 REPLIES 2
Highlighted

Re: Sqoop import error. JDBC driver.

New Contributor

Just now i have done a short investigation about JDBC connector and I understand nothing

 

mysql-connector-java-5.1.30-bin.jar - generated next error:

====================================================
20/08/06 16:08:12 ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

=============================================

mysql-connector-java-5.1.49-bin.jar

==============================================
Error: java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

=====================================================

mysql-connector-java-6.0.6-bin.jar

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0

==================================================

mysql-connector-java-5.1.22-bin.jar

============================================
20/08/06 16:15:03 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

======================================================

It is not clear for me how should I connect to MySQL? and why I may use only connector with name '*-bin.jar'? Without  bin system always generated error: Unsupported major.minor version 52.0

Highlighted

Re: Sqoop import error. JDBC driver.

New Contributor

Strange... I am getting crazy. Just now reinstall MySQL from version 8.0.20 to version 5.6, as recommended Cloudera from Manual for installation Cloudera 5.16. The result is completely same, if driver .jar (doesn't matter version) - Unsupported major.minor version 52.0, if 5.1.49-bin.jar - Communications link failure

 

May be somebody provided own configuration for installation and version of JDBC driver?

 

I have no idea - what should be done and where must I see: Cloudera or OS CenOS or versions of the Applications? I expect some thing wrong with installation  -  but I followed the procedure from Cloudera.