-
1. Re: Clustering with no replication
jackpot Jul 5, 2003 1:55 AM (in response to albin)Hai,
There could be a problem in your cluster-service.xml. List out both the cluster-service.xml. Explaining all the steps is not all possible. It quite clearly explained in the documents. So, if you list out the xml's, I might be able to help.
thanks,
JP -
2. Re: Clustering with no replication
slaboure Jul 5, 2003 3:25 AM (in response to albin)That's a good question!
Can you try to compare both "standard" and "clustered" configurations in conf/standardjboss.xml and modify the clustered one (or create a brand new one for you) that is similar to the non-clustered one EXCEPT for the invoker it uses i.e. it should use the HAInvoker and should still be activated in jboss.xml for your bean.
Cheers,
sacha -
3. Re: Clustering with no replication
albin Jul 7, 2003 5:43 AM (in response to albin)Thank you for your responses, but if I use the standard configuration and I change the invoker with ????, I have no replication, but client call for the same instance SFSB are still dispatching between nodes, so when I call a method of my SFSB, I have a NPE.
My jboss.xml :
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<enterprise-beans>
<ejb-name>StatefulSkeletorEJB</ejb-name>
<jndi-name>ejb/StatefulSkeletorEJB</jndi-name>
true
<cluster-config>
<partition-name>DefaultPartition</partition-name>
<home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</home-load-balance-policy>
<bean-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</bean-load-balance-policy>
<session-state-manager-jndi-name>/HASessionState/Default</session-state-manager-jndi-name>
</cluster-config>
<configuration-name>My Stateful SessionBean</configuration-name>
</enterprise-beans>
<container-configurations>
<container-configuration>
<container-name>My Stateful SessionBean</container-name>
<call-logging>false</call-logging>
<container-invoker>org.jboss.proxy.ejb.ProxyFactoryHA</container-invoker>
<container-interceptors>
org.jboss.ejb.plugins.LogInterceptor
org.jboss.ejb.plugins.CleanShutdownInterceptor
<!-- CMT -->
org.jboss.ejb.plugins.TxInterceptorCMT
org.jboss.ejb.plugins.MetricsInterceptor
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor
<!-- BMT -->
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor
org.jboss.ejb.plugins.TxInterceptorBMT
org.jboss.ejb.plugins.MetricsInterceptor
org.jboss.ejb.plugins.SecurityInterceptor
org.jboss.resource.connectionmanager.CachedConnectionInterceptor
org.jboss.ejb.plugins.StatefulHASessionSynchronisationInterceptor
</container-interceptors>
<client-interceptors>
org.jboss.proxy.ejb.HomeInterceptor
org.jboss.proxy.SecurityInterceptor
org.jboss.proxy.TransactionInterceptor
org.jboss.invocation.InvokerInterceptor
org.jboss.proxy.ejb.StatefulSessionInterceptor
org.jboss.proxy.SecurityInterceptor
org.jboss.proxy.TransactionInterceptor
org.jboss.invocation.InvokerInterceptor
</client-interceptors>
<instance-cache>org.jboss.ejb.plugins.StatefulHASessionInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.StatefulHASessionPersistenceManager</persistence-manager>
<transaction-manager>org.jboss.tm.TxManager</transaction-manager>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>50</min-capacity>
<max-capacity>1000000</max-capacity>
<remover-period>1800</remover-period>
<max-bean-life>1800</max-bean-life>
<overager-period>300</overager-period>
<max-bean-age>600</max-bean-age>
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
300
</container-pool-conf>
</container-configuration>
</container-configurations> -
4. Re: Clustering with no replication
albin Jul 7, 2003 5:53 AM (in response to albin)Sorry, I forgot to say what I try :
I copied the standard configuration and I changed container-invoker with ProxyFactoryHA.
This is the good way (there is no replication), but I want that all call for a same instance of stateful are on the same node (I don't like NPE :-) ). -
5. Re: Clustering with no replication
albin Jul 8, 2003 5:44 AM (in response to albin)I tried with jboss-3.2.2RC1 and I have the same result.
If I use my SFSB with the cluster tag but with the standard configuration : there is no load-balancing and no-replication.
If I use with this configuration :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<enterprise-beans>
<ejb-name>StatefulSkeletorEJB</ejb-name>
<jndi-name>ejb/StatefulSkeletorEJB</jndi-name>
<configuration-name>My Stateful SessionBean</configuration-name>
true
<cluster-config>
<partition-name>DefaultPartition</partition-name>
<home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</home-load-balance-policy>
<bean-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</bean-load-balance-policy>
<session-state-manager-jndi-name>/HASessionState/Default</session-state-manager-jndi-name>
</cluster-config>
</enterprise-beans>
<container-configurations>
<container-configuration extends="Standard Stateful SessionBean">
<container-name>My Stateful SessionBean</container-name>
<invoker-proxy-binding-name>clustered-stateful-rmi-invoker</invoker-proxy-binding-name>
<container-pool-conf>
300
</container-pool-conf>
</container-configuration>
</container-configurations>
Then, there is no replication and load-balancing, but calls on the same instance of my stateful are made on several nodes. But there is no replication, so nodes that have not created this instance respond by an Exception :
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.NoSuchObjectException: Could not activate; failed to restore state; CausedByException is:
/opt/jboss-3.2.2RC1/server/all/tmp/sessions/StatefulSkeletorEJB-dhvp9uwe-2i/dhvpf8h0-5t.ser (No such file or directory) -
6. Re: Clustering with no replication
saegis Jul 17, 2003 2:35 PM (in response to albin)Any luck yet?
I am also very interested to know.
My situation is we have some applications requiring large amount of memory, so we don't want to replicate them.
In each JBoss instance, we have one application running, and its session state information is always persisted in the database. So if one fails the client (heavy java client) can restart its own session with another server.
Bascially we need the load balancing feature of clustering without the memory replication.
Thanks. -
7. Re: Clustering with no replication
albin Jul 18, 2003 2:19 AM (in response to albin)Hello
I think that to have no replication but load-balancing we must have :
- somethink like this on jboss.xml:
<ejb-name>StatefulSessionEJB</ejb-name>
<jndi-name>ejb/StatefulSessionEJB</jndi-name>
<configuration-name>My Stateful SessionBean</configuration-name>
true
<cluster-config>
<partition-name>DefaultPartition</partition-name>
<home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</home-load-balance-policy>
<bean-load-balance-policy>org.jboss.ha.framework.interfaces.SameNode</bean-load-balance-policy>
<session-state-manager-jndi-name>/HASessionState/Default</session-state-manager-jndi-name>
</cluster-config>
<ejb-local-ref>
<ejb-ref-name>ejb/IlrRulesetDataSourceEJB</ejb-ref-name>
<jndi-name>ejb/IlrRulesetDataSourceEJB</jndi-name>
</ejb-local-ref>
<container-configurations>
<container-configuration extends="Standard Stateful SessionBean">
<container-name>My Stateful SessionBean</container-name>
<invoker-proxy-binding-name>clustered-stateful-rmi-invoker</invoker-proxy-binding-name>
<container-pool-conf>
300
</container-pool-conf>
</container-configuration>
</container-configurations>
- and write the new Class org.jboss.ha.framework.interfaces.SameNode that return the current node of the bean. So we should obtain no replication. The load balancing would be done on the create function and the instance would stay in the node of this create.
Are you agree Sacha ?