Question

Without hitting around the bush, I will directly go to my query :)

I am implementing a system where there are multiple VMs, WAR file and following configuration: - There is a Master VM which runs Apache and Tomcat configured with mod_jk for load balancing

  • This Master VM also runs Apache Mesos for monitoring resources and running a task. This task is configured to copy WAR file and MySQL database dump to a Mesos slave.

The idea is to scale up/down whenever required based on available resources. For instance, when a new HTTPRequest comes in, and there are no free machines, the Mesos Master is requested for resources and a new VM is turned on. Assume, this VM is configured with Tomcat, MySQL and other necessities already; and Mesos task copies required WAR file and database dump correctly.

My problem is, how do we execute some task (to ask Mesos for resources, get the VM up and running) when a new HTTPRequest is received by Apache, and before Apache forwards this request to Tomcat for serving?

For information, I am running Ubuntu 12.04.

I searched for some configurations in httpd.conf but could not find which helps this scenario.

Any help would be really appreciated! Thanks in advance!

Was it helpful?

Solution 2

httpd won't forward any requests to your new Tomcat instance until you tell httpd that the Tomcat instance exists. Once whatever monitoring has detected that a new Tomcat instance is required, create it, wait for it to start up and them modify the httpd configuration.

OTHER TIPS

Nikhil, you could use Marathon to launch your Tomcats and do the load balancing (via HAProxy). Marathon is a Mesos framework for long running services like web/app servers. While it doesn't automatically scale based on load, it has a simple API for scaling up and down.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top