Clustering
Contents |
Load-Balancing
Install Apache
- To enable clustering of OfbizNeogia, we need to install Apache:
apt-get install apache2
- Secure connection will be handled by Apache
Enable ssl module :
a2enmod ssl
Generate a ssl certificate
apache2-ssl-certificate
The certificate is located at /etc/apache2/ssl/apache.pem
Add a line to /etc/apache2/mods-enabled/ssl.conf just before </IfModule> :
SSLCertificateFile /etc/apache2/ssl/apache.pem </IfModule>
Configure apache default site /etc/apache/sites-enabled/000-default :
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
SSLEngine On
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Restart apache :
/etc/init.d/apache force-reload
After you can check that ssl support is enabled by visiting https://localhost/
Install mod_jk2
Install modjk :
apt-get install libapache2-mod-jk2
Enable modjk in Apache : Uncomment line starting by JkSet in /etc/apache2/mods-enabled/jk2.conf
# To enable mod_jk2, customize workers2.properties* from # /usr/share/doc/libapache2-mod-jk2/examples and copy it to # /etc/apache2/workers2.properties. Then uncomment the following line: JkSet config.file /etc/apache2/workers2.properties
Create a file /etc/apache2/workers2.properties that contains :
[channel.socket:localhost:8009] info=Ajp13 forwarding over socket (cluster1) [channel.socket:localhost:8010] info=Ajp13 forwarding over socket (cluster2) [status:status] [uri:/jkstatus/*] worker=status:status [uri:/accounting/*] [uri:/catalog/*] [uri:/content/*] [uri:/facility/*] [uri:/images/*] [uri:/manufacturing/*] [uri:/marketing/*] [uri:/ordermgr/*] [uri:/partymgr/*] [uri:/quality/*] [uri:/servicemgnt/*] [uri:/selenium/*] [uri:/webtools/*] [uri:/workeffort/*]
And restart Apache :
/etc/init.d/apache force-reload
You can check that mod_jk is enabled by visiting this url : http://localhost/jkstatus/
Setup ofbizNeogia
On each ofbizNeogia cluster, you must modify base/config/ofbiz-containers.xml :
- Comment http and https connectors
- set jvm-route property to the name of the worker (localhost:8009 or localhost:8010 in this example)
Fail-Over
Althoug it should be possible to do, I don't success to configure it.
It requires session-replication. I think (but I'm not sure) that some session parameters are not serializable so it prevent session replication.


