gpt4 book ai didi

php - 在浏览器中执行hadoop命令

转载 作者:太空宇宙 更新时间:2023-11-04 04:08:56 25 4
gpt4 key购买 nike

我遵循了著名的michael noll教程http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/在单个节点中安装 hadoop

现在我想通过浏览器通过php执行以下命令

usr/local/hadoop/bin/hadoop jar /usr/local/hadoop/contrib/streaming/hadoop-*streaming*.jar -mapper "/usr/bin/python /var/www/DataMining/AnalysisByYear/AnalysisByYear_mapper.py 2011" -reducer "/usr/bin/python /var/www/DataMining/AnalysisByYear/AnalysisByYear_reducer.py" -input /user/hduser/dataset/final_eval.txt -output /user/hduser/dataset-outputyear

我使用phpexec()命令来执行它,但它没有显示任何结果。

在本教程中,hduser 被授予 hadoop 的所有权。但是浏览器以用户 www-data 身份登录。结果无法执行。我假设这就是错误。是否可以以任何方式执行脚本?

名称节点日志如下:

2013-11-18 14:54:45,712 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:www-data cause:org.apache.hadoop.security.AccessControlException: Permission denied: user=www-data, access=WRITE, inode="staging":hduser:supergroup:rwxr-xr-x
2013-11-18 14:54:45,712 INFO org.apache.hadoop.ipc.Server: IPC Server handler 1 on 54310, call mkdirs(/app/hadoop/tmp/mapred/staging/www-data/.staging, rwx------) from 127.0.0.1:40876: error: org.apache.hadoop.security.AccessControlException: Permission denied: user=www-data, access=WRITE, inode="staging":hduser:supergroup:rwxr-xr-x
org.apache.hadoop.security.AccessControlException: Permission denied: user=www-data, access=WRITE, inode="staging":hduser:supergroup:rwxr-xr-x
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:199)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:180)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:128)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:5468)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAncestorAccess(FSNamesystem.java:5442)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FSNamesystem.java:2209)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:2178)
at org.apache.hadoop.hdfs.server.namenode.NameNode.mkdirs(NameNode.java:857)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:578)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1393)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1389)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1387)

最佳答案

我使用的解决方案是以 hduser 身份启动我的 apache 服务器。

关于php - 在浏览器中执行hadoop命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20044686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com