Purpose
How to setup a simple cluster of OFBiz instances with a load balancer and failover; getting some insights on the architecture; setting up an environment useful for tests and experiments.
Setup Components
A load balancer: we will use HAProxy
OFBiz: we will use the OFBiz trunk (but the same setup will work for any version of OFBiz)
At least three hosts, whose IP addresses will be needed to complete the setup and perform the experiments:
HOST_0: for the load balancer
HOST_1: for the first OFBiz instance of the cluster and for the OFBiz database
HOST_2: for the second OFBiz instance of the cluster (connected to the database in HOST_1)
Steps
Download and install HAProxy (load balancer) in Host_0
Setup one database, shared by all OFBiz instances of the cluster, in Host_1
Download and setup (at least) two instances of OFBiz in Host_1 and Host_2 (cluster of 2 instances)
Create a configuration file for HAProxy, as illustrated below
Start HAProxy and the two OFBiz instances
Connect to the HAProxy monitor application to make sure that the instances are up and running
Connect from a browser to OFBiz thru the load balancer; start/stop one of the OFBiz instances; etc…
HAProxy Configuration
The load balancer in one host accepting connections on OFBiz default ports (8080 and 8443).
...
Test environment for experiments is now set.
Access Monitoring Tool
To access the monitoring tool browse at http://<HOST_0>/stats (user: admin and password: admin), replace <HOST_0> with the IP address of the host in which HAProxy is installed.
...