-
1. Re: [ HASingleton ] Configuring Preferred Master Node
hushen.savani Mar 31, 2012 8:10 AM (in response to hushen.savani)I found the solution anyway, I hope the same would be useful to other members as well:
Edit the file 'deploy-hasingleton-jboss-beans.xml'found in $Profile/deploy/cluster folder
Add the bean
<bean class="org.jboss.ha.singleton.PreferredMasterElectionPolicy" name="PreferredMasterElectionPolicy_1">
<property name="preferredMaster">0.0.0.0:1299</property>
</bean>
Note Here 0.0.0.0 is the IP address and 1299 is the jnp port.
replace with the appropriate IP and port
Also , add the property, <property name="electionPolicy"><inject bean="PreferredMasterElectionPolicy_1"/></property> to the bean HASingletonDeployer
For Example :
<bean name="HASingletonDeployer"
class="org.jboss.ha.singleton.HASingletonController">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.ha:service=HASingletonDeployer",
exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>
<depends>HAPartition</depends>
<!-- Have the BarrierController that listens for our JMX
notifications start first. -->
<depends>HASingletonDeployerBarrierController</depends>
<property name="HAPartition"><inject bean="HAPartition"/></property>
<property name="target"><inject bean="HASingletonProfileManager"/></property>
<property name="electionPolicy"><inject bean="PreferredMasterElectionPolicy_1"/></property>
<property name="targetStartMethod">activateProfile</property>
<property name="targetStopMethod">releaseProfile</property>
<!-- whether to register thread context classloader for the RPC handler, default is false -->
<!--<property name="registerThreadContextClassLoader">false</property>-->
<!-- Whether the singleton should be restarted (i.e. invoke the TargetStopMethod and then the
TargetStartMethod) if a cluster merge occurs while this node is the singleton master.
A cluster merge means there may have been more than one singleton master during the period
when communication between some or all of the nodes in the cluster was disrupted; hence the
surviving master may not be aware of state changes made by another master. Restarting the
singleton gives it a signal that it should refresh its internal state from any external
store.
By default this is set to true.
-->
<property name="restartOnMerge">true</property>
</bean>
Best Regards,
Hushen Savani
-
2. Re: [ HASingleton ] Configuring Preferred Master Node
nami_30 Nov 5, 2012 4:09 AM (in response to hushen.savani)Hi Hushen,
When i followed ur solution.
If the master is stopped, then the war files in other nodes are getting undeployed.
Example: Say A and B are 2 nodes. A is made master node with configurations you have told.
So i can access through browser. But if i stop A , then B should serve the request. But as i see the war file present under all/deploy-hasingleton
is getting undeployed when i stop A.(I cannot see war file there).
And so the request is not serviced.
What might be the problem and how to solve this.