activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcort <Tom.C...@state.vt.us>
Subject Slave waiting for lock during JBoss Deployment
Date Mon, 12 Mar 2007 19:34:13 GMT

About my setup:
I'm running ActiveMQ (4.2 Snapshot) on JBoss (4.0.4) with Java (1.5) on
Debian GNU/Linux (stable/sarge). I have 2 JBoss instances and 2 MySQL
(5.0.32) instances. MySQL's database replication is setup and working. I
have ActiveMQ setup in a JDBC Master Slave configuration.

What I want:
I'd like one broker that either JBoss instance can connect to. If the Master
broker goes down, I want the salve to take over as the Master. If possible,
I'd like to create one EAR file that can be deployed on both servers.

What is happening:
It sort of works. I start one JBoss instance and it is happy. I try to start
the second instance and the second instance hangs mid-deployment. The last
message in server.log before it hangs is: "2007-03-12 13:34:57,194 INFO 
[org.apache.activemq.store.jdbc.JDBCPersistenceAdapter] Database driver
recognized: [mysql-ab_jdbc_driver]". When I shutdown the first instance, the
second instance finishes deploying and is happy.

My Ideas:
>From the log messages, archives I've searched, and documentation I've read,
it looks like the second instance is waiting for the first instance to
release a lock.

The Question:
Is there a way to have the second instance (the slave broker) create a
separate thread that waits for the master to fail so that it doesn't hold up
the deployment of the application? Is there some sort of NOWAIT option? Or
do you have any suggestions for a different strategy?

Here's the broker config. If you need any other information, let me know.
Thank you.

<beans>
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  </bean>
  
  <broker xmlns="http://activemq.org/config/1.0" useJmx="true"
brokerName="sstp.broker2">
    <memoryManager>  
      <usageManager id="memory-manager" limit="50 MB"/>
    </memoryManager>
    <persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#mysql-ds" />
    </persistenceAdapter>
    <transportConnectors>
       <transportConnector name="gateway"
uri="tcp://localhost:61616?trace=true"
discoveryUri="multicast://gateway-production"/>
    </transportConnectors>
    
    <networkConnectors>
      <networkConnector name="gateway-nc"
uri="multicast://gateway-production"/>
    </networkConnectors>
    
  </broker>

  <commandAgent xmlns="http://activemq.org/config/1.0"/>

  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
value="jdbc:mysql://db-server:3306/AMQ?relaxAutoCommit=true"/>
    <property name="username" value="username"/>
    <property name="password" value="secret"/>
    <property name="poolPreparedStatements" value="true"/>
    <property name="initialSize" value="5"/>
  </bean>
</beans>

-- 
View this message in context: http://www.nabble.com/Slave-waiting-for-lock-during-JBoss-Deployment-tf3391722s2354.html#a9441644
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message