Struck-up with Sqoop 1.4.3 installation

2,123 views
Skip to first unread message

Pari Margu

unread,
Mar 12, 2013, 8:53:54 AM3/12/13
to chenn...@googlegroups.com
Hi Friends, I am trying to install Sqoop 1.4.3,

First, I have downloaded the file: sqoop-1.4.3.tar.gz from http://www.apache.org/dist/sqoop/1.4.3/sqoop-1.4.3.tar.gz

Extracted to my local folder: myFolder/sqoop-1.4.3

I have set the HADOOP_HOME, HBASE_HOME path

When I trying to run the following command, getting error message as below, I appreciate if somebody provide the solution

ubuntu@ubuntu:~/myFolder/sqoop-1.4.3$ bin/sqoop
Warning: $HADOOP_HOME is deprecated.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/sqoop/Sqoop
Caused by: java.lang.ClassNotFoundException: org.apache.sqoop.Sqoop
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.sqoop.Sqoop.  Program will exit.

Subrata Biswas

unread,
Mar 12, 2013, 10:16:18 AM3/12/13
to chenn...@googlegroups.com

Set the classpath to mention your sqoop jar file location. It will resolve the issue.

--
You received this message because you are subscribed to the Google Groups "Hadoop User Group (HUG) Chennai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chennaihug+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pari Margu

unread,
Mar 12, 2013, 10:43:29 AM3/12/13
to chenn...@googlegroups.com
Thank you subu ...

The file "sqoop-1.4.3.tar.gz" which i downloaded does not contain any sqoop jar. Now i have downloaded the file: sqoop-1.4.3.bin__hadoop-1.0.0.tar.gz and set the sqoop jar as mentioned, it is working.

Thanks a lot ... 

Sivakumar Rajasundaram

unread,
Mar 12, 2013, 10:51:25 AM3/12/13
to chenn...@googlegroups.com
Check whether the user has execution permission... (bin directory)
--
With Regards,
Sivakumar.R
+91 9048360190

Pari Margu

unread,
Mar 14, 2013, 2:09:55 AM3/14/13
to chenn...@googlegroups.com
Hi Siva,
                    to my knowledge, this file "sqoop-1.4.3.tar.gz" does not contain sqoop jar ... sqoop jars are available in this file "sqoop-1.4.3.bin__hadoop-1.0.0.tar.gz"

Thanks ...

Pari.M

Thazhuva Kuzhandhai

unread,
Mar 14, 2013, 9:19:43 AM3/14/13
to chenn...@googlegroups.com
Hi,
 
I Did the following simple steps to work with Sqoop, just try if it works for you or not..
-- Download sqoop-1.4.3.bin__hadoop-1.0.0-alpha.tar.gz From http://www.apache.org/dist/sqoop/1.4.3/
 
-- Decompress the tarball
  
 tar -xvf sqoop-1.4.3.bin__hadoop-1.0.0.tar.gz
 
-- change directory to user/sqoop-1.4.3.bin__hadoop-1.0.0
 
 cd user/sqoop-1.4.3.bin__hadoop-1.0.0
 
-- To Check its installation,
 
 >bin/sqoop help
 
 It will return the Available commands

Thats It..!!!
 
Thanks,
 
Thazhuvaa.

Regards,

Thazhuva Kuzhandhai K

Thazhuva Kuzhandhai

unread,
Mar 14, 2013, 9:28:40 AM3/14/13
to chenn...@googlegroups.com
Hi, Pari,
 
***correction to the previous reply**
 
Download sqoop-1.4.3.bin__hadoop-1.0.0.tar.gz , not the alpha one.:(
 
and set your Hadoop and Java path if your sqoop directory and Hadoop directory are diffrent.
 
It Worked for me..

Pari Margu

unread,
Mar 14, 2013, 3:46:36 PM3/14/13
to chenn...@googlegroups.com
Hi Thazhuva kuzhandhai,

I have done the same and it worked for me also. Thanks a lot.

Thanks & Regards,

Pari.M

Nagarajan B

unread,
Mar 23, 2013, 12:17:03 PM3/23/13
to chenn...@googlegroups.com
Thank you all... I have installed Sqoop. I also installed mysql in ubuntu, and created a database called ranjith and table as ran.

I am using the below sqoop import command 
 bin/sqoop import -connect jdbc:mysql://localhost/ranjith --table ran -m 1


When i executed it, i got an error as 

ranjith@ranjith-System-Product-Name:~/sqoop-1.4.3$ bin/sqoop import -connect jdbc:mysql://localhost/ranjith --table ran -m 1
Warning: $HADOOP_HOME is deprecated.

13/03/23 21:43:55 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
13/03/23 21:43:55 INFO tool.CodeGenTool: Beginning code generation
13/03/23 21:43:55 ERROR 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
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:716)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:605)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:628)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:235)
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:219)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:283)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1255)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1072)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
ranjith@ranjith-System-Product-Name:~/sqoop-1.4.3$ 



The possible work around i tried was, i downloaded the  below jar and placed in the lib folder of sqoop, but still i get the same error...Kindly help me with this. 
mysql-connector-java-5.1.23.tar.gz

 mysql jar can be downloaded at this link... 


Thanks
nagu.

Subrata Biswas

unread,
Mar 24, 2013, 3:21:55 AM3/24/13
to chenn...@googlegroups.com

Error clearly tels mysql jdbc driver could not load. Please check if you driver jar file present in class path. You may need to download driver separately and set d classpatj.

--

Venkat Ankam

unread,
Mar 24, 2013, 8:54:28 AM3/24/13
to chenn...@googlegroups.com
I hope you extracted the jar file from the mysql tar and then copied the .jar file to LIB directory.  If not please do the same and it will resolve the issue.  

Regards,
Venkat


--

Biju Sasidharan

unread,
Mar 24, 2013, 12:00:53 PM3/24/13
to chenn...@googlegroups.com
Has this got something to do with mysql credentials that you have to provide along with the --connect statement? I mean giving username and password which you would have created while installing mysql.

bin/sqoop import -connect jdbc:mysql://localhost/ranjith --username <default username is root> --password <your mysql password> --table ran -m 1

Thanks,
Biju

Subrata Biswas

unread,
Mar 24, 2013, 12:10:25 PM3/24/13
to chenn...@googlegroups.com

Just wanted to mention default root only allow access from localhost not from other host. If you trying to access MySql from same system where ur db installed it is fine else you need to provide acccess permission for the host ffrom where you r trying to access MySql.

Pari Margu

unread,
Mar 24, 2013, 12:55:18 PM3/24/13
to chenn...@googlegroups.com
Hi Nagu,
                     Myself used the same mysql connector(mysql-connector-java-5.1.23-bin.jar), I have placed this jar file in sqoop root directory itself where the sqoop jar exists(i.e /home/ubuntu/Pari/sqoop-1.4.3.bin__hadoop-1.0.0). 

I have set following 3 environment variable before running the sqoop import command,

export HADOOP_HOME=/home/ubuntu/Pari/hadoop-1.0.4

export HBASE_HOME=/home/ubuntu/Pari/hbase-0.94.5

export SQOOP_HOME=/home/ubuntu/Pari/sqoop-1.4.3.bin__hadoop-1.0.0

Then run your sqoop command, i.e

bin/sqoop import -connect jdbc:mysql://localhost:3306/apm -username hadoop -password hadoop --table sqoop_demo --target-dir /sqoopTohdfs/sqoop_demo  -m 1

My table name in mysql is sqoop_demo which I am trying to move it to HDFS.

I hope you got the solution. Let me know if you need any other information which I can provide.

Thanks & Regards,

Pari.M

Senthil Kumar

unread,
Mar 25, 2013, 2:39:49 AM3/25/13
to chenn...@googlegroups.com
Hi All..

Nagu's issue has been solved. 
Thanks for all your inputs.

Its gud to see our community becoming vibrant.

Thanks a Lot Guys.

Thanks
Senthil

Nagarajan B

unread,
Mar 25, 2013, 8:28:42 PM3/25/13
to chenn...@googlegroups.com
Thank you alll... My issue is resolved... 

Mistake i did: I have pointed SQOOP_HOME to some other path where my my_sql connector jar was not there.... 


Thanks
Nagu.
Reply all
Reply to author
Forward
0 new messages