Nope.

http://activemq.apache.org/can-two-brokers-share-the-same-database.html


On Oct 7, 2010, at 12:49 AM, Tobias Trelle wrote:

> 
> I'm working on a distributed failover solution with two AMQ instances I_1 on
> hardware node N_1 and I_2 on N_2, both using a common JDBC persistence store
> on a DB2 database (I know KahaDB rocks, but my customer feels a lot better
> with his DB2 running for decades).
> 
> First, I start instance I_1. It obtains an exclusive lock on table
> ACTIVEMQ_LOCK and becomes the master. This shows up in the log of I_1:
> 
> ...
> INFO | Using Persistence Adapter:
> JDBCPersistenceAdapter(org.apache.commons.dbcp.basicdatasou...@e11e831)
> INFO | Database adapter driver override recognized for :
> [ibm_db2_jdbc_universal_driver_architecture] - adapter: class
> org.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter
> INFO | Database lock driver override not found for :
> [ibm_db2_jdbc_universal_driver_architecture].  Will use default
> implementation.
> INFO | Attempting to acquire the exclusive lock to become the Master broker
> INFO | Becoming the master on dataSource:
> org.apache.commons.dbcp.basicdatasou...@e11e831
> INFO | ActiveMQ 5.4.1 JMS Message Broker (localhost) is starting
> ...
> 
> Then I start instance I_2. It hangs and waits for the lock (thus becoming a
> slave?):
> 
> ...
> INFO |
> PListStore:C:\dev\bin\apache-activemq-5.4.1-b\bin\..\data\localhost\tmp_storage
> started
> INFO | Using Persistence Adapter:
> JDBCPersistenceAdapter(org.apache.commons.dbcp.basicdatasou...@275e538e)
> INFO | Database adapter driver override recognized for :
> [ibm_db2_jdbc_universal_driver_architecture] - adapter: class
> org.apache.activemq.store.jdbc.adapter.DB2JDBCAdapter
> 
> Is this the desired behaiviour?  If I shut down I_1, I_2 continues and
> finally becomes the new master instance.
> 
> If I understand http://activemq.apache.org/jdbc-master-slave.html correctly,
> there is only ONE master at all times, even if there are N slaves waiting
> idle for the lock?
> 
> Is it possible to combine the above failover solution with load balancing,
> i.e. having more than one active master, all of them sharing the same JDBC
> persistence store?
> -- 
> View this message in context: 
> http://activemq.2283324.n4.nabble.com/JDBC-Master-Slave-Patter-Understanding-Locking-tp2966254p2966254.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Johan Edstrom

j...@opennms.org

They that can give up essential liberty to purchase a little temporary safety, 
deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759





Reply via email to