我在猪中写了一个简单的脚本,从终端运行时运行良好。
但是,当我尝试使用apache服务器从浏览器运行脚本时,它会抛出以下错误。
[main] ERROR org.apache.pig.tools.grunt.Grunt - You don't have permission to perform the operation. Error from the server: dummy (Permission denied)
[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Encountered IOException. dummy (Permission denied)
任何想法解决问题的方法?好吧,如果它有帮助,我的脚本中没有任何地方使用任何名为“虚拟”的东西!!!
P.S。:将/ tmp hdfs目录中的权限更改为777,没有帮助!!
检查/ tmp本地目录中的权限是否有777,没关系!!
试图将-Dpig.temp.dir用于apache有权写入的目录,没有帮助!!
请帮忙,我错过了什么吗?
编辑:值得一提的是:当我在检查猪脚本的编译时运行脚本时出现此错误,即pig -c ScriptName
2013-09-06 10:41:19,344 [main] INFO org.apache.pig.Main - Apache Pig version 0.10.0 (r1328203) compiled Apr 19 2012, 22:54:12
2013-09-06 10:41:19,344 [main] INFO org.apache.pig.Main - Logging error messages to: /data/storage/pig-0.10.0/logs/pig_1378444279340.log
2013-09-06 10:41:19,658 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://[master]:9000
2013-09-06 10:41:19,743 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to map-reduce job tracker at: [master]:9001
2013-09-06 10:41:19,866 [main] INFO org.apache.pig.scripting.jython.JythonScriptEngine - created tmp python.cachedir=/tmp/pig_jython_4266457116882300725
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/lib/tools.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/hadoop-core-0.20.203.0.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/aspectjrt-1.6.5.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/aspectjtools-1.6.5.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-beanutils-1.7.0.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-beanutils-core-1.8.0.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-cli-1.2.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-codec-1.4.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-collections-3.2.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-configuration-1.6.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-configurationhadoop-1.6.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-daemon-1.0.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-digester-1.8.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-el-1.0.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-httpclient-3.0.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-lang-2.4.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-logging-1.1.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-logging-api-1.0.4.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-math-2.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/commons-net-1.4.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/core-3.1.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/guava-r09.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/hadoop-fairscheduler-0.20.203.0.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/hbase-0.94.4.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/hsqldb-1.8.0.10.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/hstreaming-all.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jackson-core-asl-1.0.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jackson-mapper-asl-1.0.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jasper-compiler-5.5.12.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jasper-runtime-5.5.12.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jets3t-0.6.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jetty-6.1.26.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jetty-util-6.1.26.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jsch-0.1.42.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/junit-4.5.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/kfs-0.2.2.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/log4j-1.2.15.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/mockito-all-1.8.5.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/oro-2.0.8.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/protobuf-java-2.4.0a.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/servlet-api-2.5-20081211.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/slf4j-api-1.4.3.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/slf4j-log4j12-1.4.3.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/xmlenc-0.52.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/zookeeper-3.4.5.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jsp-2.1/jsp-2.1.jar'
*sys-package-mgr*: processing new jar, '/home/hadoop/hadoop-0.20.203.0/lib/jsp-2.1/jsp-api-2.1.jar'
*sys-package-mgr*: processing new jar, '/data/storage/pig-0.10.0/lib/automaton.jar'
*sys-package-mgr*: processing new jar, '/data/storage/pig-0.10.0/lib/jython-2.5.0.jar'
*sys-package-mgr*: processing new jar, '/data/storage/pig-0.10.0/pig-0.10.0-withouthadoop.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/resources.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/rt.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/jsse.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/jce.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/charsets.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/sunpkcs11.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/sunec.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/sunjce_provider.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/zipfs.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/localedata.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_03/jre/lib/ext/dnsns.jar'
2013-09-06 10:41:28,086 [main] INFO org.apache.pig.scripting.jython.JythonScriptEngine - Register scripting UDF: pythonDefpyUDF.[UDF1]
2013-09-06 10:41:28,087 [main] INFO org.apache.pig.scripting.jython.JythonScriptEngine - Register scripting UDF: pythonDefpyUDF.[UDF2]
2013-09-06 10:41:28,266 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_FLOAT 1 time(s).
2013-09-06 10:41:28,421 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_FLOAT 1 time(s).
2013-09-06 10:41:28,578 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_FLOAT 1 time(s).
2013-09-06 10:41:29,665 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_FLOAT 1 time(s).
2013-09-06 10:41:29,712 [main] WARN org.apache.pig.tools.grunt.GruntParser - 'rm/rmf' statement is ignored while processing 'explain -script' or '-check'
2013-09-06 10:41:29,774 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_FLOAT 1 time(s).
2013-09-06 10:41:29,814 [main] ERROR org.apache.pig.tools.grunt.Grunt - You don't have permission to perform the operation. Error from the server: dummy (Permission denied)
2013-09-06 10:41:29,815 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Encountered IOException. dummy (Permission denied)
Details at logfile: /data/storage/pig-0.10.0/logs/pig_1378444279340.log
答案 0 :(得分:0)
似乎是apache用户的权限问题
在运行以下命令pig -c ScriptName
时,检查两个位置的输出。
检查日志文件的权限,以及pig尝试写入的位置。这可以帮助您解决此问题。