Saturday, 2 June 2018

Sqoop 1.4.4 Installation & Configuration



Apache Sqoop is a tool designed for efficiently transferring bulk data between Apache Hadoop and relational databases. Sqoop is used to import data from RDBMS to Hadoop Distributed File System or  Hadoop eco-systems like Hive and HBase. Similarly, Sqoop can also be used to extract data from Hadoop to relational databases like oracle, Mysql etc.

Prerequisite:

  • Hadoop
  • MySql Database 

Download Sqoop 1.4.4 using below command on /usr/local directory.

$sudo wget http://archive.apache.org/dist/sqoop/1.4.4/

sqoop-1.4.4.bin__hadoop-2.0.4-alpha.tar.gz /usr/local
Unpack sqoop-1.4.4.bin__hadoop-2.0.4-alpha.tar.gz file
$ cd /usr/local

$ sudo tar -xvf sqoop-1.4.4.bin__hadoop-2.0.4-alpha.tar.gz
Rename sqoop-1.4.4.bin__hadoop-2.0.4-alpha to sqoop
$ sudo mv sqoop-1.4.4.bin__hadoop-2.0.4-alpha sqoop

Setting up environment for Sqoop

Edit ~/.bashrc file for set up the Pig environment by appending the following lines.
$ sudo nano ~/.bashrc 

export SQOOP_HOME=/usr/local/sqoop

export PATH=$SQOOP_HOME/bin:$PATH
Reload the configuration file ~/.bashrc with the following command.
# source ~/.bashrc
Sqoop can be connected to various types of databases. It uses JDBC to connect to them. JDBC driver for each of databases is needed by sqoop to connect to them. In this setup we are handling with MySQL connector to connect MySQL DB.
Download below jar files in /usr/local/sqoop path
mysql-connector-java-5.1.25.jar

sqljdbc4.jar
Copy above jar files from /usr/local/sqoop to /usr/local/sqoop/lib/ folder
$sudo cp /usr/local/sqoop/mysql-connector-java-5.1.28.jar /usr/local/sqoop/lib/

$sudo cp /usr/local/sqoop/sqljdbc4.jar /usr/local/sqoop/lib/
Change the ownership and permissions of the directory /usr/local/sqoop
$ sudo chown -R hdfs:hdfs /usr/local/sqoop

$ sudo chmod -R 755 /usr/local/sqoop
Check the version of sqoop.
$ sqoop version

Sqoop 1.4.4

git commit id 050a2015514533bc25f3134a33401470ee9353ad

Compiled by vasanthkumar on Mon Jul 22 20:06:06 IST 2013

Share:

Tuesday, 15 May 2018

Pig 0.14 Installation & Configuration

Apache Pig is a platform which is used to analyze larger sets of data representing them as data flows. Apache Pig is a high-level platform for creating programs that run on Apache Hadoop. Pig's language layer currently consists of a textual language called Pig Latin.





Prerequisites

Java
Hadoop

Download Pig Jar file

Download Pig 0.14 using below command on /usr/local directory.
$sudo wget http://archive.apache.org/dist/pig/pig-0.14.0/pig-0.14.0.tar.gz /usr/local
Unpack pig-0.14.0.tar.gz file
$ cd /usr/local
$ sudo tar -xvf pig-0.14.0.tar.gz
Rename pig-0.14.0 folder to pig
$ sudo mv pig-0.14.0 pig

Setting up environment for Pig

Edit ~/.bashrc file for set up the Hive environment by appending the following lines
$ sudo nano ~/.bashrc 

export PIG_HOME=/usr/local/pig
export PATH=$PIG_HOME/bin:$PATH
Reload the configuration file ~/.bashrc with the following command.
$ source ~/.bashrc
Change the ownership and permissions of the folger /usr/local/pig
$ sudo chown -R hdfs:hdfs /usr/local/pig
$ sudo chmod -R 755 /usr/local/pig

Check the version

Check the version of pig.
$ pig --version
Apache Pig version 0.14.0 (r1640057)
compiled Nov 16 2014, 18:02:05

Apache Pig Execution Modes

You can run Apache Pig in two modes, namely, Local Mode and MapReduce Mode.
Local Mode
$ pig -x local
Grunt>
MapReduce Mode
$ pig -x mapreduce
Grunt>
Share:

Sunday, 29 April 2018

Java Installation & Configuration

Java is a widely used programming language expressly designed for use in the distributed environment of the internet. Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network.








Downloading Oracle Java JDK

Download Java (JDK) source tarball files for your system architecture by going to official (http://www.oracle.com/technetwork/java/javase/downloads) page and kept on path/opt/ directory.

JDK: Java Development Kit. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications.

Server JRE: Java Runtime Environment. For deploying Java applications on servers. Includes tools for JVM monitoring and tools commonly required for server applications.

In this tutorial we will be installing the JDK Java SE Development Kit 8 x64 bits. Accept the license and copy the download link into your clipboard. Remember to choose the right tar.gz (64 or 32 bits).

jdk-8u131-linux-i586.tar.gz   [For 32-bit System]
jdk-8u131-linux-x64.tar.gz    [For 64-bit System]
Note: Always get the latest version from Oracle's website

Installing Java

Unpack the compressed jdk (/opt/jdk-8u131-linux-x64.tar.gz) file by using this command

# cd /opt
# tar –xvzf jdk-8u131-linux-x64.tar.gz

Rename jdk-8u131 directory to jdk in /opt directory by using give command
# mv jdk-8u131 /opt/jdk

Setting up Java Environment Variables

First we need to set environment variable for java. Edit ~/.bashrc file
# nano ~/.bashrc
Append following values at end of file and save the file.
export JAVA_HOME=/opt/jdk
export PATH=$JAVA_HOME/bin:$PATH
Reload the configuration file ~/.bashrc with the following command.
# source ~/.bashrc

Verify the Java version

# java -version

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b13, mixed mode)
Share:

Total Pageviews

Lables

Powered by Blogger.

Followers