Installing Pig ( Apache Hadoop Pig)

Apache Pig can be downloaded from http://pig.apache.org

Download the latest release from its website

Unzip the downloaded tar file

Set the environment variables in your system as

export PIG_HOME="/home/hadoop/software/pig-0.9.2"
export PATH=$PATH:$PIG_HOME/bin

Set the place where you downloaded pig and also set its path

If you plan to run Pig on hadoop cluster then one additional variable needs to be set

export PIG_CLASSPATH="/home/hadoop/software/hadoop-1.0.1/conf"

It tells about the place where to look for hdfs-site.xml and other configuration files for hadoop

Restart your computer

Thats it , now lets test the installation

On the command prompt

type

# pig -h

it shoud show the help related to Pig , and its various commands.

Done :) ,

Next you can read about

How to run your first Pig script in local mode

Or about various Pig running modes

4 comments:

  1. O yaar Jugnu, I am a novice Pig Learner, Sara internet chaan maara, was trying since two days to set Pig environment variables, but it was very difficult to get any help. But you explained it very clearly and concisely. Thank you very much. Buhhat Buhhat Shukriya.

    Ahmed

    ReplyDelete
    Replies
    1. Ahmed bhai , mazza a gaya to read your comment :) thanks please let me know if you need any help.

      Delete

Please share your views and comments below.

Thank You.