在apachezeppelin上运行pig查询

2ul0zpep  于 2021-07-15  发布在  Pig
关注(0)|答案(0)|浏览(353)

我在apachezeppelin中运行以下pig查询

%pig.query

A = load '/Pig_data' using PigStorage(',') as(ExamName,ExamId,BITSID, StudentName,Issue_Type,Time);
B = group A by Issue_Type;
C = FOREACH B GENERATE group as Issue_Type, COUNT($1);

但它给了我以下的错误

org.apache.zeppelin.interpreter.InterpreterException: java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/conf/YarnConfiguration
    at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:76)
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:836)
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:744)
    at org.apache.zeppelin.scheduler.Job.run(Job.java:172)
    at org.apache.zeppelin.scheduler.AbstractScheduler.runJob(AbstractScheduler.java:132)
    at org.apache.zeppelin.scheduler.FIFOScheduler.lambda$runJobInScheduler$0(FIFOScheduler.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/conf/YarnConfiguration
    at org.apache.pig.PigServer.<init>(PigServer.java:249)
    at org.apache.pig.PigServer.<init>(PigServer.java:220)
    at org.apache.pig.PigServer.<init>(PigServer.java:193)
    at org.apache.pig.PigServer.<init>(PigServer.java:185)
    at org.apache.zeppelin.pig.PigInterpreter.open(PigInterpreter.java:64)
    at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:70)
    ... 8 more
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.yarn.conf.YarnConfiguration
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 14 more

我已经检查过hadoop类路径和yarn类路径已经设置好了

[hadoop@localhost ~]$ hadoop classpath
/home/hadoop/hadoop/etc/hadoop:/home/hadoop/hadoop/share/hadoop/common/lib/*:/home/hadoop/hadoop/share/hadoop/common/*:/home/hadoop/hadoop/share/hadoop/hdfs:/home/hadoop/hadoop/share/hadoop/hdfs/lib/*:/home/hadoop/hadoop/share/hadoop/hdfs/*:/home/hadoop/hadoop/share/hadoop/mapreduce/lib/*:/home/hadoop/hadoop/share/hadoop/mapreduce/*:/home/hadoop/hadoop/share/hadoop/yarn:/home/hadoop/hadoop/share/hadoop/yarn/lib/*:/home/hadoop/hadoop/share/hadoop/yarn/*

[hadoop@localhost ~]$ yarn classpath
/home/hadoop/hadoop/etc/hadoop:/home/hadoop/hadoop/share/hadoop/common/lib/*:/home/hadoop/hadoop/share/hadoop/common/*:/home/hadoop/hadoop/share/hadoop/hdfs:/home/hadoop/hadoop/share/hadoop/hdfs/lib/*:/home/hadoop/hadoop/share/hadoop/hdfs/*:/home/hadoop/hadoop/share/hadoop/mapreduce/lib/*:/home/hadoop/hadoop/share/hadoop/mapreduce/*:/home/hadoop/hadoop/share/hadoop/yarn:/home/hadoop/hadoop/share/hadoop/yarn/lib/*:/home/hadoop/hadoop/share/hadoop/yarn/*

也设置在齐柏林飞艇-env.sh

export USE_HADOOP=True
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop

请帮助我哪里出了问题。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题