在 hdfs 中创建 Oozie sharelib。(Root 无法模拟 root)

Oozie sharelib creation in hdfs.(Root is not able to impersonate root)

我正在关注 http://hadooptutorial.info/apache-oozie-installation-on-ubuntu-14-04/ 安装 oozie 4.1.0 和 hadoop 2.7.2

构建成功,我可以通过发出此命令来创建 oozie war

hduser@master:~/oozie/oozie-bin$ sudo bin/oozie-setup.sh prepare-war

在 /home/hduser/oozie/oozie-bin/oozie-server/webapps/oozie 添加了 'ExtJS library, JARs' 的新 Oozie WAR 文件。war

信息:Oozie 已准备好启动

但是当我发出这个命令时,用于打包 sharelib 的命令出错了

hduser@master:~/oozie/oozie-bin$ sudo bin/oozie-setup.sh sharelib create -fs hdfs://master:9000

输出:

setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m"
log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hduser/oozie/oozie-bin/libtools/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hduser/oozie/oozie-bin/libtools/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hduser/oozie/oozie-bin/libext/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
the destination path for sharelib is: /user/root/share/lib/lib_20160614094056

Error: User: root is not allowed to impersonate root

错误的堆栈跟踪是(用于调试目的):


org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate root
    at org.apache.hadoop.ipc.Client.call(Client.java:1406)
    at org.apache.hadoop.ipc.Client.call(Client.java:1359)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
    at com.sun.proxy.$Proxy7.getFileInfo(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:186)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
    at com.sun.proxy.$Proxy7.getFileInfo(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:671)
    at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1746)
    at org.apache.hadoop.hdfs.DistributedFileSystem.doCall(DistributedFileSystem.java:1112)
    at org.apache.hadoop.hdfs.DistributedFileSystem.doCall(DistributedFileSystem.java:1108)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1108)
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1399)
    at org.apache.hadoop.fs.FileUtil.checkDest(FileUtil.java:496)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:348)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:338)
    at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1904)
    at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1872)
    at org.apache.oozie.tools.OozieSharelibCLI.run(OozieSharelibCLI.java:165)
    at org.apache.oozie.tools.OozieSharelibCLI.main(OozieSharelibCLI.java:56)

我也重新启动了我的 hadoop 集群,但没有成功。

这是我的核心-site.xml

 <property>
        <name>hadoop.proxyuser.hduser.hosts</name>
        <value>*</value>
 </property>

<property>
        <name>hadoop.proxyuser.hduser.groups</name>
        <value>*</value>
</property>

有人可以帮忙吗?

不要使用 sudo 创建 sharelib,它会起作用。