activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From farhad>
Subject Re: Fail to acquire lock. Stays as "slave"
Date Mon, 04 Jul 2011 15:31:18 GMT
Sorry for the previous email. Here it is in a readable format:
We've been running activemq embedded brokers (5.4.2) with jboss 6.0 for a
while now without any problems. We've been using four brokers in a
master/slave configuration mixed with broker networks topoloy.
Now we are going to run activemq 5.5.0 as sandalone broker. In the meantime
we have an odd problem which apparantly should have been resolved in
previous versions, but still show up in v. 5.5.0. Here is a short
description of the problem when running with a single broker:
- When booting the server machine, the activemq broker comes up and acquire
the lock to the database, becomes the master and voila. 
- When you stop the broker, and restart it, then the broker is unable to
acquire the lock and stays as slave. There is no error when stopping the
# /etc/init.d/activemq stop
Shutting down ActiveMQ: INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/local/java/bin/java'
INFO: Waiting at least 30 seconds for regular process termination of pid
'3195' : 
Java Runtime: Sun Microsystems Inc. 1.6.0_16 /usr/local/jdk1.6.0_16/jre
  Heap sizes: current=251264k  free=249951k  max=251264k
    JVM args: -Xms256M -Xmx256M
-Dactivemq.home=/usr/local/activemq -Dactivemq.base=/usr/local/activemq
ACTIVEMQ_HOME: /usr/local/activemq
ACTIVEMQ_BASE: /usr/local/activemq
Connecting to pid: 3195
Stopping broker: satellite1
                                                           [  OK  ]
Although jconsole tell that the broker is "slave", I am able to send
messages to it and they get stored in the database!!

Here is the setup:
Server: Linux 2.6.32-131.4.1.el6.x86_64 #1 SMP Fri Jun 10
10:54:26 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
Database: mysql  Ver 14.14 Distrib 5.1.52, for redhat-linux-gnu (x86_64)
using readline 5.1
Mysql driver: mysql-connector-java-5.1.13.jar
Activemq: 5.5.0
Java: 1.6.0_16


        <property name="locations">

    <broker xmlns="" useJmx="true"
useShutdownHook="false" advisorySupport="true" brokerName="satellite1"
           <policyEntry queue=">">
               <sharedDeadLetterStrategy processExpired="false"
processNonPersistent="false" />
               <roundRobinDispatchPolicy />
       <managementContext connectorPort="11099" rmiServerPort="11098" />

dataDirectory="${activemq.base}/activemq-data" dataSource="#mysql-ds"/>

      <transportConnector name="openwire" uri="tcp://"/>


  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
    <property name="username" value="xxx"/>
    <property name="password" value="xxx"/>
    <property name="poolPreparedStatements" value="true"/>

Log messages when activemq is restarted:
2011-07-04 16:02:44,655 | INFO  | Refreshing
org.apache.activemq.xbean.XBeanBrokerFactory$1@6f25844f: startup date [Mon
Jul 04 16:02:44 CEST 2011]; root of context hierarchy |
org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
2011-07-04 16:02:45,395 | INFO  |
PListStore:/usr/local/activemq/data/satellite1/tmp_storage started | | main
2011-07-04 16:02:45,478 | INFO  | JMX consoles can connect to
service:jmx:rmi://localhost:11098/jndi/rmi://localhost:11099/jmxrmi | | JMX connector
2011-07-04 16:02:45,481 | INFO  | Using Persistence Adapter:
JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@6d46b6db) | | main
2011-07-04 16:02:45,746 | INFO  | Database adapter driver override
recognized for : [mysql-ab_jdbc_driver] - adapter: class | | main
2011-07-04 16:03:36,840 | INFO  | Database lock driver override not found
for : [mysql-ab_jdbc_driver].  Will use default implementation. | | main
2011-07-04 16:03:36,842 | INFO  | Attempting to acquire the exclusive lock
to become the Master broker | | main
2011-07-04 16:04:27,862 | INFO  | Failed to acquire lock.  Sleeping for 1000
milli(s) before trying again... | | main

I'd appreciate any help,

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message