On 25/01/2019 02:17, James H. H. Lampert wrote:
> We have an application that runs on clustered Tomcat 8 servers, in three
> sub-clusters (Google Managed Instance Groups, with nodes running under
> Debian Stretch), all tied to a common load balancer. Each sub-cluster
> runs a different webapp.
> 
> To get to the sub-cluster running the main entry point, you would go to
> https://frobozz.example. To get to the one running the report processor,
> you would go to https://frobozz.example/reports. To get to the one
> running the auxiliary processor, you would go to
> https://frobozz.example/aux. The load balancer then routes the requests
> to the proper sub-cluster.
> 
> Because of the way things work with the load balancer, it expects to
> find the main entry point as the ROOT context of the main sub-cluster,
> and expects to find the other two as the "reports" context of the report
> cluster, and the "aux" context of the auxiliary cluster. There may be a
> way to configure the load balancer look for the root contexts on the
> report and auxiliary clusters, but if so, I haven't found it.

Some load-balancers can do this but any configuration where you change
the path between the reverse proxy and the back-end tends to create a
whole bunch of subtle and not so subtle issues. Generally:

http://loadbalancer/foo -> [http|ajp]://instanceN.tomcat/foo GOOD
http://loadbalancer/foo -> [http|ajp]://foo.instanceN.tomcat BAD

BAD is perhaps an overstatement. You can get it to work but it is a lot
of work.

I'd stick with the configuration you have., It is a lot less hassle.

> When I've tried to run Tomcat without a ROOT context, it fails to
> launch.

What is the error message? A clean Tomcat install starts for me with no
ROOT context (as I would expect).

> And so, for the report and auxiliary clusters, the actual
> webapps are on their ROOT contexts, and the named contexts are links in
> the file system, pointing to the respective ROOT contexts. (I tried it
> the other way around, and it behaved exactly the same as if I'd had no
> ROOT context at all.)

You'll likely end up with double deployment in that case.

> Am I missing something?

Something is going on but I'm not sure what.

If something insists on there being a ROOT web application, I'd just
create an empty ROOT directory in $CATALINA_BASE/webapps as a
work-around until whatever was (incorrectly) requiring a ROOT webapp was
fixed and deploy the apps to /aux and /reports as appropriate.

If 'something' requires more than just an empty webapp then it is more
complicated but, arguably, 'something' is more broken.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to