Hello Rajat,

Can you clear your deployments folder and restart Knox and try again,
sometimes I have seen they don't get properly updated.
Also, can you turn on DEBUG logging for Knox, and check if you can see that
the service defs are properly added, you will see them in the logs like

2017-10-19 15:44:38,734 DEBUG hadoop.gateway
(ServiceDefinitionsLoader.java:loadServiceDefinitions(66)) - Added Service
definition name: ambariui, role : AMBARIUI, version : 2.2.0
2017-10-19 15:44:38,736 DEBUG hadoop.gateway
(ServiceDefinitionsLoader.java:loadServiceDefinitions(66)) - Added Service
definition name: avatica, role : AVATICA, version : 1.9.0
2017-10-19 15:44:38,739 DEBUG hadoop.gateway
(ServiceDefinitionsLoader.java:loadServiceDefinitions(66)) - Added Service
definition name: druid-broker, role : DRUID-BROKER, version : 0.0.1
2017-10-19 15:44:38,741 DEBUG hadoop.gateway
(ServiceDefinitionsLoader.java:loadServiceDefinitions(66)) - Added Service
definition name: druid-coordinator, role : DRUID-COORDINATOR, version :
0.0.1


On Tue, May 22, 2018 at 10:04 AM, Rajat Goel <[email protected]> wrote:

> Hi,
>
> I am new to Knox. I am trying add a simple application service to my
> default Knox topology. Here’s what my service definition looks like:
>
> <service role=“TESTAPP" name=“testapp" version="0.0.1">
>
>     <routes>
>
>         <route path="/app/**">
>
>         </route>
>
>         <route path="/app/api2">
>
>         </route>
>
>     </routes>
>
>     <dispatch classname="org.apache.hadoop.gateway.dispatch.
> PassAllHeadersDispatch"/>
>
> </service>
>
>
> Rewrite.xml has rules:
>
> <rules>
>
>     <rule dir="IN" name=“TESTAPP/testapp/inbound/path" pattern=
> "*://*:*/**/app/{**}">
>
>         <rewrite template="{$serviceUrl[TESTAPP]}/app/{**}"/>
>
>     </rule>
>
> </rules>
>
>
> I have added my service definition in Knox default topology:
> <service>
>                 <role>TESTAPP</role>
>                 <url>http://19.2.168.154.194:8080</url>
>             </service>
>
> Now when I try to access my service through Knox gateway on web browser,
> using url:
> https://192.168.154.194:8443/gateway/default/app/api1#/visualize?_g=
> <https://192.168.154.194:8443/gateway/default/app/testapp#/visualize?_g=>
> ()
>
> Its not working. Knox gateway.log says: 2018-05-22 18:59:42,056 WARN  
> hadoop.gateway
> (GatewayFilter.java:doFilter(162)) - Failed to match path /app/api1
>
> Can someone tell me whats the issue here?
>
> Thanks,
> Rajat
>

Reply via email to