Hadoop Web monitoring interface setting security mechanism

Source: Internet
Author: User

Hadoop cluster configuration completed, the Web monitoring interface 50070 and 50030 ports without user authentication can be accessed, the production environment is not allowed, need to add security mechanisms.

Experimental environment: Os:centos 6.5 x64, Soft:hadoop 1.2.1

1, modify the Core-site.xml, add the following, the configuration is completed after the copy to the other nodes.

<property>
<name>hadoop.http.filter.initializers</name>
<value>org.apache.hadoop.security.AuthenticationFilterInitializer</value>
</property>
<property>
<name>hadoop.http.authentication.type</name>
<value>simple</value>
</property>
<property>
<name>hadoop.http.authentication.token.validity</name>
<value>3600</value>
</property>
<property>
<name>hadoop.http.authentication.signature.secret.file</name>
<value>/home/huser/hadoop/hadoop-http-auth-signature-secret</value>
</property>
<property>
<name>hadoop.http.authentication.cookie.domain</name>
<value></value>
</property>
<property>
<name>hadoop.http.authentication.simple.anonymous.allowed</name>
<value>false</value>
</property>

2, in the above configuration directory/home/huser/hadoop/generated file Hadoop-http-auth-signature-secret, copied to other nodes.

$ echo "Hadoop" > Hadoop-http-auth-signature-secret

3, restart the cluster environment, access to the Web page will be error.

HTTP ERROR 401

Problem accessing/dfshealth.jsp. Reason:

Org.apache.hadoop.security.authentication.client.AuthenticationException:Anonymous Requests is disallowed

After accessing the address bar, add the user.name=xxx, where "xxx" is the content that the Hadoop-http-auth-signature-secret file writes, the page can be accessed normally, thus security mechanism can be achieved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.