Configuring Proxy with Apache Knox
Also available as:
PDF
loading table of contents...

Set up Service URLs (Proxy a Service)

How to configure access to an internal service through the Knox Gateway- AKA, how to proxy a service, such as Atlas, Ranger. or Oozie.

  1. Edit $gateway/conf/topologies$cluster-name.xml to add an entry similar to the following, for each service:
    <topology>
        <gateway>
         ...
         </gateway> 
         <service>
             <role> $service_name </role>
             <url> $schema://$hostname:$port</url>
         </service>
    </topology>

    where:

    • $service_name is: AMBARI, AMBARIUI, ATLAS, HIVE, JOBTRACKER, NAMENODE, OOZIE, RANGER, RANGERUI, RESOURCEMANAGER, WEBHBASE, WEBHCAT, WEBHDFS, ZEPPELINUI, or ZEPPELINWS.
    • <url> is the complete internal cluster URL required to access the service, including:
      • $schema -- the service protocol
      • $hostname -- the resolvable internal host name
      • $port -- the service listening port
  2. Save the file.
    Note
    Note

    It is not necessary to restart the Knox server after making changes to the topology/ Cluster services.

    The gateway creates a new WAR file with modified timestamp in $gateway/data/deployments.

Service Definitions (Proxy a Service)

Reference examples of service definitions (examples of setting up proxy for services, such as Atlas, Ranger. or Oozie.)

Configure each service that you want to expose externally, being careful to define the internal hostname and service ports of your cluster.

The following example uses the defaults ports and supported service names.

<service>
    <role>AMBARI</role>
    <url>http://ambari-host:8080</url>
</service>

<service>
    <role>AMBARIUI</role>
    <url>http://ambari-host:8080</url>
</service>

<service>
    <role>ATLAS</role>
    <url>http://atlas-host:8443</url>
</service>

<service>
    <role>HIVE</role>
    <url>http://hive-host:10001/cliservice</url>
</service>

<service>
    <role>JOBTRACKER</role>
     <url>rpc://jobtracker-host:8050</url>
</service>

<service
    <role>NAMENODE</role>
     <url>hdfs://namenode-host:8020</url>
</service>

<service>
    <role>OOZIE</role>
    <url>http://oozie-host:11000/oozie</url>
</service>

<service>
    <role>RANGER</role>
    <url>http://ranger-host:6080</url>
</service>

<service>
    <role>RANGERUI</role>
    <url>http://ranger-host:6080</url>
</service>

<service>
    <role>RESOURCEMANAGER</role>
    <url>http://hive-host:8088/ws</url>
</service>

<service>
    <role>WEBHBASE</role>
    <url>http://webhbase-host:60080</url>
</service>

<service>
    <role>WEBHCAT</role>
    <url>http://webcat-host:50111/templeton</url>
</service>

<service>
    <role>WEBHDFS</role>
    <url>http://webhdfs-host:50070/webhdfs</url>
</service>

<service>
    <role>ZEPPELINUI</role>
    <url>http://zeppelin-host:9995</url>
</service>

<service>
    <role>ZEPPELINWS</role>
    <url>http://zeppelin-host:9995/ws</url>
</service>