Wednesday, May 13, 2015

Installation of Pig

Download Pig from  Here
Go to the downloaded directory.

$ cd Downloads


Untar the  zip file with below command or do right click and extract here

$ tar -xvzf pig-0.14.0.tar.gz



Move extracted pig to created directory you want to install Pig. In my case it is /usr/local/pig


$ sudo mv pig-0.15.0 /usr/local/pig



Set path for PIG_HOME in .bashrc file 

 $ vim.tiny ~/.bashrc



Append below lines at the end of the file


export PIG_HOME=/usr/local/pig/pig-0.14.0
export PATH=$PATH:$PIG_HOME/bin 


Restart Terminal

$ pig

And We are Done!!



By default Pig creates logs in the current directory. If we want those to be crated in a specific directory we will create it and set the property in $PIG_HOME/conf/pig.properties

Create directory for logs wherever you wish. I created in  $PIG_HOME

$ mkdir /usr/local/pig/logs

go to conf directory in $PIG_HOME


$ cd /usr/local/pig/conf/

Open pig.properties and set the path

$ sudo vim.tiny pig.properties 

set the property to pig.logfile and uncomment it.

pig.logfile=/usr/local/pig/logs





No comments:

Post a Comment