Tuesday, July 2, 2013

Resolved Issue / Error in sqoop 1.4

I've posted some issue in sqoop2  here.

I had a good time when working with sqoop 1.4 connecting to PostgreSQL  database. I have faced few issues & managed to overcome those issues.

ERROR 1)
....
....
sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: 
Could not load db driver class: com.mysql.jdbc.Driver
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver 

SOLUTION
download & put MySQL connector to the $SQOOP_HOME/lib dir.


$SQOOP_HOME/lib               

ERROR 2)
....
....
sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
.....
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
.....
Caused by: java.net.ConnectException: Connection refused
SOLUTION
check the status of the MySQL up & running.ensure user has rights to access the database.for more find here.

step 1)  verify that you can connect to the database from the node where you are running Sqoop:


root@boss[~]#mysql --host=localhost --database=test --user=root --password=root
step 2) Grant permissions to the user to access the database

root@boss[~]#mysql --host=localhost --user=root --password=root
mysql>grant all privileges on test.* to 'sqoopuser'@'%' identified by 'sqooppassword'

ERROR 3)
....
....
orm.ClassWriter: No parser available for Java type org.apache.hadoop.io.BytesWritable
SOLUTION
  in postgresql/oracle , column with data type bytea/binary or varbinary  contains null value means through above error.
update the "bytea/binary or varbinary" column with not-null value.              

ERROR 4)
....
....
INFO ipc.Client: Retrying connect to server: /127.0.0.1:8021. Already tried 0 time(s).   
 ERROR tool.ImportTool: Encountered IOException running import job: java.net.ConnectException: 
 Call to /127.0.0.1:8021 failed on connection exception: java.net.ConnectException: Connection refused
 ERROR 5)
....
....
ERROR tool.ImportTool: Encountered IOException running import job: 
java.io.IOException: Call to /127.0.0.1:8021 failed on local exception: 
java.io.IOException: Connection reset by peer
 SOLUTION (4,5)
check the status of hadoop process
root@boss[~]#jps  
20668 JobTracker
20434 DataNode
20299 NameNode
20569 SecondaryNameNode
20799 TaskTracker20844 Jps
ensure all the 5 process are running successfully. to avoid the error 5) JobTracker must be up & running.


ERROR 6)
....
....
localhost: ssh: Could not resolve hostname localhost: Name or service not known

ERROR 7)
....
....
ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.net.ConnectException:
 Call to localhost/127.0.0.1:9000 failed on connection exception: 
java.net.ConnectException: Connection refused
SOLUTION (6,7)
I've faced said error while running hbase, to resolve the error, open & edit  /etc/hosts

ip/domain
127.0.0.1    localhost.localdomain
127.0.0.1    boss
127.0.0.1    hbase-master:q
 to resolve the error 7)
127.0.0.1    hbase-master:q
must be added in file /etc/hosts

I've connected PostgreSQL database using sqoop, tried out store the data across HDFS and analysis using hbase. 


No comments: