如何使用密码保护 Hadoop NameNode 和 JobTracker Web UI?
我想知道如何使用密码保护在端口 50030、50070 等上运行的 Hadoop Web UI。
I'd like to know how to password protect the Hadoop Web UIs running on ports 50030, 50070, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信最好的方法是关闭防火墙中的端口并让用户通过 SSH 隧道进行连接。
I believe the best is to just shut the ports in the firewall and let the users connect with a SSH tunnel.
如果您使用的是 Hadoop 版本 2.7.x,以下是配置,
配置
以下属性应位于集群中所有节点的 core-site.xml 中。
hadoop.http.filter.initializers:向此属性添加 org.apache.hadoop.security.AuthenticationFilterInitializer 初始值设定项类。
hadoop.http.authentication.type:定义用于 HTTP Web 控制台的身份验证。支持的值有: simple | kerberos | #AUTHENTICATION_HANDLER_CLASSNAME#。默认值很简单。
hadoop.http.authentication.token.validity:指示身份验证令牌在必须更新之前的有效时间(以秒为单位)。默认值为 36000。
hadoop.http.authentication.signature.secret.file:用于对身份验证令牌进行签名的签名秘密文件。集群中的所有节点(JobTracker、NameNode、DataNode 和 TastTracker)应使用相同的密钥。默认值为 $user.home/hadoop-http-auth-signature-secret。重要信息:该文件只能由运行守护程序的 Unix 用户读取。
hadoop.http.authentication.cookie.domain:用于存储身份验证令牌的 HTTP cookie 的域。为了使身份验证在集群中的所有节点上正常工作,必须正确设置域。没有默认值,HTTP cookie 不会有一个仅与发出 HTTP cookie 的主机名一起工作的域。
If you are using Hadoop version 2.7.x, below are the configuration,
Configuration
The following properties should be in the core-site.xml of all the nodes in the cluster.
hadoop.http.filter.initializers: add to this property the org.apache.hadoop.security.AuthenticationFilterInitializer initializer class.
hadoop.http.authentication.type: Defines authentication used for the HTTP web-consoles. The supported values are: simple | kerberos | #AUTHENTICATION_HANDLER_CLASSNAME#. The dfeault value is simple.
hadoop.http.authentication.token.validity: Indicates how long (in seconds) an authentication token is valid before it has to be renewed. The default value is 36000.
hadoop.http.authentication.signature.secret.file: The signature secret file for signing the authentication tokens. The same secret should be used for all nodes in the cluster, JobTracker, NameNode, DataNode and TastTracker. The default value is $user.home/hadoop-http-auth-signature-secret. IMPORTANT: This file should be readable only by the Unix user running the daemons.
hadoop.http.authentication.cookie.domain: The domain to use for the HTTP cookie that stores the authentication token. In order to authentiation to work correctly across all nodes in the cluster the domain must be correctly set. There is no default value, the HTTP cookie will not have a domain working only with the hostname issuing the HTTP cookie.