一篇毫无技术含量的pig安装,大家在安装pig前,想必已经安装好了hadoop,这里就不在强调java的版本和JAVA_HOME的配置问题了
1.下载pig包:(我的网盘里面pig-0.9.1)
http://115.com/file/dneclpet
apache版本:
http://pig.apache.org/
2.解压文件:
# tar -zxvf pig-0.9.1.tar.gz
3.配置/etc/profit
export PIG_INSTALL=/usr/pig/pig-0.9.1 export PATH=$PATH:$PIG_INSTALL/bin export PIG_HADOOP_VERSION=20 //支持hadoop版本,我的是hadoop-0.20.2
source /etc/profile 使配置文件生效4.pig的本地模式这里就不多讲,主要讲hadoop模式下的一些配置
a.写profile文件
export PIG_CLASSPATH=$HADOOP_INSTALL/conf/
b.在pig目录下的conf文件夹里创建pig.properties
[root@localhost conf]# cat pig.properties
fs.default.name=hdfs://hadoop149:9000/ mapred.job.tracker=hadoop149:90045.启动pig
[root@localhost conf]# pig 2011-12-06 17:57:48,357 [main] INFO org.apache.pig.Main - Logging error messages to: /usr/pig/pig-0.9.1/conf/pig_1323165468355.log 2011-12-06 17:57:48,528 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://hadoop149:9000/ 2011-12-06 17:57:48,634 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: hadoop149:9004 grunt> 出现如上信息,说明pig启动成功
我一朋友安装pig时一直出一个问题,最后也没有解决:在这里先贴出来,留着以后查看:failed to create DataStorage