Posts

Showing posts from February, 2013

Load balancing with Apache Karaf Cellar, and mod_proxy_balancer

Thanks to Cellar, you can deploy your applications, CXF services, Camel routes, … on several Karaf nodes. When you use Cellar with web applications, or CXF/HTTP endpoints, a “classic” need is to load balance the HTTP requests on the Karaf nodes. You have different ways to do that: – using Camel Load Balancer EIP: it’s an interesting EIP, working with any kind of endpoints. However, it requires to have a Karaf running the Load Balancer routes, so it’s not always possible depending of the user security policy (for instance, putting it in DMZ or so) – using hardware appliances like F5, Juniper, Cisco: it’s a very good solution, “classic” solution in network teams. However, it requires expensive hardwares, not easy to buy and setup for test or “small” solution. – using Apache httpd with mod_proxy_balancer: it’s the solution that I’m going to detail. It’s a very stable solution, powerful and easy to setup. And it costs nothing 😉 For instance, you have three Karaf nodes, exposing the follow

Multiple HTTP connectors in Apache Karaf

Installing the http feature in Karaf leverages Pax Web to embed a Jetty webcontainer. By default, Karaf create a Jetty connector on the 8181 http port (and 8443 for https). You can change this port number by providing etc/org.ops4j.pax.web.cfg file. But, you can also create new connector in the embedded Jetty. You may see several advantages for multiple connectors: you can isolate a set of applications, CXF services, Camel routes on a dedicated port number you can setup a different configuration for each connector. For instance, you can create two SSL connectors, each with a different keystore, truststore, … You can find etc/jetty.xml configuration file where you can create custom Jetty configuration. NB: if you want to have both etc/org.ops4j.pax.web.cfg and etc/jetty.xmll, don’t forget to reference jetty.xml in org.ops4j.pax.web.cfg using the org.ops4j.pax.web.config.file property pointing to the jetty.xml, for instance: # in etc/org.ops4j.pax.web.cfg org.ops4j.pax.web.config.file=${