After finishing hadoop and hbase installation go to apache downloads and remmebr to download sqoop versions from this list
sqoop-1.4.1-incubating__hadoop-0.20.tar.gz
sqoop-1.4.1-incubating__hadoop-0.20.tar.gz
> <http://apache.tradebit.com/ pub/sqoop/1.4.1-incubating/ sqoop-1.4.1-incubating__ hadoop-0.20.tar.gz>
> sqoop-1.4.1-incubating__ hadoop-0.23.tar.gz
> <http://apache.tradebit.com/ pub/sqoop/1.4.1-incubating/ sqoop-1.4.1-incubating__ hadoop-0.23.tar.gz>
> sqoop-1.4.1-incubating__ hadoop-1.0.0.tar.gz
> <http://apache.tradebit.com/ pub/sqoop/1.4.1-incubating/ sqoop-1.4.1-incubating__ hadoop-1.0.0.tar.gz>
You ll get this error if you download it from original source file
> sqoop-1.4.1-incubating__
> <http://apache.tradebit.com/
> sqoop-1.4.1-incubating__
> <http://apache.tradebit.com/
You ll get this error if you download it from original source file
Exception in thread "main" java.lang.
NoClassDefFoundError:
com/cloudera/sqoop/Sqoop
Caused by: java.lang. ClassNotFoundException: com.cloudera.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: com.cloudera.sqoop.Sqoop. Program will exit.
com/cloudera/sqoop/Sqoop
Caused by: java.lang.
at java.net.URLClassLoader$1.run(
at java.security.
at java.net.URLClassLoader.
at java.lang.ClassLoader.
at sun.misc.Launcher$
at java.lang.ClassLoader.
Could not find the main class: com.cloudera.sqoop.Sqoop. Program will exit.
The source tarball (sqoop-1.4.1-incubating-src.tar.gz<http://apache.tradebit. com/pub/sqoop/1.4.1- incubating/sqoop-1.4.1- incubating-src.tar.gz>) doesn't include Sqoop jar file, so you get that error.
Untar the sqoop to /usr/local/sqoop
[root@master ~]# chown hduser /usr/local/sqoop
[root@master ~]# chown hduser /usr/local/sqoop/conf
[root@master ~]# chown hduser /usr/local/sqoop/connector/mssql
[root@master ~]# chown hduser /usr/local/sqoop/conf
[root@master ~]# chown hduser /usr/local/sqoop/connector/mssql
[root@master ~]# chmod 755 /usr/local/sqoop/connector/mssql
download sqoop-sqlserver connector and copy to connectors folder
and run install.sh.Before that you should assign permissions to the folder to install the connector.
Copied hadoop-core-1.0.3.jar in sqoop lib
Copy sqoop-sqlserver-1.0.jar,mysql-connector-java-5.1.21-bin.jar in sqoop lib
Set the environment variables
MSSQL_CONNECTOR_HOME=/usr/local/sqoop/sqoop-sqlserver-1.0/
HADOOP_HOME=/usr/local/hadoop
SQOOP_CONF_DIR=/usr/local/sqoop/conf
SQOOP_HOME=/usr/local/sqoop
HBASE_HOME=/usr/local/hbase-0.92.1/
HADOOP_CLASSPATH=:/usr/local/sqoop/sqoop-1.4.1-incubating.jar
[root@master ~]# chmod 755 /usr/local/sqoop/conf
[root@master ~]# chmod 755 /usr/local/sqoop/
[root@master ~]# chmod 755 /usr/local/sqoop/
download sqoop-sqlserver connector and copy to connectors folder
and run install.sh.Before that you should assign permissions to the folder to install the connector.
Copied hadoop-core-1.0.3.jar in sqoop lib
Copy sqoop-sqlserver-1.0.jar,mysql-connector-java-5.1.21-bin.jar in sqoop lib
Set the environment variables
MSSQL_CONNECTOR_HOME=/usr/local/sqoop/sqoop-sqlserver-1.0/
HADOOP_HOME=/usr/local/hadoop
SQOOP_CONF_DIR=/usr/local/sqoop/conf
SQOOP_HOME=/usr/local/sqoop
HBASE_HOME=/usr/local/hbase-0.92.1/
HADOOP_CLASSPATH=:/usr/local/sqoop/sqoop-1.4.1-incubating.jar
Copy sql jdbc connector (sqljdbc_4.0.2206.100_enu.tar.gz) and extract its two jdbc jars in
$SQOOP_HOME/lib
Now you are ready to execute import and export commands :)
go to the Downloads directory, unzip the tar and copy the jar fil to /usr/bin/sqoop/lib
Copy the jar files in hadoop lib as well otherwise i got some errors of connectivity
- $ cd Downloads (assumes starting from the home directory)
- $ tar -zxvf sqljdbc_4.0.2206.100_enu.tar.gz (Check the version number you downloaded)
- $ sudo cp sqljdbc_4.0/enu/sqljdbc4.jar /usr/lib/sqoop/lib
- $ tar -zxvf sqoop-sqlserver-1.0.tar.gz
- $ sudo mv sqoop-sqlserver-1.0 /usr/local
- $ export MSSQL_CONNECTOR_HOME=/usr/local/sqoop-sqlserver-1.0
- $ sudo chown -R hduser:hadoop /usr/lib/sqoop
- $ sudo chown -R hduser:hadoop /etc/sqoop
- $ cd /usr/local/sqoop-sqlserver-1.0
- $ ./install.sh
Copy the jar files in hadoop lib as well otherwise i got some errors of connectivity
Enjoy sqooping :)
getting below error, please help me :
ReplyDelete"Connection refused. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
My coonection string is :
sqoop-list-databases –connect jdbc:sqlserver://Sql2005/–username abc –password abc
have u disabled iptables...If not please disable them
ReplyDeleteHi All,
ReplyDeleteWill you please send me the query for one hive table to multiple sql server tables in sqoop export?
One hive table to one sql server destination table is working fine. But our requirement is to develop one to many, many to one and many to many relationship is it possible to do it in hadoop?
Please send me the result as soon as possible...