简体   繁体   中英

not able to run pig on windows 7 using cygwin

I configured pig as directed in the documentation. Enviornment: Windows 7, Hadoop-0.20.2, pig 0.13.0, Cygwin

But when i type pig (mapreduce) on the command prompt it just displays below thing. I am not sure whether pig is started or not. I don't see GRUNT shell to execute script.

Btw, Hadoop is running on the same node.

Can someone please help?

$ pig Find hadoop at /hadoop-0.20.2/bin/hadoop dry run: 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\\pig-0.13.0\\lib\\accumulo-core-1.5.0.jar;C:\\cygwin64\\pig-0.13.0\\lib\\accumulo-fate-1.5.0.jar;C:\\cygwin64\\pig-0.13.0\\lib\\accumulo-server-1.5.0.jar;C:\\cygwin64\\pig-0.13.0\\lib\\accumulo-start-1.5.0.jar;C:\\cygwin64\\pig-0.13.0\\lib\\accumulo-trace-1.5.0.jar;C:\\cygwin64\\pig-0.13.0\\lib\\avro-1.7.5.jar;C:\\cygwin64\\pig-0.13.0\\lib\\avro-mapred-1.7.5.jar;C:\\cygwin64\\pig-0.13.0\\lib\\avro-tools-1.7.5-nodeps.jar;C:\\cygwin64\\pig-0.13.0\\lib\\groovy-all-1.8.6.jar;C:\\cygwin64\\pig-0.13.0\\lib\\hbase-0.94.1.jar;C:\\cygwin64\\pig-0.13.0\\lib\\jruby-complete-1.6.7.jar;C:\\cygwin64\\pig-0.13.0\\lib\\js-1.7R2.jar;C:\\cygwin64\\pig-0.13.0\\lib\\json-simple-1.1.jar;C:\\cygwin64\\pig-0.13.0\\lib\\jython-standalone-2.5.3.jar;C:\\cygwin64\\pig-0.13.0\\lib\\piggybank.jar;C:\\cygwin64\\pig-0.13.0\\lib\\protobuf-java-2.4.0a.jar;C:\\cygwin64\\pig-0.13.0\\lib\\zook eeper-3.4.5.jar:C:\\cygwin64\\PIG-01~1.0/pig-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

when i run in debug mode, i see this exception. This is because Hadoop Jar is not set.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM