码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Authentication for Hadoop(3.3.1) HTTP web-consoles 不是银弹


    文章目录

        • 一. Introduction
        • 二. Configuration
          • 1. 在每一个hadoop节点配置core-site.xml
          • 2.创建密钥
          • 3. 重启 hadoop 集群
          • 4. 访问示例
        • 三、不是银弹
          • 解决方案一
          • 解决方案二-自定义插件ing

    官网:Authentication for Hadoop HTTP web-consoles

    一. Introduction

    可以通过Kerberos、Pseudo或Simple能够实现web页面的安全设置。
    本文通过使用user.name的(Simple)方式实现web页面的安全设置:http://localhost:8088/cluster?user.name=babu.

    此外我们还可以自定义一个插件实现自己的安全机制,参考AuthenticationHandler

    By default Hadoop HTTP web-consoles (ResourceManager,
    NameNode, NodeManagers and DataNodes) allow access without any form of authentication.
     
    Hadoop HTTP web-consoles can be configured to require Kerberos
    authentication using HTTP SPNEGO protocol (supported by browsers like Firefox and Internet Explorer).
     
    In addition, Hadoop HTTP web-consoles support the equivalent of
    Hadoop’s Pseudo/Simple authentication. If this option is enabled, the
    user name must be specified in the first browser interaction using the
    user.name query string parameter. e.g.
    http://localhost:8088/cluster?user.name=babu.
     
    If a custom authentication mechanism is required for the HTTP
    web-consoles, it is possible to implement a plugin to support the
    alternate authentication mechanism
    (refer to Hadoop hadoop-auth for
    details on writing an AuthenticationHandler).

     
     

    二. Configuration

    1. 在每一个hadoop节点配置core-site.xml

    The following properties should be in the core-site.xml of all the nodes in the cluster.

    <configuration>
    
        ......//此处省略已有配置
    
    
        
        <property>
                <name>hadoop.http.filter.initializersname>
                <value>org.apache.hadoop.security.AuthenticationFilterInitializervalue>
        property>
        <property>
                <name>hadoop.http.authentication.typename>
                <value>simplevalue>
        property>
        <property>
                <name>hadoop.http.authentication.token.validityname>
                <value>3600value>
        property>
        <property>
                <name>hadoop.http.authentication.signature.secret.filename>
                <value>/data/app/hadoop/etc/hadoop/secret/hadoop-http-auth-signature-secretvalue>
        property>
        <property>
                <name>hadoop.http.authentication.cookie.domainname>
                <value>value>
        property>
        <property>
                <name>hadoop.http.authentication.simple.anonymous.allowedname>
                <value>falsevalue>
        property>
        
    
        
    configuration>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34

    2.创建密钥

    //在每个hadoop 节点都操作
    mkdir -p /data/app/hadoop/etc/hadoop/secret
    cd /data/app/hadoop/etc/hadoop/secret
    echo \"hadoop\" > hadoop-http-auth-signature-secret
    
    • 1
    • 2
    • 3
    • 4

    3. 重启 hadoop 集群

    # 关闭hadoop 集群
    cd /data/app/hadoop
    ./sbin/stop-dfs.sh
    ./sbin/stop-yarn.sh
    
    # 启动hadoop 集群
    cd /data/app/hadoop
    ./sbin/start-dfs.sh
    ./sbin/start-yarn.sh
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    4. 访问示例

    http://namenode_ip:18137 出现错误
    http://namenode_ip:18137?user.name=hadoop  访问正确
    
    • 1
    • 2

     

    三、不是银弹

    简单的说,hadoop的simple认证的密钥文件并没有起作用,输入任何认证(例如:http://namenode_ip:18137?user.name=xxxx)都可以进入hadoop界面。

    解决方案一

    详见其他博主博文:

    Hadoop Web 控制台安全认证——使用用户名 + 密码登陆设置方法 (Hadoop HTTP web-控制台认证 )

    但似乎tengine要和管理节点(namenode和resourcemanager)放到一个位置,方案有待完善。

     

    解决方案二-自定义插件ing

    此外我们还可以自定义一个插件实现自己的安全机制,参考AuthenticationHandler

  • 相关阅读:
    youtubeDNN模型实现2-网络模型结构
    面向对象编程
    软件测试面试(三)
    Java并发常见面试题(三)
    树、二叉树、树的遍历、树的序列化
    node的服务端对接科大讯飞-火星ai解决方案
    消费大变革时代,三只松鼠的“高端性价比”如何突围制胜?
    《算法通关村——双指针妙用》
    初识设计模式-策略模式-去掉别扭的if,满足开闭原则
    后端开发的前端瞎搞之路——新建Vue工程
  • 原文地址:https://blog.csdn.net/hiliang521/article/details/126459802
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号