Install Pig on Ubuntu

Install Pig (0.15.0) on Ubuntu (14.04)

To know how to install Hadoop on Ubuntu please visit Hadoop 2.7 installation on Ubuntu 14.04 (Single Node)

Download pig to server:

wget http://apache.mirrorcatalogs.com/pig/pig-0.15.0/pig-0.15.0.tar.gz

Unzip & installation pig:

    tar xvzf pig-0.15.0.tar.gz
    mv pig-0.15.0 pig
    ls
    sudo mv pig /usr/local/
    cd /usr/local/
    sudo chown -R hduser:hadoop pig
    export PATH=/usr/local/pig/bin:$PATH

Pig generates lot of log for itself. If we do not provide log4j properties file then it shows error message, to avoid this we need to add properties file. Pig provides few log4j properties file

hduser@myserver:/usr/local/pig/conf$ ls
log4j.properties.template  pig.properties  test-log4j.properties
hduser@myserver:/usr/local/pig/conf$ cp test-log4j.properties log4j.properties

Need to let pig know about log4j.properties file by updating pig.properties file

Open file by nano command and set log4jconf value

nano /usr/local/pig/conf/pig.properties
log4jconf=./conf/log4j.properties

All are set…..

hduser@myserver:/usr/local$ cd /usr/local/pig/conf/
hduser@myserver:/usr/local/pig/conf$ pig -version
Apache Pig version 0.15.0 (r1682971)
compiled Jun 01 2015, 11:44:35
hduser@myserver:/usr/local/pig/conf$

Leave a Reply

Your email address will not be published. Required fields are marked *