如何处理Hadoop Web UI的身份验证?

时间:2018-11-02 05:38:27

标签: hadoop authentication namenode

在我的hadoop集群中。我们必须对Web UI组件进行身份验证,因此开始搜索并找到此选项

https://streever.atlassian.net/wiki/spaces/HADOOP/blog/2014/03/07/491558/Securing+Hadoop+HDP+Web+UI+Component+s

我使用了上述认证,并且在我连接到webui时要求输入用户名和密码,因此它可以正常工作。

现在的问题是,当我查看namenode日志时,namenode连接到journalnode时显示未经授权的错误

我在网上查找,但所有链接都指向启用kerberos身份验证。但是我不能做到这一点,正如我的经理告诉我的那样,要使其在集群中正常工作,将需要大量的时间。

所以我的问题是在namenodehdfs中是否有一个设置,我可以在其中指定JETTY身份验证凭据。

就像我可以使用

连接到journalnode一样
curl -u username:password http://192.168.14.22:8480

或使用授权标头

curl -H "authorization: Basic ZGF2aWQ6aGFkb29w" http://192.168.14.22:8480

未经授权的错误

org.apache.hadoop.hdfs.server.namenode.TransferFsImage$HttpGetFailedException: Fetch of http://node1.qaperf.flytxt.com:8480/getJournal?jid=flycluster&segmentTxId=6938&storageInfo=-63%3A2141723110%3A0%3ACID-26cc5859-c0e5-4ddb-acfd-c96c7a10b238 failed with status code 401
    Response message:
    Unauthorized
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream$URLLog$1.run(EditLogFileInputStream.java:471)
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream$URLLog$1.run(EditLogFileInputStream.java:456)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:422)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
            at org.apache.hadoop.security.SecurityUtil.doAsUser(SecurityUtil.java:448)
            at org.apache.hadoop.security.SecurityUtil.doAsCurrentUser(SecurityUtil.java:442)
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream$URLLog.getInputStream(EditLogFileInputStream.java:455)
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.init(EditLogFileInputStream.java:141)
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOpImpl(EditLogFileInputStream.java:192)
            at org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.nextOp(EditLogFileInputStream.java:250)
            at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp(EditLogInputStream.java:85)
            at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.skipUntil(EditLogInputStream.java:151)
            at org.apache.hadoop.hdfs.server.namenode.RedundantEditLogInputStream.nextOp(RedundantEditLogInputStream.java:178)
            at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp(EditLogInputStream.java:85)
            at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.skipUntil(EditLogInputStream.java:151)
            at org.apache.hadoop.hdfs.server.namenode.RedundantEditLogInputStream.nextOp(RedundantEditLogInputStream.java:178)
            at org.apache.hadoop.hdfs.server.namenode.EditLogInputStream.readOp(EditLogInputStream.java:85)
            at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:190)
            at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadFSEdits(FSEditLogLoader.java:143)
            at org.apache.hadoop.hdfs.server.namenode.FSImage.loadEdits(FSImage.java:898)
            at org.apache.hadoop.hdfs.server.namenode.FSImage.loadFSImage(FSImage.java:753)
            at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:329)
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:984)
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:686)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:586)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:646)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:820)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:804)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1516)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1582)

请帮助。

0 个答案:

没有答案