You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Pierre Smits <pi...@gmail.com> on 2013/12/09 18:18:14 UTC

clustering

Hi all,

In a test environment we are trying to get session replication going in an
ofbiz cluster. So we have setup 2 machine and got them running as
individuals.
Next we set the properties for enabling clustering:

   - in general.properties, we set 'cluster=Y' (from cluster='N')
   - in ofbiz-component.xml of framework/catalina, we uncommented the
   section for clustering.

But when restarting the instance(s) we get a wadload of errors, starting
with the excerpt below.

Apparently we are missing something, but what?

Can you help us out?


[java] org.ofbiz.base.start.StartupException: Cannot start()
org.ofbiz.catalina.container.CatalinaContainer
(org.apache.catalina.LifecycleException: Failed to start component
[StandardServer[-1]] (Failed to start component [StandardServer[-1]]))

     [java] at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:240)

     [java] at org.ofbiz.base.start.Start.startStartLoaders(Start.java:327)

     [java] at org.ofbiz.base.start.Start.start(Start.java:369)

     [java] at org.ofbiz.base.start.Start.main(Start.java:120)

     [java] org.ofbiz.base.container.ContainerException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardServer[-1]] (Failed to start component [StandardServer[-1]])

     [java] at
org.ofbiz.catalina.container.CatalinaContainer.start(CatalinaContainer.java:241)

     [java] at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:238)

     [java] at org.ofbiz.base.start.Start.startStartLoaders(Start.java:327)

     [java] at org.ofbiz.base.start.Start.start(Start.java:369)

     [java] at org.ofbiz.base.start.Start.main(Start.java:120)

     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
start component [StandardServer[-1]]

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

     [java] at
org.ofbiz.catalina.container.CatalinaContainer.start(CatalinaContainer.java:239)

     [java] ... 4 more

     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
start component [StandardService[Tomcat]]

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

     [java] at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

     [java] ... 5 more

     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
start component [StandardEngine[default-server]]

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

     [java] at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

     [java] ... 7 more

     [java] Caused by: org.apache.catalina.LifecycleException: A child
container failed during start

     [java] at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)

     [java] at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)

     [java] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

     [java] ... 9 more



Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

Re: clustering

Posted by Jacques Le Roux <ja...@les7arts.com>.
Pierre,

> - in general.properties, set Cluster=Y
I introduced it at http://svn.apache.org/viewvc?view=revision&revision=1144537, see explanation there, you should neglect this property most of the time.

> <distributable/> in the WEB-INF file of the component
You don't need , if you use sticky sessions. Why would you need session replication? 
OK, with sticky sessions each app server is a point of failure. But in which cases and what are the consequences?
Case: hardware failure (see others?). Chances are you will not get much of them, right?
Consequence: user currently connected will lose their sessions, so what? 
Is that so hard if it happens once every, say 5 years, for few sessions? How many users sessions do you expect on each server at a time?
They will simply reconnect on another server and that's it.
See in question below why I prefer sticky sessions. 
Hint: session managers and serialisation can be troublesome. 
IMO does not worth the pain. Except if losing a session is really something you can't allow, but then be prepared to something more complicated.

> - in ofbiz-component.xml of framework/catalina, uncomment the commented out
You don't need , if you use sticky sessions. And should not, if you don't want to struggles with serialisation issues and other related complications.
The load-balancer will dispatch to each app server which will handle its load
My advice: most of the time no needs to introduce a session manager. Except if you like troubles or can't avoid it... Just think about it before...

Hope I'm clear, if you need more information be prepared to pay :D

Jacques

On Wednesday, December 11, 2013 10:28 AM Pierre Smits <pi...@gmail.com> wrote:
> Jacques,
> 
> I agree, for basic HAFO (High Availability-Fail Over)  and load balancing
> you can suffice with a setup that does proxying (e.g. Apache HTTP with
> mod-proxy and/or mod-jk).
> 
> But, that is beside the issue/question I raised.
> 
> When doing clustering on a tomcat level some conditions must be met, like:
> - in general.properties, set Cluster=Y
> - in every component that needs to distributed in the cluster, have
> <distributable/> in the WEB-INF file of the component
> - in ofbiz-component.xml of framework/catalina, uncomment the commented out
> section regarding clustering.
> - any others?
> 
> And apparently, this doesn't work. Hence my question regarding missing
> something.
> 
> Or is broken?
> 
> 
> Regards,
> 
> Pierre Smits
> 
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com

Re: clustering

Posted by Pierre Smits <pi...@gmail.com>.
Jacques,

I agree, for basic HAFO (High Availability-Fail Over)  and load balancing
you can suffice with a setup that does proxying (e.g. Apache HTTP with
mod-proxy and/or mod-jk).

But, that is beside the issue/question I raised.

When doing clustering on a tomcat level some conditions must be met, like:
- in general.properties, set Cluster=Y
- in every component that needs to distributed in the cluster, have
<distributable/> in the WEB-INF file of the component
- in ofbiz-component.xml of framework/catalina, uncomment the commented out
section regarding clustering.
- any others?

And apparently, this doesn't work. Hence my question regarding missing
something.

Or is broken?


Regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

Re: clustering

Posted by Jacques Le Roux <ja...@les7arts.com>.
Normally you don't need to change the cluster property in general, nor, for sticky sessions, changing the catalina cluster section

Jacques

On Tuesday, December 10, 2013 10:11 AM Pierre Smits <pi...@gmail.com> wrote:
> Hi Jacques,
> 
> Thanks for the response.
> In our production environment we do have set up sticky_session in the
> workers.properties file on the http side.
> 
> And yes. We do use DECC.
> 
> But maybe I misunderstood that uncomenting the section in the
> ofbiz_component of /framework/catalina was required.
> 
> Regards,
> 
> Pierre Smits
> 
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com

Re: clustering

Posted by Pierre Smits <pi...@gmail.com>.
Hi Jacques,

Thanks for the response.
In our production environment we do have set up sticky_session in the
workers.properties file on the http side.

And yes. We do use DECC.

But maybe I misunderstood that uncomenting the section in the
ofbiz_component of /framework/catalina was required.

Regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

Re: clustering

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Pierre,

Do you really need session replication? Why not using sticky sessions?
Note that in both cases you need to run the Distributed Entity Cache Clear Mechanism
https://cwiki.apache.org/confluence/display/OFBIZ/Distributed+Entity+Cache+Clear+Mechanism

Jacques

On Monday, December 09, 2013 6:18 PM Pierre Smits <pi...@gmail.com> wrote:
> Hi all,
> 
> In a test environment we are trying to get session replication going in an
> ofbiz cluster. So we have setup 2 machine and got them running as
> individuals.
> Next we set the properties for enabling clustering:
> 
>   - in general.properties, we set 'cluster=Y' (from cluster='N')
>   - in ofbiz-component.xml of framework/catalina, we uncommented the
>   section for clustering.
> 
> But when restarting the instance(s) we get a wadload of errors, starting
> with the excerpt below.
> 
> Apparently we are missing something, but what?
> 
> Can you help us out?
> 
> 
> [java] org.ofbiz.base.start.StartupException: Cannot start()
> org.ofbiz.catalina.container.CatalinaContainer
> (org.apache.catalina.LifecycleException: Failed to start component
> [StandardServer[-1]] (Failed to start component [StandardServer[-1]]))
> 
>     [java] at
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:240)
> 
>     [java] at org.ofbiz.base.start.Start.startStartLoaders(Start.java:327)
> 
>     [java] at org.ofbiz.base.start.Start.start(Start.java:369)
> 
>     [java] at org.ofbiz.base.start.Start.main(Start.java:120)
> 
>     [java] org.ofbiz.base.container.ContainerException:
> org.apache.catalina.LifecycleException: Failed to start component
> [StandardServer[-1]] (Failed to start component [StandardServer[-1]])
> 
>     [java] at
> org.ofbiz.catalina.container.CatalinaContainer.start(CatalinaContainer.java:241)
> 
>     [java] at
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:238)
> 
>     [java] at org.ofbiz.base.start.Start.startStartLoaders(Start.java:327)
> 
>     [java] at org.ofbiz.base.start.Start.start(Start.java:369)
> 
>     [java] at org.ofbiz.base.start.Start.main(Start.java:120)
> 
>     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
> start component [StandardServer[-1]]
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
> 
>     [java] at
> org.ofbiz.catalina.container.CatalinaContainer.start(CatalinaContainer.java:239)
> 
>     [java] ... 4 more
> 
>     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
> start component [StandardService[Tomcat]]
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
> 
>     [java] at
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 
>     [java] ... 5 more
> 
>     [java] Caused by: org.apache.catalina.LifecycleException: Failed to
> start component [StandardEngine[default-server]]
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
> 
>     [java] at
> org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 
>     [java] ... 7 more
> 
>     [java] Caused by: org.apache.catalina.LifecycleException: A child
> container failed during start
> 
>     [java] at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
> 
>     [java] at
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
> 
>     [java] at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 
>     [java] ... 9 more
> 
> 
> 
> Pierre Smits
> 
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com