使用cygwin无法在Windows 7上运行猪

时间:2014-08-26 12:52:31

标签: windows hadoop apache-pig

我按照文档中的指示配置了pig。 环境:Windows 7,Hadoop-0.20.2,猪0.13.0,Cygwin

但是当我在命令提示符下键入pig(mapreduce)时,它只显示下面的内容。我不确定猪是否已经开始。我没有看到GRUNT shell执行脚本。

顺便说一句,Hadoop正在同一个节点上运行。

有人可以帮忙吗?

$ pig 在/hadoop-0.20.2/bin/hadoop找到hadoop 干运行: HADOOP_CLASSPATH:C:\ cygwin64 \ pig-0.13.0 \ conf; C; C:\ Program Files \ Java \ jdk1.6.0_25 \ lib \ tools.jar; C; C:\ cygwin64 \ hadoop-0.20.2 \ conf ; C:\ cygwin64 \猪-0.13.0 \ lib中\ accumulo核-1.5.0.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ accumulo-命运-1.5.0.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ accumulo - 服务器 - 1.5.0.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ accumulo - 开始 - 1.5.0.jar; C:\ cygwin64 \ pig- 0.13.0 \ lib中\ accumulo痕量-1.5.0.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\阿夫罗-1.7.5.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ Avro的-mapred-1.7.5.jar; C:\ cygwin64 \猪0.13.0 \ LIB \ Avro的工具-1.7.5-nodeps.jar; C:\ cygwin64 \猪0.13.0 \ LIB \ groovy-全1.8.6.jar; C:\ cygwin64 \猪0.13.0 \ LIB \ HBase的-0.94.1.jar; C:\ cygwin64 \猪0.13.0 \ LIB \ JRuby的完整-1.6.7。罐; C:\ cygwin64 \猪-0.13.0 \ lib中\ JS-1.7R2.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ JSON-简单-1.1.jar; C:\ cygwin64 \ pig- 0.13.0 \ lib中\ Jython的独立-2.5.3.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ piggybank.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\ protobuf的-Java的2.4.0a.jar; C:\ cygwin64 \猪-0.13.0 \ lib中\动物园管理员-3.4.5.jar:C:\ cygwin64 \ PIG-01〜1.0 /猪withouthadoop -h2.jar: HADOOP_OPTS:-Xmx1000m -Dpig.log.dir = C:\ cygwin64 \ PIG-01~1.0 \ logs -Dpig.log.file = pig.log -Dpig.home.dir = C:\ cygwin64 \ PIG-01~1.0 \ HADOOP_CLIENT_OPTS:-Xmx1000m -Dpig.log.dir = C:\ cygwin64 \ PIG-01~1.0 \ logs -Dpig.log.file = pig.log -Dpig.home.dir = C:\ cygwin64 \ PIG-01~1.0 \ /hadoop-0.20.2/bin/hadoop jar C:\ cygwin64 \ PIG-01~1.0 / pig-withouthadoop-h2.jar

当我在调试模式下运行时,我看到了这个异常。这是因为没有设置Hadoop Jar。

localhsot@mymachine~
$ echo $PIG_INSTALL
C:\cygwin64\pig-0.13.0

localhsot@mymachine~
$ export PIG_INSTALL=/cygdrive/c/cygwin64/pig-0.13.0

localhsot@mymachine~
$ export HADOOP_INSTALL=/cygdrive/c/cygwin64/hadoop-0.20.2/

localhsot@mymachine~
$ export PATH=$PATH:$PIG_INSTALL/bin:$HADOOP_INSTALL/bin


$ pig
14/08/26 14:05:12 INFO pig.ExecTypeProvider: Trying ExecType : LOCAL
14/08/26 14:05:12 INFO pig.ExecTypeProvider: Trying ExecType : MAPREDUCE
14/08/26 14:05:12 INFO pig.ExecTypeProvider: Picked MAPREDUCE as the ExecType
2014-08-26 14:05:12,998 [main] INFO  org.apache.pig.Main - Apache Pig version 0.                                                                                                                                                  13.0 (r1606446) compiled Jun 29 2014, 02:27:58
2014-08-26 14:05:12,998 [main] INFO  org.apache.pig.Main - Logging error message                                                                                                                                                  s to: C:\cygwin64\home\chparekh\pig_1409076312996.log
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/map                                                                                                                                                  reduce/task/JobContextImpl
        at org.apache.pig.tools.pigstats.PigStatsUtil.<clinit>(PigStatsUtil.java                                                                                                                                                  :68)
        at org.apache.pig.Main.run(Main.java:643)
        at org.apache.pig.Main.main(Main.java:156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.                                                                                                                                                  java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces                                                                                                                                                  sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.mapreduce.task.Jo                                                                                                                                                  bContextImpl
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 8 more

1 个答案:

答案 0 :(得分:1)

你可以参考下面的链接相同,我希望这会对你有所帮助。 http://abhijitsureshshingate.wordpress.com/2013/07/08/code-debug-test-apache-pig-scripts-using-eclipse-on-windows/