散仙假设你的Hadoop环境已经安装完毕
(1)到https://archive.apache.org/dist/pig/下载对应的tar包,如果是hadoop0.20.x之前的版本,则直接可以用,如果Hadoop2.x之后的,则需要重新编译,在pig的根目录下执行如下命令:
ant clean jar-withouthadoop -Dhadoopversion=23
否则执行MapReduce时,会报如下的异常
2013-10-24 09:35:19,300 [main] WARN
org.apache.pig.backend.hadoop20.PigJobControl - falling back to default
JobControl (not using hadoop 0.20 ?)
java.lang.NoSuchFieldException: runnerState
at java.lang.Class.getDeclaredField(Class.java:1938)
at
org.apache.pig.backend.hadoop20.PigJobControl.<clinit>(PigJobControl.java:51)
at
org.apache.p
(2)配置Pig的环境变量:
export PIG_CLASSPATH=$HADOOP_HOME/etc/hadoop
export PATH=/home/search/pig-0.12.1/bin:$PATH
(3)直接在linux终端执行pig命令,即可进入grunt界面:
2015-05-01 12:44:58,573 [main] INFO org.apache.pig.Main - Apache Pig version 0.12.2-SNAPSHOT (r: unknown) compiled May 01 2015, 12:28:37
2015-05-01 12:44:58,574 [main] INFO org.apache.pig.Main - Logging error messages to: /home/search/pig-0.12.1/build/pig_1430498698551.log
2015-05-01 12:44:58,602 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file /home/search/.pigbootup not found
2015-05-01 12:44:59,244 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
2015-05-01 12:44:59,244 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
2015-05-01 12:44:59,244 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://h1:8020
2015-05-01 12:44:59,247 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - mapred.used.genericoptionsparser is deprecated. Instead, use mapreduce.client.genericoptionsparser.used
2015-05-01 12:45:00,465 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: h1:8021
2015-05-01 12:45:00,469 [main] INFO org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
grunt>
(4)pig -i查看pig的版本,
pig --help 查看pig的一些帮助命令
pig -x local 执行local模式
pig -x mapreduce 执行MapReduce模式
分享到:
相关推荐
hadoop2.2 64位 (下) centos6.4 64位编译 这是下半部分
hadoop 2.2 安装包
hadoop2.2集群环境搭建,按照本文档操作,可以搭建hadoop2.2的环境,从而进行大数据学习
hadoop2.2 安装 工具 hive hbase快速安装工具
hadoop 2.2 eclipse plugins 插件 拷贝至plugins即可 留给自己的,当做备份用
hadoop 2.2 spark shark hbase hive安装手册
Hadoop2.2 安装手册附完整截图,包含单点和集群两种方式
hadoop2.2集群搭建遇到的各种问题。
亲测能装,不能装请留言。前提是要在hadoop2.2已经安装好的情况下。
hadoop2.2 64位 centos6.4 64位编译 这是上半部分
hadoop2.2伪分布式集群搭建 #查看防火墙状态 service iptables status #关闭防火墙 service iptables stop #查看防火墙开机启动状态 chkconfig iptables --list #关闭防火墙开机启动 chkconfig iptables off
自己下载的hadoop2.2源码,在redhat6.3x64位下编译
Hadoop2.2官方发布版本是32位的,没有提供64的发布包;32位发布包在Linux64位下运行会报warn。现编译出64位的native库,供大家下载; 直接替换lib/native下的文件即可,本native库适合 RedHat、CentOS 64位系统。
Hadoop 2.2编译安装详解,配置文档
Hadoop2.2编译安装详解,详细介绍了hadoop安装与使用
hadoop2.2 hbase0.96.2 hive 0.13.1整合部署 本人亲测,用了一个月终于搞定,内容绝对详实。
hadoop2.2 windows7 win32 winutils hadoop.dll 亲手编译绝对可执行
Hadoop2.2+Zookeeper3.4.5+HBase0.96集群环境搭建
hadoop-common-2.2.0-bin-master(包含windows端开发Hadoop2.2需要的winutils.exe)
hadoop2.2 64位编译版本压缩文件第二部分