Hadoop 默认开放了很多端口来提供 WebUI 服务,通过访问 NameNode WebUI 管理界面的 50070 端口,可以下载任意文件,所以需要对页面增加访问限制。
修改core-site.xml配置文件,追加以下信息
hadoop.http.filter.initializers
org.apache.hadoop.security.AuthenticationFilterInitializer
hadoop.http.authentication.type
simple
hadoop.http.authentication.token.validity
3600
hadoop.http.authentication.signature.secret.file
/home/huser/hadoop/hadoop-http-auth-signature-secret
hadoop.http.authentication.cookie.domain
ok问题解决了
hadoop.http.authentication.simple.anonymous.allowed
false
:
再次访问hadoop页面时需要