Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Encountered IOException running import job

Highlighted

Encountered IOException running import job

Explorer

I am trying to execute this command line

$sqoop import --connect jdbc:mysql://hadoop:3306/Testdb --table widgets -m 4 --username root --password mypwd --driver com.mysql.jdbc.Driver

but i am getting this error:

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/2.6.0.3-8/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/2.6.0.3-8/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 18/03/09 01:15:55 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.6.0.3-8 18/03/09 01:15:55 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 18/03/09 01:15:55 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time. 18/03/09 01:15:55 INFO manager.SqlManager: Using default fetchSize of 1000 18/03/09 01:15:55 INFO tool.CodeGenTool: Beginning code generation 18/03/09 01:15:55 ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

3 REPLIES 3
Highlighted

Re: Encountered IOException running import job

Super Mentor
@Aymen Rahal

We see the error as :

ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

This error indicates either the DB url is not correct or the MySQL DB is not running healthy.

Can you please check if you are able to see the port 3306 is listening and are you able to connect to MySQL using command line?

# netstat -tnlpa | grep 3306
# less /var/log/mysql/mysql.log

.

.

Highlighted

Re: Encountered IOException running import job

Super Mentor

@Aymen Rahal

If you are running MySQL locally on the same host then for testing you might want to try the following kind of format for your sqoop command:

# sqoop  import --connect jdbc:mysql://localhost:3306/hive --username root --password yourPWD --table SEQUENCE_TABLE  --hive-database default --hive-table hive_sequence_table --hive-import -m 1 --target-dir /apps/hive/warehouse/hive_sequence_db.db/hive_sequence_table  --driver com.mysql.jdbc.Drive

.

Re: Encountered IOException running import job

Explorer

root@hadoop:/home/kali# netstat -tnlpa | grep 3306

tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 978/mysqld

root@hadoop:/home/kali# less /var/log/mysql/mysql.lo

/var/log/mysql/mysql.lo: No such file or directory

Don't have an account?
Coming from Hortonworks? Activate your account here