Database Reference
In-Depth Information
offered a series of Pig versions. Choose 0.12.1, and download the version of the release file that is tarred and gzipped.
For example, I used wget to download the release to the server hc1nn, which was convenient because I could
download the package straight to a server directory using the website URL:
[hadoop@hc1nn ~]$ wget http://www.carfab.com/apachesoftware/pig/pig-0.12.1/pig-0.12.1.tar.gz
Next, you unzip the release using the Linux command gunzip , and unpack the tar file using the Linux tar -xvf
command:
[hadoop@hc1nn ~]$ ls -l pig-0.12.1.tar.gz
-rw-rw-r--. 1 hadoop hadoop 59445085 Apr 5 21:44 pig-0.12.1.tar.gz
[hadoop@hc1nn ~]$ gunzip pig-0.12.1.tar.gz
[hadoop@hc1nn ~]$ tar xvf pig-0.12.1.tar
[root@hc1nn hadoop]# ls -ld pig-0.12.1
drwxr-xr-x. 15 hadoop hadoop 4096 Apr 5 21:44 pig-0.12.1
You move the release to a location under /usr/local/ using the Linux mv command, then set up a symbolic link
under /usr/local/ called pig by using the Linux ln command with a -s (symbolic) switch to simplify the path to the
software and the environment. Finally, you use the Linux ls command to create a long listing that displays the link
and the install the Pig directory.
[root@hc1nn hadoop]# mv pig-0.12.1 /usr/local
[root@hc1nn hadoop]# cd /usr/local/
[root@hc1nn hadoop]# ln -s pig-0.12.1 pig
[root@hc1nn local]# ls -ld pig*
lrwxrwxrwx. 1 root root 10 Jun 18 12:02 pig -> pig-0.12.1
drwxr-xr-x. 15 hadoop hadoop 4096 Apr 5 21:44 pig-0.12.1
To simplify access to and use of Pig, you can add some Pig-related variables to the Linux hadoop user's Bash shell
configuration at the bottom of the file $HOME/.bashrc:
#######################################################
# Set up Pig variables
export PIG_HOME=/usr/local/pig
export PATH=$PATH:$PIG_HOME/bin
Once the installation is in place and the environment is set up, you can test that the Pig binary is available and
will run. For example, you can use the Linux type command to check that the Pig Linux command is picked up from
the correct location:
[hadoop@hc1nn ~]$ type pig
pig is hashed (/usr/local/pig/bin/pig)
Search WWH ::




Custom Search