Community Articles

Find and share helpful community-sourced technical articles.
Labels (2)
avatar
Expert Contributor

Requirement: HDP 2.6.1
Fix version is knox: 0.12.0, according to KNOX-841

Method I: Using "solr" as data service {/usr/hdp/current/knox-server/data/services/solr}

Add below in Ambari UI > KNOX > Configs > Advanced topology for Solr UI.
default.xml

            <service>
                <role>SOLR</role>
          <url>http://<solr-hostname>:8983</url>
            </service>
	

Make sure service def is in Upper Case.
Restart KNOX

Use below URL for access Solr UI using KNOX

https://<knox-hostname>:8443/gateway/default/solr

Method II: Using "solrapi" as data service {/usr/hdp/current/knox-server/data/services/solrapi} for Banana UI KNOX-528

Add below in Ambari UI > KNOX > Configs > Advanced topology for Solr UI.

default.xml

            <service>
                <role>SOLRAPI</role>
          <url>http://<solr-hostname>:8983/solr</url>
            </service>
	

Login into sorl server:
Please make sure you have "banana" folder under below location.

/opt/lucidworks-hdpsearch/solr/server/solr-webapp/webapp

Create a new file called banana-jetty-context.xml under /opt/lucidworks-hdpsearch/solr/server/contexts

and populate it with the following

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath"><Property name="hostContext" default="/solr/banana"/></Set>
  <Set name="war"><Property name="jetty.base"/>/solr-webapp/webapp/banana</Set>
  <Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set>
  <Set name="extractWAR">false</Set>
</Configure>

Restart SOLR and access Banana UI using below URL.

https://<knox-hostname>:8443/gateway/default/solr/banana/index.html#/dashboard

4,415 Views
Comments
avatar
Contributor

The first method does not work for me on HDP 2.6.2. What happens, is that the SOLR UI accessed through Knox (Or Knox itself does?) forwards to the actual address of the SOLR UI, and obviously that access doesn't work (due to firewall, differing Kerberos realms - whichever of the reasons you use Knox for).

Are you aware of any supplemental configuration to achieve a working Knox-proxy with the HDP-Search-SOLR?

Adding /solr to the url helps marginally, because it avoids the redirect, but the URLs and content are not working correctly.

avatar
Explorer

The correct way is add following context to default.xml

<param>
	<name>SOLR</name>
	<value>maxFailoverAttempts=3;failoverSleep=1000;enabled=true</value>
</param>

<service>
        <role>SOLR</role>
        <url>http://<solr_host1>:8886/solr</url>
	<url>http://<solr_host2>:8886/solr</url>
</service>

and use below URL for access Solr UI:

https://<knox_host>:8443/gateway/default/solr/index.html#/