<?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 Re: How to fix Knox HBASE UI? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240967#M202771</link>
    <description>&lt;P&gt;&lt;STRONG&gt;WARNING:&lt;/STRONG&gt; when doing the previous changes to the installed service.xml and rewrite.xml (under data/services/...) DO NOT create a backup copy (ex. rewrite.xml.orig) or move the original version to a "backup" sub-folder under this path!! &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;Knox will load ALL the xml files it finds under "&lt;EM&gt;/usr/hdp/current/knox-server/data/services&lt;/EM&gt;" (weird but real!) and this will trigger many strange and confusing behaviors!!&lt;/P&gt;&lt;P&gt;I've wasted a few hours trying to make the above work, just because of this &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Dec 2018 21:44:58 GMT</pubDate>
    <dc:creator>lvazquez</dc:creator>
    <dc:date>2018-12-24T21:44:58Z</dc:date>
    <item>
      <title>How to fix Knox HBASE UI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240964#M202768</link>
      <description>&lt;P&gt;In an Ambari HDP 2.6.5 install after configuring a Knox topology to expose Hbase UI with following tags:&lt;/P&gt;&lt;PRE&gt;  &amp;lt;service&amp;gt;
    &amp;lt;role&amp;gt;HBASEUI&amp;lt;/role&amp;gt;
    &amp;lt;url&amp;gt;http://{{hbase_master_host}}:16010&amp;lt;/url&amp;gt;
  &amp;lt;/service&amp;gt;
&lt;/PRE&gt;&lt;P&gt;you will able to access the HBase UI in the URL  &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;&lt;A href="https://knoxserver:8443/gateway/ui/hbase/webui/" target="_blank"&gt;https://knoxserver:8443/gateway/ui/hbase/webui/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but many of the links at the top menu bar, as for example "Procedures" or "Local Logs", will point to the wrong URL without the gateway prefix. For example the "Procedures" menu will point to "&lt;EM&gt;&lt;A href="https://knoxserver:8443/procedures.jsp" target="_blank"&gt;https://knoxserver:8443/procedures.jsp&lt;/A&gt;&lt;/EM&gt;" and gives you a "Not Found" error.&lt;/P&gt;&lt;P&gt;How to fix this?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 07:35:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240964#M202768</guid>
      <dc:creator>lvazquez</dc:creator>
      <dc:date>2018-12-23T07:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix Knox HBASE UI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240965#M202769</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14683/lvazquez.html" nodeid="14683"&gt;@Luis Vazquez&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try below steps &lt;/P&gt;&lt;P&gt;1. ssh to Knox gateway host and go to /var/lib/knox/data-2.6.5.X/services&lt;/P&gt;&lt;P&gt;2. download the configurations from &lt;A href="https://github.com/apache/knox/tree/v0.11.0/gateway-service-definitions/src/main/resources/services/hbaseui/1.1.0"&gt;https://github.com/apache/knox/tree/v0.11.0/gateway-service-definitions/src/main/resources/services/hbaseui/1.1.0&lt;/A&gt;/ URL.&lt;/P&gt;&lt;P&gt;3. make sure your folder structure should look alike /var/lib/knox/data-2.6.5.X/services/hbaseui/1.1.0 and should have rewrite.xml and service.xml files&lt;/P&gt;&lt;P&gt;4. change the owner/Group permissions to Knox for /var/lib/knox/data-2.6.5.X/services/hbaseui/ and subdirectory&lt;/P&gt;&lt;P&gt;5. Go to Knox configurations Modify "Advanced topology" with below service tag&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;&amp;lt;service&amp;gt;&lt;/LI&gt;&lt;LI&gt;&amp;lt;role&amp;gt;HBASEUI&amp;lt;/role&amp;gt;&lt;/LI&gt;&lt;LI&gt;&amp;lt;url&amp;gt;http://HBASEMANTERHOST:16010&amp;lt;/url&amp;gt;&lt;/LI&gt;&lt;LI&gt;&amp;lt;/service&amp;gt;&lt;/LI&gt;&lt;LI&gt;&amp;lt;service&amp;gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;6. Restart Knox service.&lt;/P&gt;&lt;P&gt;7. You should be able to access HBase UI from the below URL&lt;/P&gt;&lt;P&gt;&lt;A href="https://Knxo-host:8443/gateway/&amp;lt;topology-name&amp;gt;/hbase/webui/" target="_blank"&gt;https://Knxo-host:8443/gateway/&amp;lt;topology-name&amp;gt;/hbase/webui/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Hbase UI through knox is not supported in hdp 2.6.5, You can try above steps as a &lt;STRONG&gt;workaround&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please accept answer if it helped.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 13:44:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240965#M202769</guid>
      <dc:creator>Scharan</dc:creator>
      <dc:date>2018-12-23T13:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix Knox HBASE UI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240966#M202770</link>
      <description>&lt;P&gt;Thank you very much &lt;A rel="user" href="https://community.cloudera.com/users/15463/scharan.html" nodeid="15463"&gt;@scharan&lt;/A&gt; for your response&lt;/P&gt;&lt;P&gt;I tried these steps and indeed  posted an 
answer based on this to my own question because after some minor fixed (some trivial errors as duplicated slashes on rewrite patterns) these service definitions seemed to fix the header links problems. &lt;/P&gt;&lt;P&gt;But after some testing I 
found out that this version introduced many other problems with the internal links and realized that the new situation was worst than with the original HDP version so I reverted these changes and deleted my answer.&lt;/P&gt;&lt;P&gt;Then I decided to patch the service definition in HDP 2.6.5 adding the missing rewrite rules to the&lt;STRONG&gt; rewrite.xml&lt;/STRONG&gt; file as follows:&lt;/P&gt;&lt;PRE&gt;   &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/tables" pattern="/tablesDetailed.jsp"&amp;gt;
     &amp;lt;rewrite template="{$frontend[url]}/hbase/webui/tablesDetailed.jsp"/&amp;gt;
   &amp;lt;/rule&amp;gt;
-  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/logs" pattern="/logs/"&amp;gt;
+  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/procedures" pattern="/procedures.jsp"&amp;gt;
+    &amp;lt;rewrite template="{$frontend[url]}/hbase/webui/procedures.jsp"/&amp;gt;
+  &amp;lt;/rule&amp;gt;
+  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/regionserver/nohome" pattern="/rs-status/"&amp;gt;
+    &amp;lt;rewrite template="{$frontend[url]}/hbase/webui/"/&amp;gt;
+  &amp;lt;/rule&amp;gt;
+
+  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/logs" pattern="/logs"&amp;gt;
     &amp;lt;rewrite template="{$frontend[url]}/hbase/webui/logs/"/&amp;gt;
   &amp;lt;/rule&amp;gt;&lt;/PRE&gt;&lt;P&gt;This solved most of the problems but the links to the &lt;EM&gt;Home&lt;/EM&gt; ("/") and &lt;EM&gt;Metric Dump&lt;/EM&gt; ("/jmx") were still wrong, event when the outgoing rewrite rule for the "/jmx" was present in the &lt;STRONG&gt;rewrite.xml&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/jmx" pattern="/jmx"&amp;gt;
    &amp;lt;rewrite template="{$frontend[url]}/hbase/webui/jmx"/&amp;gt;
  &amp;lt;/rule&amp;gt;&lt;/PRE&gt;&lt;P&gt;Some more testing showed me that Knox has a bug (or feature?) that prevents an outgoing implicit rule for matching when the length of the pattern has less than 4 chars! (ex. jmx)&lt;/P&gt;&lt;P&gt;To fix these problems I followed the article&lt;A href="https://cwiki.apache.org/confluence/display/KNOX/Proxying+a+UI+using+Knox"&gt; Proxying a UI using Knox&lt;/A&gt; to create a rewrite filter rule and apply this to the "&lt;EM&gt;response.body&lt;/EM&gt;" to the "text/html" pages. These are the needed changes in &lt;STRONG&gt;service.xml&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;     &amp;lt;routes&amp;gt;
         &amp;lt;route path="/hbase/webui/"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/inbound/master/root" to="request.url"/&amp;gt;
+            &amp;lt;rewrite apply="HBASEUI/hbase/outbound/master/filter" to="response.body"/&amp;gt;
         &amp;lt;/route&amp;gt;
         &amp;lt;route path="/hbase/webui/**"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/inbound/master/path" to="request.url"/&amp;gt;                                                               
             &amp;lt;rewrite apply="HBASEUI/hbase/outbound/headers" to="response.headers"/&amp;gt;
+            &amp;lt;rewrite apply="HBASEUI/hbase/outbound/master/filter" to="response.body"/&amp;gt;
         &amp;lt;/route&amp;gt;
         &amp;lt;route path="/hbase/webui/**?**"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/inbound/master/query" to="request.url"/&amp;gt;
@@ -30,9 +32,11 @@
         &amp;lt;/route&amp;gt;
         &amp;lt;route path="/hbase/webui/regionserver/**?{host}?{port}"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/inbound/regionserver/home" to="request.url"/&amp;gt;
+            &amp;lt;rewrite apply="HBASEUI/hbase/outbound/master/filter" to="response.body"/&amp;gt;
         &amp;lt;/route&amp;gt;
         &amp;lt;route path="/hbase/webui/master/**?{host}?{port}"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/inbound/master/home" to="request.url"/&amp;gt;                                                               
+            &amp;lt;rewrite apply="HBASEUI/hbase/outbound/master/filter" to="response.body"/&amp;gt;
         &amp;lt;/route&amp;gt;
         &amp;lt;route path="/hbase/webui/logs?**"&amp;gt;
             &amp;lt;rewrite apply="HBASEUI/hbase/outbound/headers" to="response.headers"/&amp;gt;&lt;/PRE&gt;&lt;P&gt;An then add these rules to the end of&lt;STRONG&gt; rewrite.xml&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;   &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/master/filter/home"&amp;gt;
    &amp;lt;rewrite template="{$frontend[path]}/hbase/webui/"/&amp;gt;
  &amp;lt;/rule&amp;gt;
  &amp;lt;rule dir="OUT" name="HBASEUI/hbase/outbound/master/filter/jmx"&amp;gt;
    &amp;lt;rewrite template="{$frontend[path]}/hbase/webui/jmx"/&amp;gt;
  &amp;lt;/rule&amp;gt;
  &amp;lt;filter name="HBASEUI/hbase/outbound/master/filter"&amp;gt;
    &amp;lt;content type="text/html"&amp;gt;
      &amp;lt;apply path="/jmx" rule="HBASEUI/hbase/outbound/master/filter/jmx"/&amp;gt;
      &amp;lt;apply path="/" rule="HBASEUI/hbase/outbound/master/filter/home"/&amp;gt;
    &amp;lt;/content&amp;gt;
  &amp;lt;/filter&amp;gt;
&lt;/PRE&gt;&lt;P&gt;Now finally all the header links are OK in all the pages (including the internal ones to the RegionServer nodes status) and all the HBaseUI seems to be working as expected. The only remaining problem seems to be with some very internal and rarely used links at the "Regions" section inside the RegionServer  nodes subpages (this will require more rewrite tweaks).&lt;/P&gt;&lt;P&gt;This worked for me and I hope this will help someone to make the HBaseUI usable through Knox.&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/KNOX/Proxying+a+UI+using+Knox"&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 21:08:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240966#M202770</guid>
      <dc:creator>lvazquez</dc:creator>
      <dc:date>2018-12-24T21:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix Knox HBASE UI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240967#M202771</link>
      <description>&lt;P&gt;&lt;STRONG&gt;WARNING:&lt;/STRONG&gt; when doing the previous changes to the installed service.xml and rewrite.xml (under data/services/...) DO NOT create a backup copy (ex. rewrite.xml.orig) or move the original version to a "backup" sub-folder under this path!! &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;Knox will load ALL the xml files it finds under "&lt;EM&gt;/usr/hdp/current/knox-server/data/services&lt;/EM&gt;" (weird but real!) and this will trigger many strange and confusing behaviors!!&lt;/P&gt;&lt;P&gt;I've wasted a few hours trying to make the above work, just because of this &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 21:44:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-fix-Knox-HBASE-UI/m-p/240967#M202771</guid>
      <dc:creator>lvazquez</dc:creator>
      <dc:date>2018-12-24T21:44:58Z</dc:date>
    </item>
  </channel>
</rss>

