Previous topic  Top  Next topic  Print this Topic
 

Load Balancing for Web Services

 

OntoBroker supports the AJP protocol to enable load balancing with the Apache HTTP Server 2.2.

1.Install Apache HTTP Server 2.2.
2.Edit <APACHE_HOME>/conf/httpd.conf
a)Enable mod_proxy, mod_proxy_ajp, and mod_proxy_balancer.

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

b)Set up your cluster.

ProxyPass / balancer://mycluster/

 

<Proxy balancer://mycluster>

BalancerMember ajp://localhost:9001 loadfactor=1

BalancerMember ajp://localhost:9002 loadfactor=1

# The below is sample how to add a hot standby

#BalancerMember ajp://1.2.3.6:8009 status=+H

</Proxy>

For more details, see the ProxyPass Directive documentation at http://httpd.apache.org/docs/2.2/mod/mod_proxy.html.

3.Start OntoBroker instances:
a)Set the following parameters in the first instance of OntoConfig.prp:

WorkerName          = ob1

AJP.Port            = 9001

WebConsole          = on

AJP                 = on

Then start the OntoBroker.

b)Set the following parameters in OntoConfig.prp of the second instance:

WorkerName          = ob2

AJP.Port            = 9002

WebConsole          = on

AJP                 = on

Then start the OntoBroker.

NOTE: For a production server do not forget to secure the Apache server!

After Apache is started as a load balancer and the OntoBroker instances are also running as well, the webservice can be accessed via a WSDL pointing to the Apache port e.g.:

http://localhost/services/ontobroker?wsdl  (Apache on port 80)

instead of

http://localhost:9001/services/ontobroker?wsdl

(OntoBroker on port 9001, which will not work)

The webconsole is accessible via:

http://localhost/console/Console.html

For more information on the web console click here.

Restrictions

Only stateless Web services are supported. As one negative example, the Semantic Guide Web service is not supported as it mainly consists of stateful operations. For the same reasons, the collaboration server and remote API are not available.