Masternode not starting on 5.1.0.GA
tommy01 Feb 11, 2010 11:12 AMhi all...
I have a mbean that is configured to work as a HA singleton. It is working great in 4.2.3.GA. Here is the config:
<mbean code="org.jboss.ha.singleton.HASingletonController"
name="org.jobmanager.jmx:service=JobManager-HASingletonController">
<depends>jboss:service=ReportingServicePartition-Development</depends>
<depends>
org.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-1.4.1)
</depends>
<attribute name="TargetName">
org.jobmanager.jmx:service=JobManager,job=REPORT(reporting-service-1.4.1)
</attribute>
<attribute name="TargetStartMethod">startSingleton</attribute>
<attribute name="TargetStopMethod">stopSingleton</attribute>
</mbean>
when starting JBoss, I execute:
sh run.sh -g ReportingServicePartition-Development -c all -Djava.io.tmpdir=../server/all/tmp
In 4.2.3.GA JBoss determines the master. In my code, I only start my mbean when it's the masterNode and this is working great. If the master fails, then the mbean started on another node.
Trying to migrate to 5.1.0.GA, it seems like the master is never determined. When I start either 1 or 2 nodes, my mbean never starts. It doesn't start since isMasterNode is always false. If I remove the isMasterNode start condition, then the mbean works. But, it starts on ALL the nodes, which is not what I want.
Here's my startSingleton, stopSingleton and isMasterNode methods:
/**
* Stops the Job Manager
*
* @jmx.managed-operation description="Starts Singleton Service"
*/
public void startSingleton() {
isMasterNode = true;
if (logger.isInfoEnabled())
{
logger.info("JobManager.startSingleton isMasterNode -> " + isMasterNode);
}
this.start();
}
/**
* Stops the Job Manager
*
* @jmx.managed-operation description="Checks to see if this is Master"
*/
public boolean isMasterNode() {
if (logger.isInfoEnabled())
{
logger.info("JobManager.isMasterNode -> " + isMasterNode);
}
return isMasterNode;
}
/**
* Stops the Job Manager
*
* @jmx.managed-operation description="Stops Singleton Service"
*/
public void stopSingleton() {
isMasterNode = false;
if (logger.isInfoEnabled())
{
logger.info("JobManager.stopSingleton isMasterNode -> " + isMasterNode);
}
}
Looking at the clustering guide for 5.1.0.GA, I don't see any changes to the start/stop/isMasterNode methods. Is there some other configuration that I need to worry about for the isMasterNode to be set to true??
thanks