1、Hadoop經常使用web監控頁面安全設置
一、修改core-site.xml,增長以下內容,配置完成後拷貝到其餘節點上。
<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>/opt/beh/core/hadoop/etc/hadoop/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>
二、生成密鑰文件secret
cd $HADOOP_HOME/etc/hadoop
echo "sh_bonc" > secret
- 將修改後的core-site.xml文件以及密鑰文件secret拷貝至各個節點對應的目錄下
$ scp core-site.xml hadoop00x:/opt/beh/core/hadoop/etc/hadoop/core-site.xml
$ scp secret hadoop00x:/opt/beh/core/hadoop/etc/hadoop/
三、重啓集羣服務
stop-all.sh
start-all.sh
四、頁面監控
Web頁面http://192.168.30.21:23188
須要在頁面後面加上?user.name=sh_bonc
sh_bonc爲密鑰文件中的內容。
http://192.168.30.21:23188?user.name=sh_bonc
2、關閉hbase ui
cd $HBASE_HOME/conf
vi hbase-site.xml
- 將master和regionserver的默認端口參數值設爲-1,即爲關閉對應的web頁面端口
<property>
<name>hbase.master.info.port</name>
<value>-1</value>
</property>
<property>
<name>hbase.regionserver.info.port</name>
<value>-1</value>
</property>
3、Timeline服務的web端口安全設置
cd $HADOOP_HOME/etc/hadoop
vi yarn-site.xml
<property>
<name>yarn.timeline-service.http-authentication.simple.anonymous.allowed</name>
<value>false</value>
</property>
yarn-daemon.sh stop timelineserver
yarn-daemon.sh start timelineserver
http://192.168.30.21:8188?user.name=sh_bonc