<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Serve Namenode UI to localhost only. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/323958#M229253</link>
    <description>&lt;P&gt;We have a need to serve our Namenode UI through a proxy and prevent direct access to the UI.&amp;nbsp; &amp;nbsp;There seems to be 2 ways we could do that but I'm having difficulty in implementing.&lt;BR /&gt;&lt;BR /&gt;1.&amp;nbsp; Set dfs.namenode.http-address to 127.0.0.1 :9870&amp;nbsp; &amp;nbsp;Unfortunately, it appears that cloudera's implementation does not allow an address in dfs.namenode.http-address, but instead only accept a port number.&amp;nbsp; This is then combined with the namenode hostname to build the http address.&amp;nbsp; &amp;nbsp;I attempted to override via a safety valve configuration but that appears to be intercepted as well.&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp; &amp;nbsp;Configure the jetty-web.xml with an IPAccessHandler that only allows connections from the local server.&amp;nbsp; &amp;nbsp;I'm having difficulty finding where in the filesystem I'd set this so that cdh6 will pick this up for the namenode role.&lt;BR /&gt;&lt;BR /&gt;This is&amp;nbsp; Cloudera Enterprise 6.3.3 on Centos 7&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 14:43:29 GMT</pubDate>
    <dc:creator>DanHosier</dc:creator>
    <dc:date>2022-09-16T14:43:29Z</dc:date>
    <item>
      <title>Serve Namenode UI to localhost only.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/323958#M229253</link>
      <description>&lt;P&gt;We have a need to serve our Namenode UI through a proxy and prevent direct access to the UI.&amp;nbsp; &amp;nbsp;There seems to be 2 ways we could do that but I'm having difficulty in implementing.&lt;BR /&gt;&lt;BR /&gt;1.&amp;nbsp; Set dfs.namenode.http-address to 127.0.0.1 :9870&amp;nbsp; &amp;nbsp;Unfortunately, it appears that cloudera's implementation does not allow an address in dfs.namenode.http-address, but instead only accept a port number.&amp;nbsp; This is then combined with the namenode hostname to build the http address.&amp;nbsp; &amp;nbsp;I attempted to override via a safety valve configuration but that appears to be intercepted as well.&lt;BR /&gt;&lt;BR /&gt;2.&amp;nbsp; &amp;nbsp;Configure the jetty-web.xml with an IPAccessHandler that only allows connections from the local server.&amp;nbsp; &amp;nbsp;I'm having difficulty finding where in the filesystem I'd set this so that cdh6 will pick this up for the namenode role.&lt;BR /&gt;&lt;BR /&gt;This is&amp;nbsp; Cloudera Enterprise 6.3.3 on Centos 7&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:43:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/323958#M229253</guid>
      <dc:creator>DanHosier</dc:creator>
      <dc:date>2022-09-16T14:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Serve Namenode UI to localhost only.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324183#M229302</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/91796"&gt;@DanHosier&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just provide you a possible solution to bind the namenode http to localhost.&lt;/P&gt;&lt;P&gt;Add following property to service side advanced hdfs-site.xml and restart hdfs.&lt;/P&gt;&lt;PRE&gt;HDFS Service Advanced Configuration Snippet (Safety Valve) for hdfs-site.xml&lt;BR /&gt;&amp;lt;property&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;dfs.namenode.http-bind-host&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;value&amp;gt;127.0.0.1&amp;lt;/value&amp;gt;&lt;BR /&gt;&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;Then the property is added into /var/run/cloudera-scm-agent/process/&amp;lt;Latest process of NN&amp;gt;/hdfs-site.xml:&lt;/P&gt;&lt;PRE&gt;# grep -C2 "dfs.namenode.http-bind-host" hdfs-site.xml&lt;BR /&gt;&amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;property&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;dfs.namenode.http-bind-host&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;value&amp;gt;127.0.0.1&amp;lt;/value&amp;gt;&lt;BR /&gt;&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;And then test curl commands:&lt;/P&gt;&lt;PRE&gt;# curl `hostname -f`:9870&lt;BR /&gt;curl: (7) Failed connect to xxxx.xxxx.xxxx.com:9870; Connection refused&lt;BR /&gt;# curl localhost:9870&lt;BR /&gt;&amp;lt;!--&lt;BR /&gt;Licensed to the Apache Software Foundation (ASF) under one or more&lt;BR /&gt;contributor license agreements. See the NOTICE file distributed with&lt;BR /&gt;this work for additional information regarding copyright ownership.&lt;BR /&gt;The ASF licenses this file to You under the Apache License, Version 2.0&lt;BR /&gt;(the "License"); you may not use this file except in compliance with&lt;BR /&gt;the License. You may obtain a copy of the License at&lt;BR /&gt;&lt;BR /&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;BR /&gt;&lt;BR /&gt;Unless required by applicable law or agreed to in writing, software&lt;BR /&gt;distributed under the License is distributed on an "AS IS" BASIS,&lt;BR /&gt;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;BR /&gt;See the License for the specific language governing permissions and&lt;BR /&gt;limitations under the License.&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;BR /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;BR /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta http-equiv="REFRESH" content="0;url=dfshealth.html" /&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;Hadoop Administration&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;Now the webUI only served on NN's localhost.&lt;/P&gt;&lt;PRE&gt;But you will see this alert on CM because Service Monitor cannot reach to NN WebUI:&lt;BR /&gt;NameNode summary: xxxx.xxxx.xxxx.com (Availability: Unknown, Health: Bad). This health test is bad because the Service Monitor did not find an active NameNode.&lt;/PRE&gt;&lt;P&gt;So this solution has side effects for service monitor, but actually hdfs is running well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Regards,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Will&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the answer helps, please accept as solution and click thumbs up.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Sep 2021 05:00:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324183#M229302</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2021-09-12T05:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Serve Namenode UI to localhost only.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324254#M229320</link>
      <description>&lt;P&gt;That sounds like a good first step.&amp;nbsp; &amp;nbsp;Is there a way to configure the service monitor to use a different port (port of a proxy)?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 15:14:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324254#M229320</guid>
      <dc:creator>DanHosier</dc:creator>
      <dc:date>2021-09-13T15:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Serve Namenode UI to localhost only.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324256#M229322</link>
      <description>&lt;P&gt;Actually, this should work fine regardless.&amp;nbsp; &amp;nbsp; We'll monitor what NameNodeHealth would monitor ourselves and just suppress that health test.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks Will!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 15:49:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Serve-Namenode-UI-to-localhost-only/m-p/324256#M229322</guid>
      <dc:creator>DanHosier</dc:creator>
      <dc:date>2021-09-13T15:49:30Z</dc:date>
    </item>
  </channel>
</rss>

