本文记录Hadoop集群环境安装Pig。
环境:OS:Centos 6.5 x64 & Soft:Hadoop 1.2.1 & Pig 0.12
1、简介
下载二进制安装包pig-0.12.0.tar.gz,上传到服务器。
2、安装
用集群环境普通用户安装,解压安装包。
[huser@master hadoop]$ tar -xvf pig-0.12.0.tar.gz
3、配置环境变量
[huser@master ~]$ vi /etc/profile export JAVA_HOME=/usr/java/jdk1.7.0_51 export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar export JRE_HOME=$JAVA_HOME/jre export HADOOP_HOME=/home/huser/hadoop/hadoop-1.2.1 export HADOOP_CONF_DIR=/home/huser/hadoop/hadoop-1.2.1/conf export HADOOP_CLASSPATH=/home/huser/hadoop/hadoop-1.2.1/bin export MAHOUT_HOME=/home/huser/hadoop/mahout-distribution-0.9 export MAHOUT_HOME_DIR=/home/huser/hadoop/mahout-distribution-0.9/conf export PIG_HOME=/home/huser/hadoop/pig-0.12.0 export PIG_CLASSPATH=/home/huser/hadoop/pig-0.12.0/conf export PATH=$PATH:$JAVA_HOME/bin:$PIG_HOME/bin:$PIG_HOME/conf:$MAHOUT_HOME/bin:$MAHOUT_HOME/conf
[root@master huser]# source /etc/profile
4、测试
[huser@master hadoop]$ pig which: no hadoop in (/usr/lib64/qt-3.3/bin:/usr/java/jdk1.7.0_51/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/huser/bin:/usr/java/jdk1.7.0_51/bin:/home/huser/hadoop/mahout-distribution-0.9/bin:/home/huser/hadoop/mahout-distribution-0.9/conf:/usr/java/jdk1.7.0_51/bin:/home/huser/hadoop/pig-0.12.0/bin:/home/huser/hadoop/pig-0.12.0/conf:/home/huser/hadoop/mahout-distribution-0.9/bin:/home/huser/hadoop/mahout-distribution-0.9/conf) Warning: $HADOOP_HOME is deprecated. 2014-04-17 18:36:38,250 [main] INFO org.apache.pig.Main - Apache Pig version 0.12.0 (r1529718) compiled Oct 07 2013, 12:20:14 2014-04-17 18:36:38,251 [main] INFO org.apache.pig.Main - Logging error messages to: /home/huser/hadoop/pig_1397730998249.log 2014-04-17 18:36:38,300 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file /home/huser/.pigbootup not found 2014-04-17 18:36:38,704 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://master:9000 2014-04-17 18:36:39,325 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: master:9001 grunt>