Pig安装

 

 Pig安装


安装环境以hadoop-1.2.1伪分布为例


1、Pig安装包版本:

pig-0.11.1.tar.gz

 

 

2、把pig安装包解压,改名称改权限:

[root@baolibin local]# ll

总用量 127512

drwxr-xr-x. 15 root   root      4096 3月  22 2013 pig

-rw-r--r--. 1 root   root   58433159 2月  27 20:55 pig-0.11.1.tar.gz

 

3、配置环境变量:

[root@baolibin local]# vim /etc/profile


#set pig environment
export PIG_HOME=/usr/local/pig
export PATH=$PATH:$PIG_HOME/bin

[root@baolibin local]# source /etc/profile

 

 

4、进入目录pig的conf目录下,编辑pig.properties文件:

[root@baolibin conf]# pwd

/usr/local/pig/conf

[root@baolibin conf]# ls

log4j.properties.template  pig.properties

 

 

[root@baolibin conf]# vim pig.properties

添加这两行:

fs.default.name=hdfs://192.168.1.100:9000
mapred.job.tracker=192.168.1.100:9001

这两个配置就是core-site.xml和mapred-site.xml的配置内容。

 

 

查看pig版本:

[root@baolibin ~]# pig -version
Warning: $HADOOP_HOME is deprecated.
 
Apache Pig version 0.11.1(r1459641)
compiled Mar 22 2013, 02:13:53
[root@baolibin ~]#
 

5、启动pig:

 

先启动hadoop:

[root@baolibin hadoop]# jps
2675 TaskTracker
2254 NameNode
2461 SecondaryNameNode
2358 DataNode
2755 Jps
2547 JobTracker
 

进入pig:

 

[root@baolibin hadoop]# pig
Warning: $HADOOP_HOME is deprecated.
 
2015-02-27 21:25:00,507 [main] INFO  org.apache.pig.Main - Apache Pig version 0.11.1(r1459641) compiled Mar 22 2013, 02:13:53
2015-02-27 21:25:00,522 [main] INFO  org.apache.pig.Main - Logging error messagesto: /usr/hadoop/pig_1425043500419.log
2015-02-27 21:25:01,883 [main] INFO  org.apache.pig.impl.util.Utils - Defaultbootup file /root/.pigbootup not found
2015-02-27 21:25:06,610 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine- Connecting to hadoop file system at: hdfs://192.168.1.100:9000
2015-02-27 21:25:11,639 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine -Connecting to map-reduce job tracker at: 192.168.1.100:9001
grunt>


 

 

 

你可能感兴趣的:(pig安装)