- wget http://www.linuxtourist.com/apache/pig/stable/pig-x.y.z.tar.gz
- cd /home/hadoopuser/app/
- mv ~/Download/pig-x.y.z.tar.gz ./
- tar -xvf pig-x.y.z.tar.gz
- ln -s /home/hadoopuser/app/pig-x.y.z /pig
- Edit ~/.bash_profile to add PIG_HOME and add its bin into PATH.
#java home export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_17-sun #hadoop home export HADOOP_HOME=/hadoop #hive home export HIVE_HOME=/hive #pig home export PIG_HOME=/pig PATH=$PATH:$HOME/bin:$HIVE_HOME/bin:$PIG_HOME/bin export PATH
-
Run the pig command and check if it works.
2013-01-04 03:14:30,310 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://cent63VM01:9000 2013-01-04 03:14:30,586 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: cent63VM01:9001 grunt>
-
Create a directory on HDFS
[hadoopuser@cent63VM01 pigTest]$ /hadoop/bin/hadoop fs -mkdir pig
-
Upload file on HDFS
[hadoopuser@cent63VM01 pigTest]$ /hadoop/bin/hadoop fs -put /home/hadoopuser/pigTest/passwd /user/hadoopuser/pig
-
Run a extremely simple Pig example.
grunt> A = load '/user/hadoopuser/pig/passwd' using PigStorage(':'); grunt> B = foreach A generate $0 as id; grunt> dump B;
Wednesday, April 18, 2012
Steps to setup Hadoop Pig on Hadoop cluster environment
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment