This is a short memo to install Hadoop and sqoop (Hadoop interface with db backend) in Ubuntu Lucid.

First it is necessary to add the following debian repository from Cloudera, the host of Hadoop and sqoop.
This can be added from System -> Update manager -> Settings (bottom-left) -> Other sources (tab) -> add.
deb http://archive.cloudera.com/debian -cdh3 contrib
On Lucid, has to be replaced by lucid, giving:
deb http://archive.cloudera.com/debian -cdh3 contrib

A Java environment is necessary, you should have at least default-jdk 1.6.
Then install the software itself:
sudo apt-get install hadoop
sudo apt-get install sqoop
sudo apt-get install hadoop-hbase

Once trying to launch sqoop on certain tables through PostgreSQL, you may find the following error:
sqoop import --table test --connect jdbc:postgresql://localhost/postgres --verbose
...
ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: org.postgresql.Driver

This means that JDBC driver of PostgreSQL is not installed correctly.
You have to download it from here.
Then copy it in /usr/lib/sqoop/.

More details about the installation can be found here.

Sometimes you have to face some formats that are not installed by default in Ubuntu environments.
And it may be a problem if you cannot extract such archives.

Fortunately, there are some free applications provided with your distribution.
If you are not using Ubuntu, you can find debian or rpm packages easily.
In order to do that, there is this useful RPM package searcher
or this Debian package searcher.

For Ubuntu, which is well… Debian based… (But it uses an APT system to manage its distribution packages)
Here is how to install those packages with commands (geek-mode).
To install rar format manager:
sudo apt-get install unrar-free
To install 7z format manager:
sudo apt-get install p7zip

Or for beginners you can find the packages in the software package center.
For that you have just to make a research with p7zip and unrar-free for each application in the Ubuntu Software Center in the Application tab of your menu bar.

To decompress a file with p7zip, you have to do the following command:
7z x $FILE_NAME
$FILE_NAME being the name of your 7z file.

To decompress a file with unrar-free, you have to do the following command:
unrar-free x $FILE_NAME
$FILE_NAME being the name of your rar file.

©2010-2013 Michael Paquier All content is ©Copyright of Otacoo.com 2010-2013. Privacy Policy - Terms of Use